diff options
author | Joshua Lock <josh@openedhand.com> | 2008-09-30 16:54:37 +0000 |
---|---|---|
committer | Joshua Lock <josh@openedhand.com> | 2008-09-30 16:54:37 +0000 |
commit | cbaab65ff4bb3e4fc77066032a8858f4d5d61241 (patch) | |
tree | 393dcbb8a980e4d8c0c9d9db4eb3405e9c7f5f90 /bitbake-dev/lib/bb/utils.py | |
parent | d54280dd315810ad8cdbce5c52a1af3de902f6ef (diff) | |
download | openembedded-core-cbaab65ff4bb3e4fc77066032a8858f4d5d61241.tar.gz openembedded-core-cbaab65ff4bb3e4fc77066032a8858f4d5d61241.tar.bz2 openembedded-core-cbaab65ff4bb3e4fc77066032a8858f4d5d61241.zip |
Merge changes from Poky bitbake 1.8
Update bitbake-dev to have extra fixes from Poky's internal (1.8) version of bitbake.
Should be able to use bitbake-dev with Poky now.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5340 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake-dev/lib/bb/utils.py')
-rw-r--r-- | bitbake-dev/lib/bb/utils.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/bitbake-dev/lib/bb/utils.py b/bitbake-dev/lib/bb/utils.py index 17e22e389e..0a0c9ada34 100644 --- a/bitbake-dev/lib/bb/utils.py +++ b/bitbake-dev/lib/bb/utils.py @@ -96,7 +96,34 @@ def explode_deps(s): #r[-1] += ' ' + ' '.join(j) return r +def explode_dep_versions(s): + """ + Take an RDEPENDS style string of format: + "DEPEND1 (optional version) DEPEND2 (optional version) ..." + and return a dictonary of dependencies and versions. + """ + r = {} + l = s.split() + lastdep = None + lastver = "" + inversion = False + for i in l: + if i[0] == '(': + inversion = True + lastver = i[1:] or "" + #j = [] + elif inversion and i.endswith(')'): + inversion = False + lastver = lastver + " " + (i[:-1] or "") + r[lastdep] = lastver + elif not inversion: + r[i] = None + lastdep = i + lastver = "" + elif inversion: + lastver = lastver + " " + i + return r def _print_trace(body, line): """ @@ -268,3 +295,13 @@ def sha256_file(filename): for line in open(filename): s.update(line) return s.hexdigest() + +def prunedir(topdir): + # Delete everything reachable from the directory named in 'topdir'. + # CAUTION: This is dangerous! + for root, dirs, files in os.walk(topdir, topdown=False): + for name in files: + os.remove(os.path.join(root, name)) + for name in dirs: + os.rmdir(os.path.join(root, name)) + os.rmdir(topdir) |