- Revert the '-' character fix in class names since it breaks things
- When a regexp fails to compile for PACKAGES_DYNAMIC, print a more useful error (#4444)
- Allow to checkout CVS by Date and Time. Just add HHmm to the SRCDATE.
+ - Move prunedir function to utils.py and add explode_dep_versions function
Changes in Bitbake 1.8.0:
- Release 1.7.x as a stable series
from bb.fetch import FetchError
from bb.fetch import runfetchcmd
-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))
-
class Git(Fetch):
"""Class to fetch a module or modules from git repositories"""
def supports(self, url, ud, d):
runfetchcmd("tar -czf %s %s" % (repofile, os.path.join(".", ".git", "*") ), d)
if os.path.exists(codir):
- prunedir(codir)
+ bb.utils.prunedir(codir)
bb.mkdirhier(codir)
os.chdir(repodir)
runfetchcmd("tar -czf %s %s" % (ud.localpath, os.path.join(".", "*") ), d)
os.chdir(repodir)
- prunedir(codir)
+ bb.utils.prunedir(codir)
def suppports_srcrev(self):
return True
#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):
"""
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)