summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/fetch
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-08-20 07:48:43 +0000
committerRichard Purdie <richard@openedhand.com>2007-08-20 07:48:43 +0000
commitd8bfa5c6eff1cff34895304a33be671fb141084e (patch)
tree8f63f2cad401f42f5dd30930b0f042aa9c5bdaf8 /bitbake/lib/bb/fetch
parente68823a20c6e3b629c947bc7e329e5ea71a9860c (diff)
downloadopenembedded-core-d8bfa5c6eff1cff34895304a33be671fb141084e.tar.gz
openembedded-core-d8bfa5c6eff1cff34895304a33be671fb141084e.tar.bz2
openembedded-core-d8bfa5c6eff1cff34895304a33be671fb141084e.zip
bitbake: Sync with 1.8.8 release
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2513 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/fetch')
-rw-r--r--bitbake/lib/bb/fetch/__init__.py39
-rw-r--r--bitbake/lib/bb/fetch/svn.py9
2 files changed, 26 insertions, 22 deletions
diff --git a/bitbake/lib/bb/fetch/__init__.py b/bitbake/lib/bb/fetch/__init__.py
index bbff516ffc..c34405738b 100644
--- a/bitbake/lib/bb/fetch/__init__.py
+++ b/bitbake/lib/bb/fetch/__init__.py
@@ -135,26 +135,27 @@ def go(d):
for u in urldata:
ud = urldata[u]
m = ud.method
- if ud.localfile and not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
- # File already present along with md5 stamp file
- # Touch md5 file to show activity
- os.utime(ud.md5, None)
- continue
- lf = open(ud.lockfile, "a+")
- fcntl.flock(lf.fileno(), fcntl.LOCK_EX)
- if ud.localfile and not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
- # If someone else fetched this before we got the lock,
- # notice and don't try again
- os.utime(ud.md5, None)
+ if ud.localfile:
+ if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
+ # File already present along with md5 stamp file
+ # Touch md5 file to show activity
+ os.utime(ud.md5, None)
+ continue
+ lf = open(ud.lockfile, "a+")
+ fcntl.flock(lf.fileno(), fcntl.LOCK_EX)
+ if not m.forcefetch(u, ud, d) and os.path.exists(ud.md5):
+ # If someone else fetched this before we got the lock,
+ # notice and don't try again
+ os.utime(ud.md5, None)
+ fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
+ lf.close
+ continue
+ m.go(u, ud, d)
+ if ud.localfile:
+ if not m.forcefetch(u, ud, d):
+ Fetch.write_md5sum(u, ud, d)
fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
lf.close
- continue
- m.go(u, ud, d)
- if ud.localfile and not m.forcefetch(u, ud, d):
- Fetch.write_md5sum(u, ud, d)
- fcntl.flock(lf.fileno(), fcntl.LOCK_UN)
- lf.close
-
def localpaths(d):
"""
@@ -339,7 +340,7 @@ class Fetch(object):
pn = data.getVar("PN", d, 1)
if pn:
- return data.getVar("SRCDATE_%s" % pn, d, 1) or data.getVar("CVSDATE_%s" % pn, d, 1) or data.getVar("DATE", d, 1)
+ return data.getVar("SRCDATE_%s" % pn, d, 1) or data.getVar("CVSDATE_%s" % pn, d, 1) or data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
return data.getVar("SRCDATE", d, 1) or data.getVar("CVSDATE", d, 1) or data.getVar("DATE", d, 1)
getSRCDate = staticmethod(getSRCDate)
diff --git a/bitbake/lib/bb/fetch/svn.py b/bitbake/lib/bb/fetch/svn.py
index ca12efe158..af8543ab34 100644
--- a/bitbake/lib/bb/fetch/svn.py
+++ b/bitbake/lib/bb/fetch/svn.py
@@ -74,11 +74,14 @@ class Svn(Fetch):
ud.revision = ""
else:
rev = data.getVar("SRCREV", d, 0)
- if "get_srcrev" in rev:
+ if rev and "get_srcrev" in rev:
ud.revision = self.latest_revision(url, ud, d)
- else:
+ ud.date = ""
+ elif rev:
ud.revision = rev
- ud.date = ""
+ ud.date = ""
+ else:
+ ud.revision = ""
ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)