summaryrefslogtreecommitdiffstats
path: root/cron-jobs
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-08-28 01:27:12 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-08-28 18:08:25 +0200
commit620b631fedbbd3596baa6752b9234249a2239a2a (patch)
treef7980b94491bd0dfb89f0925dee123d8088d7397 /cron-jobs
parentd455a0b2cd72cd08b7b6cde878a29841f77a041e (diff)
downloaddbscripts-620b631fedbbd3596baa6752b9234249a2239a2a.tar.gz
dbscripts-620b631fedbbd3596baa6752b9234249a2239a2a.tar.xz
add deplist to hierarchy problems
This should help a lot figuring out whether a given hierarchy problem is fixable (if it doesn't require moving too many deps). example output core/crda depends on extra/python-m2crypto (27 extra (make)deps to pull) core/iputils depends on extra/opensp (29 extra (make)deps to pull) core/iputils depends on extra/libxslt (25 extra (make)deps to pull) core/iputils depends on extra/docbook-xsl (27 extra (make)deps to pull) core/udev depends on extra/gperf (0 extra (make)deps to pull) core/udev depends on extra/libxslt (25 extra (make)deps to pull) core/e2fsprogs depends on extra/bc (0 extra (make)deps to pull) core/sqlite3 depends on extra/tcl (0 extra (make)deps to pull) core/ca-certificates depends on extra/ruby (25 extra (make)deps to pull) the actual deps are only displayed when there are less than 10. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'cron-jobs')
-rwxr-xr-xcron-jobs/check_archlinux/check_packages.py50
1 files changed, 47 insertions, 3 deletions
diff --git a/cron-jobs/check_archlinux/check_packages.py b/cron-jobs/check_archlinux/check_packages.py
index d42feab..f2a9601 100755
--- a/cron-jobs/check_archlinux/check_packages.py
+++ b/cron-jobs/check_archlinux/check_packages.py
@@ -182,11 +182,50 @@ def verify_deps(name,repo,deps):
break
if not pkgdep:
pkgdep = pkglist[0]
- hierarchy.append(repo + "/" + name + " depends on " + pkgdep.repo + "/" + pkgdep.name)
+ hierarchy.append((repo,name,pkgdep))
+
pkg_deps.append(pkgdep)
return (pkg_deps,missdeps,hierarchy)
+def compute_deplist_aux(pkg,deplist):
+ newdeplist = []
+ list = []
+ if pkgdeps.has_key(pkg):
+ list.extend(pkgdeps[pkg])
+ if makepkgdeps.has_key(pkg):
+ list.extend(makepkgdeps[pkg])
+ for dep in list:
+ if dep not in deplist:
+ newdeplist.append(dep)
+ deplist.append(dep)
+ for dep in newdeplist:
+ deplist2 = compute_deplist_aux(dep,deplist)
+ for dep2 in deplist2:
+ if dep2 not in deplist:
+ deplist.append(dep2)
+ return deplist
+
+def compute_deplist(pkg):
+ return compute_deplist_aux(pkg,[])
+
+def check_hierarchy(deph):
+ hierarchy = []
+ for (repo,name,pkgdep) in deph:
+ deplist = compute_deplist(pkgdep)
+ valid_repos = get_repo_hierarchy(repo)
+ extdeps = []
+ for dep in deplist:
+ if dep.repo not in valid_repos:
+ extdeps.append(dep.name)
+ string = repo + "/" + name + " depends on " + pkgdep.repo + "/" + pkgdep.name + " ("
+ string += "%s extra (make)deps to pull" % len(extdeps)
+ if 0 < len(extdeps) < 10:
+ string += " : " + ' '.join(extdeps)
+ string += ")"
+ hierarchy.append(string)
+ return hierarchy
+
def get_repo_hierarchy(repo):
repo_hierarchy = {'core': ['core'], \
'extra': ['core', 'extra'], \
@@ -373,19 +412,24 @@ for name,pkg in packages.iteritems():
pkg.deps = [dep for dep in pkg.deps if not p.match(dep)]
pkg.makedeps = [dep for dep in pkg.makedeps if not p.match(dep)]
+deph,makedeph = [],[]
+
print "==> checking dependencies"
for name,pkg in repopkgs.iteritems():
(deps,missdeps,hierarchy) = verify_deps(name,pkg.repo,pkg.deps)
pkgdeps[pkg] = deps
missing_deps.extend(missdeps)
- dep_hierarchy.extend(hierarchy)
+ deph.extend(hierarchy)
print "==> checking makedepends"
for name,pkg in repopkgs.iteritems():
(makedeps,missdeps,hierarchy) = verify_deps(name,pkg.repo,pkg.makedeps)
makepkgdeps[pkg] = makedeps
missing_makedeps.extend(missdeps)
- makedep_hierarchy.extend(hierarchy)
+ makedeph.extend(hierarchy)
+
+dep_hierarchy = check_hierarchy(deph)
+makedep_hierarchy = check_hierarchy(makedeph)
print "==> checking for circular dependencies"
# make sure pkgdeps is filled for every package