diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2006-05-31 21:10:06 +0000 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2006-05-31 21:10:06 +0000 |
commit | f43dad99ae018be3779724899be89f00eda935f4 (patch) | |
tree | ce5af6865f8bd2f473261bc6dace06bfd7caf35f /lib/bb/fetch | |
parent | 55d4e1b0ed5df0c1d7b66e21f61302849b65aec9 (diff) | |
download | bitbake-f43dad99ae018be3779724899be89f00eda935f4.tar.gz |
bitbake/lib/bb/fetch/*: Implement special 'now' handling for BitBake
Patch courtsey Justin Patrin to teach BitBake SRCDATE="now" handling.
If SRCDATE is set to now we will not look at the temporary DL_DIR
for a saved tarball as we want to download a new version. OpenEmbedded
should consider stamping the do fetch phase.
Justin thanks for the patch and sorry for all the trouble
bitbake/doc/manual/usermanual.xml: Document the 'now' method for svn,svk and cvs
Diffstat (limited to 'lib/bb/fetch')
-rw-r--r-- | lib/bb/fetch/__init__.py | 23 | ||||
-rw-r--r-- | lib/bb/fetch/cvs.py | 2 | ||||
-rw-r--r-- | lib/bb/fetch/svk.py | 4 | ||||
-rw-r--r-- | lib/bb/fetch/svn.py | 6 |
4 files changed, 30 insertions, 5 deletions
diff --git a/lib/bb/fetch/__init__.py b/lib/bb/fetch/__init__.py index a1d7396ce..c69de2bb0 100644 --- a/lib/bb/fetch/__init__.py +++ b/lib/bb/fetch/__init__.py @@ -173,6 +173,7 @@ class Fetch(object): """ tarpath = os.path.join(data.getVar("DL_DIR", d, 1), tarfn) if os.access(tarpath, os.R_OK): + bb.debug(1, "%s already exists, skipping checkout." % tarfn) return True pn = data.getVar('PN', d, True) @@ -192,6 +193,28 @@ class Fetch(object): return False try_mirror = staticmethod(try_mirror) + def check_for_tarball(d, tarfn, dldir, date): + """ + Check for a local copy then check the tarball stash. + Both checks are skipped if date == 'now'. + + d Is a bb.data instance + tarfn is the name of the tarball + date is the SRCDATE + """ + if "now" != date: + dl = os.path.join(dldir, tarfn) + if os.access(dl, os.R_OK): + bb.debug(1, "%s already exists, skipping checkout." % tarfn) + return True + + # try to use the tarball stash + if Fetch.try_mirror(d, tarfn): + return True + return False + check_for_tarball = staticmethod(check_for_tarball) + + import cvs import git import local diff --git a/lib/bb/fetch/cvs.py b/lib/bb/fetch/cvs.py index b2a65de24..17952ed41 100644 --- a/lib/bb/fetch/cvs.py +++ b/lib/bb/fetch/cvs.py @@ -129,7 +129,7 @@ class Cvs(Fetch): data.setVar('TARFN', tarfn, localdata) # try to use the tarball stash - if Fetch.try_mirror(d, tarfn): + if Fetch.check_for_tarball(d, tarfn, dldir, date): bb.debug(1, "%s already exists or was mirrored, skipping cvs checkout." % tarfn) continue diff --git a/lib/bb/fetch/svk.py b/lib/bb/fetch/svk.py index c0819da3d..19103213c 100644 --- a/lib/bb/fetch/svk.py +++ b/lib/bb/fetch/svk.py @@ -101,9 +101,7 @@ class Svk(Fetch): data.setVar('TARFILES', dlfile, localdata) data.setVar('TARFN', tarfn, localdata) - dl = os.path.join(dldir, tarfn) - if os.access(dl, os.R_OK): - bb.debug(1, "%s already exists, skipping svk checkout." % tarfn) + if Fetch.check_for_tarball(d, tarfn, dldir, date): continue olddir = os.path.abspath(os.getcwd()) diff --git a/lib/bb/fetch/svn.py b/lib/bb/fetch/svn.py index ee57ea61d..04dd4e08d 100644 --- a/lib/bb/fetch/svn.py +++ b/lib/bb/fetch/svn.py @@ -112,7 +112,7 @@ class Svn(Fetch): data.setVar('TARFN', tarfn, localdata) # try to use the tarball stash - if Fetch.try_mirror(d, tarfn): + if Fetch.check_for_tarball(d, tarfn, dldir, date): bb.debug(1, "%s already exists or was mirrored, skipping svn checkout." % tarfn) continue @@ -127,8 +127,12 @@ class Svn(Fetch): svncmd = data.getVar('FETCHCOMMAND', localdata, 1) svncmd = "svn co -r {%s} %s://%s/%s" % (date, proto, svnroot, module) + # either use the revision or if SRCDATE is now no braces if revision: svncmd = "svn co -r %s %s://%s/%s" % (revision, proto, svnroot, module) + elif date == "now": + svncmd = "svn co %s://%s/%s" % (proto, svnroot, module) + if svn_rsh: svncmd = "svn_RSH=\"%s\" %s" % (svn_rsh, svncmd) |