From: Zac Medico Date: Sat, 3 Aug 2013 01:29:21 +0000 (-0700) Subject: quickpkg: portage.util._argparse X-Git-Tag: v2.2.0_alpha192~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=adf7be633dca8e5112d622b9f68f01c93f65f4f6;p=portage.git quickpkg: portage.util._argparse --- diff --git a/bin/quickpkg b/bin/quickpkg index 16118ab25..cf5800c2e 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -6,7 +6,6 @@ from __future__ import print_function import errno import math -import optparse import signal import sys import tarfile @@ -26,6 +25,7 @@ from portage.util import ConfigProtect, ensure_dirs, shlex_split from portage.dbapi.vartree import dblink, tar_contents from portage.checksum import perform_md5 from portage._sets import load_default_config, SETPREFIX +from portage.util._argparse import ArgumentParser def quickpkg_atom(options, infos, arg, eout): settings = portage.settings @@ -289,30 +289,28 @@ def quickpkg_main(options, args, eout): if __name__ == "__main__": usage = "quickpkg [options] " - parser = optparse.OptionParser(usage=usage) - parser.add_option("--umask", + parser = ArgumentParser(usage=usage) + parser.add_argument("--umask", default="0077", help="umask used during package creation (default is 0077)") - parser.add_option("--ignore-default-opts", + parser.add_argument("--ignore-default-opts", action="store_true", help="do not use the QUICKPKG_DEFAULT_OPTS environment variable") - parser.add_option("--include-config", - type="choice", + parser.add_argument("--include-config", choices=["y","n"], default="n", metavar="", help="include all files protected by CONFIG_PROTECT (as a security precaution, default is 'n')") - parser.add_option("--include-unmodified-config", - type="choice", + parser.add_argument("--include-unmodified-config", choices=["y","n"], default="n", metavar="", help="include files protected by CONFIG_PROTECT that have not been modified since installation (as a security precaution, default is 'n')") - options, args = parser.parse_args(sys.argv[1:]) + options, args = parser.parse_known_args(sys.argv[1:]) if not options.ignore_default_opts: default_opts = shlex_split( portage.settings.get("QUICKPKG_DEFAULT_OPTS", "")) - options, args = parser.parse_args(default_opts + sys.argv[1:]) + options, args = parser.parse_known_args(default_opts + sys.argv[1:]) if not args: parser.error("no packages atoms given") try: