From: Yu Ke <ke.yu@intel.com>
To: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Cc: poky@yoctoproject.org
Subject: Re: PREMIRRORS in yocto, do they actually work?
Date: Thu, 6 Jan 2011 19:07:02 +0800 [thread overview]
Message-ID: <20110106110702.GD20168@kyu3-hedt> (raw)
In-Reply-To: <AANLkTinkHGD33rsrJUXBxdva2S_hQXniN=nXFsoU5rMu@mail.gmail.com>
On Jan 06, 08:39, Frans Meulenbroeks wrote:
> 2011/1/6 Yu Ke <ke.yu@intel.com>:
> > On Jan 02, 10:15, Gary Thomas wrote:
> >> On 01/02/2011 10:08 AM, Koen Kooi wrote:
> >> >Hi,
> >> >
> >> >I would like to have the fetchter try my PREMIRROS first before trying to fetch from git. In OE I have the following in a bbclass:
> >> >
> >> >PREMIRRORS_append () {
> >> >git://.*/.* http://www.angstrom-distribution.org/unstable/sources/
> >> >}
> >> >
> >> >When used in OE that works, but in yocto it doesn't. So I tried to do it poky style in a .inc:
> >> >
> >> >PREMIRRORS_append = "\
> >> >git://.*/.* http:/www.angstrom-distribution.org/sources/ \n"
> >> >
> >> >Which also doesn't work since it doesn't try to fetch from there, but it does mention "http:/www.angstrom-distribution.org/sources/" in the fetch error message when git read-tree fails.
> >> >
> >> >So my question: how do I make it work in yocto like it works in OE?
> >>
> >> I too have been struggling with this as I'd like to have
> >> a local repository to hold the current source set. Sadly,
> >> as you've observed, it doesn't work, at least not as expected.
> >
> > I've tried to use file:///some/dir as PREMIRROR, and found it does has issue. The main reason is that the local.py fetcher does not do real copy in go() method. Although it make sense in normal fetch case, it does cause trouble in try_mirror() case.
> >
> > I don't have simple idea to address this issue yet and I will take care of it in the coming fetcher change. As a quick workaround, could you try this approach: use http://local/some/dir as PREMIRROR? e.g. if you use /opt/source as mirror, you can add to meta/conf/distro/poky.conf:
> > PREMIRRORS_append = "\
> > git://.*/.* http://local/opt/source/ \n \
> > svn://.*/.* http://local/opt/source/ \n \
> > ...
> > "
> >
> > in this case, wget.py fetcher will be used, and it works fine in try_mirror() case. Also the /opt/source can be read-only.
> >
> > Regards
> > Ke
>
> Thanks for the info Ke.
> One additional question on this topic.
> is it also possible to block fetching from the original source?
> I'm looking for an easy, automated way to verify that all sources for
> our products are indeed on our public server (to verify GPL
> compliance).
sorry taht I am not aware of such way, maybe other people has ideas.
If it is for one time verification, probably you can try the following patch. But I am not sure if it is desirable for upstream checked in.
Regards
Ke
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index 67e5add..eb053e1 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -286,6 +286,8 @@ def go(d, urls = None):
if m.forcefetch(u, ud, d) or not localpath:
# Next try fetching from the original uri, u
try:
+ if bb.data.getVar("BB_FETCH_MIRROR_ONLY", d, True) == "1":
+ raise FetchError("Only allow to fetch from mirror")
m.go(u, ud, d)
localpath = ud.localpath
except FetchError:
>
> Frans
> _______________________________________________
> poky mailing list
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky
next prev parent reply other threads:[~2011-01-06 10:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-02 17:08 PREMIRRORS in yocto, do they actually work? Koen Kooi
2011-01-02 17:15 ` Gary Thomas
2011-01-06 7:14 ` Yu Ke
2011-01-06 7:39 ` Frans Meulenbroeks
2011-01-06 11:07 ` Yu Ke [this message]
2011-01-06 12:08 ` Frans Meulenbroeks
2011-01-06 15:06 ` Gary Thomas
2011-01-07 7:55 ` Yu Ke
2011-01-14 22:05 ` Gary Thomas
2011-01-02 17:15 ` Koen Kooi
[not found] ` <1293990824.18787.428.camel@eha>
2011-01-02 19:01 ` Koen Kooi
2011-01-06 7:00 ` Yu Ke
2011-01-06 7:18 ` Koen Kooi
2011-01-06 10:22 ` Yu Ke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110106110702.GD20168@kyu3-hedt \
--to=ke.yu@intel.com \
--cc=fransmeulenbroeks@gmail.com \
--cc=poky@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.