egencache: add --portdir-overlay option
authorZac Medico <zmedico@gentoo.org>
Sat, 13 Aug 2011 13:51:43 +0000 (06:51 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 13 Aug 2011 13:51:43 +0000 (06:51 -0700)
This will fix bug #353648.

bin/egencache
man/egencache.1

index 1b4265df146c20501d4ff67717e496fba0d44b31..6d8df35b5a0b3e8dfb1f977afdd7d8c747f908a2 100755 (executable)
@@ -87,6 +87,9 @@ def parse_args(args):
        common.add_option("--portdir",
                help="override the portage tree location",
                dest="portdir")
+       common.add_option("--portdir-overlay",
+               help="override the PORTDIR_OVERLAY variable (requires that --repo is also specified)",
+               dest="portdir_overlay")
        common.add_option("--tolerant",
                action="store_true",
                help="exit successfully if only minor errors occurred")
@@ -164,6 +167,10 @@ def parse_args(args):
                parser.error("Not a directory: --cache-dir='%s'" % \
                        (options.cache_dir,))
 
+       if options.portdir_overlay is not None and \
+               options.repo is None:
+               parser.error("--portdir-overlay option requires --repo option")
+
        for atom in args:
                try:
                        atom = portage.dep.Atom(atom)
@@ -764,6 +771,8 @@ def egencache_main(args):
 
        if options.repo is None:
                env['PORTDIR_OVERLAY'] = ''
+       elif options.portdir_overlay:
+               env['PORTDIR_OVERLAY'] = options.portdir_overlay
 
        if options.cache_dir is not None:
                env['PORTAGE_DEPCACHEDIR'] = options.cache_dir
index 56c2602d042f8867520f9f9fac4d17841c701ab5..9094595029432719c0adb944a190eba58eac26bc 100644 (file)
@@ -47,6 +47,10 @@ Specifies that maximum load allowed when spawning multiple jobs.
 .BR "\-\-portdir=PORTDIR"
 Override the portage tree location.
 .TP
+.BR "\-\-portdir\-overlay=PORTDIR_OVERLAY"
+Override the PORTDIR_OVERLAY variable (requires that
+\-\-repo is also specified).
+.TP
 .BR "\-\-preserve\-comments"
 Preserve the comments found in the output use.local.desc file. This requires
 the output file to exist before egencache is called.