Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Silbe <sascha-org-sugar-git@silbe.org>2009-06-19 06:36:14 (GMT)
committer Sascha Silbe <sascha-org-sugar-git@silbe.org>2009-06-19 06:36:14 (GMT)
commitae27ad266add21d1d81c959df816b0276f5b1b7c (patch)
tree0c96d624e59fd2d4cb704675df85daf6c204a03e
parentd70046442cca0ce8a18d9b46468042423ef90e7c (diff)
sysdeps: use *<name>.xml instead of <name>*.xml so there's no confusion about what distro version a file belongs to (like Fedora 10 vs. 10.93 previously)sysdeps-split
-rw-r--r--sjhbuild/sysdeps.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/sjhbuild/sysdeps.py b/sjhbuild/sysdeps.py
index bd10b73..1b0366d 100644
--- a/sjhbuild/sysdeps.py
+++ b/sjhbuild/sysdeps.py
@@ -46,8 +46,11 @@ def check_package(package):
return None
-def _check_prefix(name, prefixes, suffix="") :
- return [name for p in prefixes if name.startswith(p) and name.endswith(suffix)]
+def _check_suffix(name, suffixes) :
+ """
+ Returns a list of all matching suffixes for <name>.
+ """
+ return [name for suffix in suffixes if name.endswith(suffix)]
_unstable_names = {
'debian': 'unstable',
@@ -59,16 +62,16 @@ def _parse_dependencies(dname, dversion):
if not (dname and dversion):
return []
- prefixes = ['alldistros', '%s-allversions' % (dname,),
- '%s-%s' % (dname, dversion)]
+ suffixes = ['alldistros.xml', '%s-allversions.xml' % (dname,),
+ '%s-%s.xml' % (dname, dversion)]
dirname = os.path.join(base_dir, 'config', 'sysdeps')
filenames = [os.path.join(dirname, fname)
for fname in os.listdir(dirname)
- if _check_prefix(fname, prefixes, ".xml")]
+ if _check_suffix(fname, suffixes)]
# check whether we have a file matching the exact distro version
- if not [name for name in filenames if prefixes[-1] in name] :
+ if not [name for name in filenames if name.endswith(suffixes[-1])] :
# will break for unknown distros, but that's fine
# (=> bug report => add support for distro)
uversion = _unstable_names[dname]