-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi everyone,

The attached patch for bug #132355 [1] adds a --mindeps option for emerge that 
effectively allows build time dependencies to be excluded from dependency 
calculations involving binary and installed packages.  With this patch, it's 
possible to remove all build time dependencies from a system with the command 
`emerge --depclean --mindeps`.  When --mindeps is used to install packages, it 
causes build time dependencies to be excluded for binary packages and packages 
that are already installed.  This patch will change the previous default 
behavior for `emerge --usepkg <package list>`, but if desired, the user will be 
able use --mindeps together with --usepkg.  Are there any suggestions to 
improve on this idea or is it fine the way that it is?

Zac

[1] http://bugs.gentoo.org/show_bug.cgi?id=132355
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)

iD8DBQFEtIlf/ejvha5XGaMRAo26AKCovCALx/VDIft6e+0lh+FI7IQsoQCg8o6M
UW+dnXPwMe/tIje1A4RYqRs=
=9uIv
-----END PGP SIGNATURE-----
Index: bin/emerge
===================================================================
--- bin/emerge	(revision 3836)
+++ bin/emerge	(working copy)
@@ -190,7 +190,7 @@
 "--fetchonly",    "--fetch-all-uri",
 "--getbinpkg",    "--getbinpkgonly",
 "--help",         "--ignore-default-opts",
-"--noconfmem",
+"--mindeps",      "--noconfmem",
 "--newuse",       "--nocolor",
 "--nodeps",       "--noreplace",
 "--nospinner",    "--oneshot",
@@ -352,6 +352,7 @@
 	# recurse:   go into the dependencies
 	# deep:      go into the dependencies of already merged packages
 	# empty:     pretend nothing is merged
+	# minimal:   exclude dependencies that aren't strictly required.
 	myparams=["self","recurse"]
 	add=[]
 	sub=[]
@@ -366,6 +367,8 @@
 		add.extend(["selective"])
 	if "--deep" in myopts:
 		add.extend(["deep"])
+	if "--mindeps" in myopts:
+		add.append("minimal")
 	if "--selective" in myopts:
 		add.extend(["selective"])
 	if myaction in ["world","system"]:
@@ -755,8 +758,14 @@
 			edepend[depkeys[i]] = depvalues[i]
 
 		if mytype == "binary":
-			edepend["DEPEND"] = ""
+			if "minimal" in self.myparams:
+				edepend["DEPEND"] = ""
 		elif mytype == "ebuild":
+			# minimal + empty implies depclean
+			if "minimal" in self.myparams and \
+				("empty" in self.myparams or \
+				mybigkey[-1] == "nomerge"):
+				edepend["DEPEND"] = ""
 			if "--buildpkgonly" in self.myopts:
 				edepend["RDEPEND"] = ""
 				edepend["PDEPEND"] = ""

Reply via email to