Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Zac Medico (zmedico)" <zmedico@g.o>
Subject: portage r13873 - in main/trunk: man pym/_emerge
Date: Sat, 01 Aug 2009 19:58:52 +0000
Author: zmedico
Date: 2009-08-01 19:58:52 +0000 (Sat, 01 Aug 2009)
New Revision: 13873

Modified:
   main/trunk/man/emerge.1
   main/trunk/pym/_emerge/help.py
   main/trunk/pym/_emerge/main.py
Log:
Add support for --usepkg=n so that it's possible to disable it on
the command line after it's been enabled in EMERGE_DEFAULT_OPTS.
Also do the same for --usepkgonly, --getbinpkg, and --getbinpkgonly.


Modified: main/trunk/man/emerge.1
===================================================================
--- main/trunk/man/emerge.1	2009-08-01 18:58:23 UTC (rev 13872)
+++ main/trunk/man/emerge.1	2009-08-01 19:58:52 UTC (rev 13873)
@@ -324,14 +324,14 @@
 Instead of doing any package building, just perform fetches for all
 packages (fetch everything in SRC_URI regardless of USE setting).
 .TP
-.BR "\-\-getbinpkg " (\fB\-g\fR)
+.BR "\-\-getbinpkg[=n] " (\fB\-g\fR)
 Using the server and location defined in \fIPORTAGE_BINHOST\fR (see 
 \fBmake.conf\fR(5)), portage will download the information from each binary 
 package found and it will use that information to help build the dependency 
 list.  This option implies \fB\-k\fR.  (Use \fB\-gK\fR for binary\-only 
 merging.)
 .TP
-.BR "\-\-getbinpkgonly " (\fB\-G\fR)
+.BR "\-\-getbinpkgonly[=n] " (\fB\-G\fR)
 This option is identical to \fB\-g\fR, as above, except binaries from the
 remote server are preferred over local packages if they are not identical.
 .TP
@@ -462,13 +462,13 @@
 This is only really useful in combination with \fB\-\-emptytree\fR or 
 \fB\-\-update\fR and \fB\-\-deep\fR.
 .TP
-.BR "\-\-usepkg " (\fB\-k\fR) 
+.BR "\-\-usepkg[=n] " (\fB\-k\fR) 
 Tells emerge to use binary packages (from $PKGDIR) if they are available, thus 
 possibly avoiding some time\-consuming compiles.  This option is useful for CD 
 installs; you can export PKGDIR=/mnt/cdrom/packages and then use this option to 
 have emerge "pull" binary packages from the CD in order to satisfy dependencies.
 .TP
-.BR "\-\-usepkgonly " (\fB\-K\fR)
+.BR "\-\-usepkgonly[=n] " (\fB\-K\fR)
 Tells emerge to only use binary packages (from $PKGDIR).  All the binary 
 packages must be available at the time of dependency calculation or emerge 
 will simply abort.  Portage does not use $PORTDIR when calculating dependency 

Modified: main/trunk/pym/_emerge/help.py
===================================================================
--- main/trunk/pym/_emerge/help.py	2009-08-01 18:58:23 UTC (rev 13872)
+++ main/trunk/pym/_emerge/help.py	2009-08-01 19:58:52 UTC (rev 13873)
@@ -338,13 +338,13 @@
 		print "              Same as --fetchonly except that all package files, including those"
 		print "              not required to build the package, will be processed."
 		print
-		print "       "+green("--getbinpkg")+" ("+green("-g")+" short option)"
+		print "       "+green("--getbinpkg")+ "[=%s]" % turquoise("n") + " ("+green("-g")+" short option)"
 		print "              Using the server and location defined in PORTAGE_BINHOST, portage"
 		print "              will download the information from each binary file there and it"
 		print "              will use that information to help build the dependency list. This"
 		print "              option implies '-k'. (Use -gK for binary-only merging.)"
 		print
-		print "       "+green("--getbinpkgonly")+" ("+green("-G")+" short option)"
+		print "       "+green("--getbinpkgonly")+ "[=%s]" % turquoise("n") + " ("+green("-G")+" short option)"
 		print "              This option is identical to -g, as above, except it will not use"
 		print "              ANY information from the local machine. All binaries will be"
 		print "              downloaded from the remote server without consulting packages"
@@ -492,7 +492,7 @@
 		print "              a package's dependencies follow the package. Only really useful"
 		print "              in combination with --emptytree, --update or --deep."
 		print
-		print "       "+green("--usepkg")+" ("+green("-k")+" short option)"
+		print "       "+green("--usepkg")+ "[=%s]" % turquoise("n") + " ("+green("-k")+" short option)"
 		print "              Tell emerge to use binary packages (from $PKGDIR) if they are"
 		print "              available, thus possibly avoiding some time-consuming compiles."
 		print "              This option is useful for CD installs; you can export"
@@ -500,7 +500,7 @@
 		print "              emerge \"pull\" binary packages from the CD in order to satisfy" 
 		print "              dependencies."
 		print
-		print "       "+green("--usepkgonly")+" ("+green("-K")+" short option)"
+		print "       "+green("--usepkgonly")+ "[=%s]" % turquoise("n") + " ("+green("-K")+" short option)"
 		print "              Like --usepkg above, except this only allows the use of binary"
 		print "              packages, and it will abort the emerge if the package is not"
 		print "              available at the time of dependency calculation."

Modified: main/trunk/pym/_emerge/main.py
===================================================================
--- main/trunk/pym/_emerge/main.py	2009-08-01 18:58:23 UTC (rev 13872)
+++ main/trunk/pym/_emerge/main.py	2009-08-01 19:58:52 UTC (rev 13873)
@@ -52,7 +52,6 @@
 "--digest",
 "--emptytree",
 "--fetchonly",    "--fetch-all-uri",
-"--getbinpkg",    "--getbinpkgonly",
 "--ignore-default-opts",
 "--keep-going",
 "--noconfmem",
@@ -65,7 +64,6 @@
 "--skipfirst",
 "--tree",
 "--update",
-"--usepkg",       "--usepkgonly",
 "--verbose",
 ]
 
@@ -77,9 +75,7 @@
 "d":"--debug",
 "e":"--emptytree",
 "f":"--fetchonly", "F":"--fetch-all-uri",
-"g":"--getbinpkg", "G":"--getbinpkgonly",
 "h":"--help",
-"k":"--usepkg",    "K":"--usepkgonly",
 "l":"--changelog",
 "n":"--noreplace", "N":"--newuse",
 "o":"--onlydeps",  "O":"--nodeps",
@@ -386,8 +382,12 @@
 		'--deep'       : valid_integers,
 		'--deselect'   : ('n',),
 		'--binpkg-respect-use'   : ('n', 'y',),
+		'--getbinpkg'            : ('n',),
+		'--getbinpkgonly'        : ('n',),
 		'--jobs'       : valid_integers,
 		'--root-deps'  : ('rdeps',),
+		'--usepkg'               : ('n',),
+		'--usepkgonly'           : ('n',),
 	}
 
 	short_arg_opts = {
@@ -395,6 +395,15 @@
 		'j' : valid_integers,
 	}
 
+	# Don't make things like "-kn" expand to "-k n"
+	# since existence of -n makes it too ambiguous.
+	short_arg_opts_n = {
+		'g' : ('n',),
+		'G' : ('n',),
+		'k' : ('n',),
+		'K' : ('n',),
+	}
+
 	arg_stack = args[:]
 	arg_stack.reverse()
 	while arg_stack:
@@ -421,6 +430,12 @@
 				break
 
 		if match is None:
+			for k, arg_choices in short_arg_opts_n.iteritems():
+				if k in arg:
+					match = k
+					break
+
+		if match is None:
 			new_args.append(arg)
 			continue
 
@@ -441,7 +456,7 @@
 		saved_opts = None
 
 		if arg[1:2] == match:
-			if arg[2:] in arg_choices:
+			if match not in short_arg_opts_n and arg[2:] in arg_choices:
 				opt_arg = arg[2:]
 			else:
 				saved_opts = arg[2:]
@@ -551,6 +566,20 @@
 			"choices" : ("True", "y", "n")
 		},
 
+		"--getbinpkg": {
+			"shortopt" : "-g",
+			"help"     : "fetch binary packages",
+			"type"     : "choice",
+			"choices"  : ("True", "n")
+		},
+
+		"--getbinpkgonly": {
+			"shortopt" : "-G",
+			"help"     : "fetch binary packages only",
+			"type"     : "choice",
+			"choices"  : ("True", "n")
+		},
+
 		"--root": {
 		 "help"   : "specify the target root filesystem for merging packages",
 		 "action" : "store"
@@ -561,6 +590,21 @@
 			"type"    : "choice",
 			"choices" :("True", "rdeps")
 		},
+
+		"--usepkg": {
+			"shortopt" : "-k",
+			"help"     : "use binary packages",
+			"type"     : "choice",
+			"choices"  : ("True", "n")
+		},
+
+		"--usepkgonly": {
+			"shortopt" : "-K",
+			"help"     : "use only binary packages",
+			"type"     : "choice",
+			"choices"  : ("True", "n")
+		},
+
 	}
 
 	from optparse import OptionParser
@@ -606,6 +650,16 @@
 	else:
 		myoptions.complete_graph = None
 
+	if myoptions.getbinpkg in ("True",):
+		myoptions.getbinpkg = True
+	else:
+		myoptions.getbinpkg = None
+
+	if myoptions.getbinpkgonly in ("True",):
+		myoptions.getbinpkgonly = True
+	else:
+		myoptions.getbinpkgonly = None
+
 	if myoptions.root_deps == "True":
 		myoptions.root_deps = True
 
@@ -660,6 +714,16 @@
 
 		myoptions.load_average = load_average
 
+	if myoptions.usepkg in ("True",):
+		myoptions.usepkg = True
+	else:
+		myoptions.usepkg = None
+
+	if myoptions.usepkgonly in ("True",):
+		myoptions.usepkgonly = True
+	else:
+		myoptions.usepkgonly = None
+
 	for myopt in options:
 		v = getattr(myoptions, myopt.lstrip("--").replace("-", "_"))
 		if v:



Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in app-arch/xarchiver: metadata.xml ChangeLog
Next by thread:
gentoo-x86 commit in eclass: xfconf.eclass
Previous by date:
gentoo-x86 commit in app-arch/squeeze: metadata.xml ChangeLog
Next by date:
gentoo-x86 commit in eclass: xfconf.eclass


Updated Jun 26, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.