repoman: support REPOMAN_DEFAULT_OPTS variable
authorZac Medico <zmedico@gentoo.org>
Fri, 14 Oct 2011 16:29:37 +0000 (09:29 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 14 Oct 2011 16:29:37 +0000 (09:29 -0700)
bin/repoman
man/repoman.1
pym/portage/package/ebuild/_config/special_env_vars.py

index 38f969464d8eb470fd87afeb2d6429392931eaa2..65c1f40fd6fbed0e6117c8e9e1fecfb5d162181c 100755 (executable)
@@ -218,6 +218,10 @@ def ParseArgs(argv, qahelp):
        parser.add_option('-i', '--ignore-arches', dest='ignore_arches', action='store_true',
                default=False, help='ignore arch-specific failures (where arch != host)')
 
+       parser.add_option("--ignore-default-opts",
+               action="store_true",
+               help="do not use the REPOMAN_DEFAULT_OPTS environment variable")
+
        parser.add_option('-I', '--ignore-masked', dest='ignore_masked', action='store_true',
                default=False, help='ignore masked packages (not allowed with commit mode)')
 
@@ -247,6 +251,11 @@ def ParseArgs(argv, qahelp):
 
        opts, args = parser.parse_args(argv[1:])
 
+       if not opts.ignore_default_opts:
+               default_opts = repoman_settings.get("REPOMAN_DEFAULT_OPTS", "").split()
+               if default_opts:
+                       opts, args = parser.parse_args(default_opts + sys.argv[1:])
+
        if opts.mode == 'help':
                parser.print_help(short=False)
 
index f0c9eff2ffa000ef4c959885a5ac598ba4c3ce42..bc54657a497b6fbfb1887784c9aa4dfd2e5f3b6e 100644 (file)
@@ -47,6 +47,9 @@ Only check packages that have uncommitted modifications
 \fB\-i\fR, \fB\-\-ignore\-arches\fR
 Ignore arch-specific failures (where arch != host)
 .TP
+\fB\-\-ignore\-default\-opts\fR
+Do not use the \fIREPOMAN_DEFAULT_OPTS\fR environment variable.
+.TP
 \fB\-I\fR, \fB\-\-ignore\-masked\fR
 Ignore masked packages (not allowed with commit mode)
 .TP
index 99321e26e5466cf047560af3099630a6fda3e1f7..517fdf35a439c38e125e1afd65f6350a48e609f2 100644 (file)
@@ -157,7 +157,7 @@ environ_filter += [
        "PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS",
        "PORTAGE_RSYNC_RETRIES", "PORTAGE_SYNC_STALE",
        "PORTAGE_USE", "PORT_LOGDIR", "PORT_LOGDIR_CLEAN",
-       "QUICKPKG_DEFAULT_OPTS",
+       "QUICKPKG_DEFAULT_OPTS", "REPOMAN_DEFAULT_OPTS",
        "RESUMECOMMAND", "RESUMECOMMAND_FTP",
        "RESUMECOMMAND_HTTP", "RESUMECOMMAND_HTTPS",
        "RESUMECOMMAND_RSYNC", "RESUMECOMMAND_SFTP",