summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-17 02:27:03 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-17 02:27:03 +0000
commitc759b63d1814a9046424c6015c55d6a207c1534a (patch)
tree8ed7e0ab1a4dc42980833c718b0b78e5277aaa31
parent6f2d27ccc84d6999fd7d563711948a729dd18fec (diff)
downloadportage-c759b63d1814a9046424c6015c55d6a207c1534a.tar.gz
portage-c759b63d1814a9046424c6015c55d6a207c1534a.tar.bz2
portage-c759b63d1814a9046424c6015c55d6a207c1534a.zip
Make --depclean treat DEPEND as soft deps instead of forcing the user to have all build time deps installed.
svn path=/main/trunk/; revision=4732
-rwxr-xr-xbin/emerge40
1 files changed, 22 insertions, 18 deletions
diff --git a/bin/emerge b/bin/emerge
index 58dd2348e..604b97601 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -3626,15 +3626,18 @@ def action_depclean(settings, trees, ldpath_mtimes,
if "--quiet" not in myopts:
print "\nCalculating dependencies ",
- remaining_atoms = [(atom, 'world') for atom in worldlist if vardb.match(atom)]
- remaining_atoms += [(atom, 'system') for atom in syslist if vardb.match(atom)]
+ soft = 0
+ hard = 1
+ remaining_atoms = [(atom, 'world', hard) for atom in worldlist if vardb.match(atom)]
+ remaining_atoms += [(atom, 'system', hard) for atom in syslist if vardb.match(atom)]
unresolveable = {}
+ aux_keys = ["DEPEND", "RDEPEND", "PDEPEND"]
while remaining_atoms:
- atom, parent = remaining_atoms.pop()
+ atom, parent, priority = remaining_atoms.pop()
pkgs = vardb.match(atom)
if not pkgs:
- if not atom.startswith("!"):
+ if not atom.startswith("!") and priority == hard:
if atom in unresolveable:
unresolveable[atom].append(parent)
else:
@@ -3648,22 +3651,23 @@ def action_depclean(settings, trees, ldpath_mtimes,
spinner.update()
fakedb.cpv_inject(pkg)
mydb = portdb.xmatch("match-visible", "="+pkg) and portdb or vardb
+ myaux = dict(zip(aux_keys, mydb.aux_get(pkg, aux_keys)))
+ mydeps = []
if myopts.get("--with-bdeps", "y") == "y":
- depstr = " ".join(mydb.aux_get(pkg,
- ["DEPEND", "RDEPEND", "PDEPEND"]))
- else:
- depstr = " ".join(mydb.aux_get(pkg,
- ["RDEPEND", "PDEPEND"]))
+ mydeps.append((myaux["DEPEND"], soft))
+ del myaux["DEPEND"]
+ mydeps.append((" ".join(myaux.values()), hard))
usedef = vardb.aux_get(pkg, ["USE"])[0].split()
- success, atoms = portage.dep_check(depstr, emptydb, settings,
- myuse=usedef, trees=trees, myroot=settings["ROOT"])
- if not success:
- print "\n\n"
- print "Error occurred while processing",pkg
- print str(atoms)
- return
- for atom in atoms:
- remaining_atoms.append((atom, pkg))
+ for depstr, priority in mydeps:
+ success, atoms = portage.dep_check(depstr, emptydb, settings,
+ myuse=usedef, trees=trees, myroot=settings["ROOT"])
+ if not success:
+ print "\n\n"
+ print "Error occurred while processing",pkg
+ print str(atoms)
+ return
+ for atom in atoms:
+ remaining_atoms.append((atom, pkg, priority))
if "--quiet" not in myopts:
print "\b\b... done!\n"