From befeeef96230980a170a0de329fe9ea4af2d3ce5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 2 Aug 2007 23:52:40 +0000 Subject: fetcher updates: Add SRCREV support to git, fix svn SRCREV lockdown support, clean up fetcher force options, finish sortable_revision implementation --- lib/bb/fetch/svn.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/bb/fetch/svn.py') diff --git a/lib/bb/fetch/svn.py b/lib/bb/fetch/svn.py index e16ec4ba7..ca12efe15 100644 --- a/lib/bb/fetch/svn.py +++ b/lib/bb/fetch/svn.py @@ -62,15 +62,22 @@ class Svn(Fetch): ud.revision = "" else: # - # ***Nasty hack*** + # ***Nasty hacks*** # If DATE in unexpanded PV, use ud.date (which is set from SRCDATE) # Will warn people to switch to SRCREV here # + # How can we tell when a user has overriden SRCDATE? + # check for "get_srcdate" in unexpanded SRCREV - ugly + # pv = data.getVar("PV", d, 0) if "DATE" in pv: ud.revision = "" else: - ud.revision = self.latest_revision(url, ud, d) + rev = data.getVar("SRCREV", d, 0) + if "get_srcrev" in rev: + ud.revision = self.latest_revision(url, ud, d) + else: + ud.revision = rev ud.date = "" ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d) @@ -128,7 +135,7 @@ class Svn(Fetch): """Fetch url""" # try to use the tarball stash - if not self.forcefetch(loc, ud, d) and Fetch.try_mirror(d, ud.localfile): + if Fetch.try_mirror(d, ud.localfile): bb.msg.debug(1, bb.msg.domain.Fetcher, "%s already exists or was mirrored, skipping svn checkout." % ud.localpath) return -- cgit 1.2.3-korg