From bc8ad1b1cda0dd21b5b0b816b386b0bf96d5891a Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 10 Jun 2006 08:56:40 +0000 Subject: bitbake: Update against upstream stable branch (includes srcdate='now' support) git-svn-id: https://svn.o-hand.com/repos/poky/trunk@458 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- bitbake/bin/bitbake | 16 ++++++++++++---- bitbake/doc/manual/usermanual.xml | 8 ++++---- bitbake/lib/bb/fetch/__init__.py | 22 ++++++++++++++++++++++ bitbake/lib/bb/fetch/cvs.py | 8 +------- bitbake/lib/bb/fetch/svk.py | 4 +--- bitbake/lib/bb/fetch/svn.py | 11 ++++------- 6 files changed, 44 insertions(+), 25 deletions(-) (limited to 'bitbake') diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 10cf4bd00a..7fbe7ed5eb 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake @@ -781,11 +781,19 @@ class BBCooker: try: self.configuration.data = bb.parse.handle( afile, self.configuration.data ) - # Add the handlers we inherited by INHERITS + # Add the handlers we inherited by INHERIT + # we need to do this manually as it is not guranteed + # we will pick up these classes... as we only INHERIT + # on .inc and .bb files but not on .conf + data = bb.data.createCopy( self.configuration.data ) + inherits = ["base"] + (bb.data.getVar('INHERIT', data, True ) or "").split() + for inherit in inherits: + data = bb.parse.handle( os.path.join('classes', '%s.bbclass' % inherit ), data, True ) + # FIXME: This assumes that we included at least one .inc file - for var in bb.data.keys(self.configuration.data): - if bb.data.getVarFlag(var, 'handler', self.configuration.data): - bb.event.register(var,bb.data.getVar(var,self.configuration.data)) + for var in bb.data.keys(data): + if bb.data.getVarFlag(var, 'handler', data): + bb.event.register(var,bb.data.getVar(var, data)) except IOError: bb.fatal( "Unable to open %s" % afile ) diff --git a/bitbake/doc/manual/usermanual.xml b/bitbake/doc/manual/usermanual.xml index 33150b10f2..c314236c6f 100644 --- a/bitbake/doc/manual/usermanual.xml +++ b/bitbake/doc/manual/usermanual.xml @@ -250,9 +250,9 @@ a per URI parameters separated by a ; consisting of a key and a v
CVS File Fetcher - The URN for the CVS Fetcher is cvs. This Fetcher honors the variables DL_DIR, SRCDATE, FETCHCOMMAND_cvs, UPDATECOMMAND_cvs. DL_DIRS specifies where a temporary checkout is saved, SRCDATE specifies which date to use when doing the fetching, FETCHCOMMAND and UPDATECOMMAND specify which executables should be used when doing the CVS checkout or update. + The URN for the CVS Fetcher is cvs. This Fetcher honors the variables DL_DIR, SRCDATE, FETCHCOMMAND_cvs, UPDATECOMMAND_cvs. DL_DIRS specifies where a temporary checkout is saved, SRCDATE specifies which date to use when doing the fetching (the special value of "now" will cause the checkout to be updated on every build), FETCHCOMMAND and UPDATECOMMAND specify which executables should be used when doing the CVS checkout or update. - The supported Parameters are module, tag, date, method, localdir, rsh. The module specifies which module to check out, the tag describes which CVS TAG should be used for the checkout by default the TAG is empty. A date can be specified to override the SRCDATE of the configuration to checkout a specific date. method is by default pserver, if ext is used the rsh parameter will be evaluated and CVS_RSH will be set. Finally localdir is used to checkout into a special directory relative to CVSDIR>. + The supported Parameters are module, tag, date, method, localdir, rsh. The module specifies which module to check out, the tag describes which CVS TAG should be used for the checkout by default the TAG is empty. A date can be specified to override the SRCDATE of the configuration to checkout a specific date. The special value of "now" will cause the checkout to be updated on every build.method is by default pserver, if ext is used the rsh parameter will be evaluated and CVS_RSH will be set. Finally localdir is used to checkout into a special directory relative to CVSDIR>. SRC_URI = "cvs://CVSROOT;module=mymodule;tag=some-version;method=ext" SRC_URI = "cvs://CVSROOT;module=mymodule;date=20060126;localdir=usethat" @@ -275,7 +275,7 @@ will be tried first when fetching a file if that fails the actual file will be t
SVK Fetcher - Currently NOT suppoered + Currently NOT supported
@@ -283,7 +283,7 @@ will be tried first when fetching a file if that fails the actual file will be t SVN Fetcher The URN for the SVN Fetcher is svn. - The Variables FETCHCOMMAND_svn, DL_DIR are used by the SVN Fetcher. FETCHCOMMAND contains the subversion command, DL_DIR is the directory where tarballs will be saved. + This Fetcher honors the variables FETCHCOMMAND_svn, DL_DIR, SRCDATE. FETCHCOMMAND contains the subversion command, DL_DIR is the directory where tarballs will be saved, SRCDATE specifies which date to use when doing the fetching (the special value of "now" will cause the checkout to be updated on every build). The supported Parameters are proto, rev. proto is the subversion prototype, rev is the subversions revision. diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py index ac698a0d1c..a2defd25a5 100644 --- a/bitbake/lib/bb/fetch/__init__.py +++ b/bitbake/lib/bb/fetch/__init__.py @@ -185,6 +185,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/bitbake/lib/bb/fetch/cvs.py b/bitbake/lib/bb/fetch/cvs.py index 10ec700dc9..0b2477560a 100644 --- a/bitbake/lib/bb/fetch/cvs.py +++ b/bitbake/lib/bb/fetch/cvs.py @@ -128,13 +128,7 @@ class Cvs(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 cvs checkout." % tarfn) - continue - - # try to use the tarball stash - if Fetch.try_mirror(d, tarfn): + if Fetch.check_for_tarball(d, tarfn, dldir, date): continue if date: diff --git a/bitbake/lib/bb/fetch/svk.py b/bitbake/lib/bb/fetch/svk.py index c0819da3dc..19103213cd 100644 --- a/bitbake/lib/bb/fetch/svk.py +++ b/bitbake/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/bitbake/lib/bb/fetch/svn.py b/bitbake/lib/bb/fetch/svn.py index 6e3a9277ab..d1a959371b 100644 --- a/bitbake/lib/bb/fetch/svn.py +++ b/bitbake/lib/bb/fetch/svn.py @@ -111,13 +111,7 @@ class Svn(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 svn checkout." % tarfn) - continue - - # try to use the tarball stash - if Fetch.try_mirror(d, tarfn): + if Fetch.check_for_tarball(d, tarfn, dldir, date): continue olddir = os.path.abspath(os.getcwd()) @@ -133,6 +127,9 @@ class Svn(Fetch): 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) -- cgit v1.2.3