From: Richard Purdie Date: Sat, 17 Nov 2007 22:20:55 +0000 (+0000) Subject: bitbake/fetchers: Sync with upstream bitbake X-Git-Tag: 2011-1~10230 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=688eca78c088dc45957dde6cc74204f5ac83e5ca;p=openembedded-core.git bitbake/fetchers: Sync with upstream bitbake git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3191 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- diff --git a/bitbake/lib/bb/fetch/bzr.py b/bitbake/lib/bb/fetch/bzr.py index 76dde3a0bd..b23e9eef86 100644 --- a/bitbake/lib/bb/fetch/bzr.py +++ b/bitbake/lib/bb/fetch/bzr.py @@ -45,16 +45,14 @@ class Bzr(Fetch): relpath = relpath[1:] ud.pkgdir = os.path.join(data.expand('${BZRDIR}', d), ud.host, relpath) - if 'rev' in ud.parm: - ud.revision = ud.parm['rev'] - else: - rev = data.getVar("SRCREV", d, 1) - if rev is "SRCREVINACTION": - rev = self.latest_revision(url, ud, d) - if rev: - ud.revision = rev - else: - ud.revision = "" + revision = Fetch.srcrev_internal_helper(ud, d) + if revision is True: + ud.revision = self.latest_revision(url, ud, d) + elif revision: + ud.revision = revision + + if not ud.revision: + ud.revision = self.latest_revision(url, ud, d) ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d) @@ -147,7 +145,10 @@ class Bzr(Fetch): def _sortable_revision(self, url, ud, d): """ Return a sortable revision number which in our case is the revision number - (use the cached version to avoid network access) """ - return self.latest_revision(url, ud, d) + return self._build_revision(url, ud, d) + + def _build_revision(self, url, ud, d): + return ud.revision + diff --git a/bitbake/lib/bb/fetch/git.py b/bitbake/lib/bb/fetch/git.py index 5984818f9e..21259a23b0 100644 --- a/bitbake/lib/bb/fetch/git.py +++ b/bitbake/lib/bb/fetch/git.py @@ -134,4 +134,5 @@ class Git(Fetch): return output.split()[0] def _build_revision(self, url, ud, d): - return ud.tag + return ud.tag + diff --git a/bitbake/lib/bb/fetch/hg.py b/bitbake/lib/bb/fetch/hg.py index 6b93822803..ee3bd2f7fe 100644 --- a/bitbake/lib/bb/fetch/hg.py +++ b/bitbake/lib/bb/fetch/hg.py @@ -57,14 +57,6 @@ class Hg(Fetch): if 'rev' in ud.parm: ud.revision = ud.parm['rev'] - #else: - # rev = data.getVar("SRCREV", d, 1) - # if rev is "SRCREVINACTION": - # rev = self.latest_revision(url, ud, d) - # if rev: - # ud.revision = rev - # else: - # ud.revision = "" ud.localfile = data.expand('%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision), d) diff --git a/bitbake/lib/bb/fetch/perforce.py b/bitbake/lib/bb/fetch/perforce.py index 97b618228b..b594d2bde2 100644 --- a/bitbake/lib/bb/fetch/perforce.py +++ b/bitbake/lib/bb/fetch/perforce.py @@ -37,7 +37,7 @@ class Perforce(Fetch): return ud.type in ['p4'] def doparse(url,d): - parm=[] + parm = {} path = url.split("://")[1] delim = path.find("@"); if delim != -1: