actions = optparse.OptionGroup(parser, 'Actions')
actions.add_option("--update",
action="store_true",
- help="update metadata/cache/ (generate as necessary)")
+ help="update metadata/md5-cache/ (generate as necessary)")
actions.add_option("--update-use-local-desc",
action="store_true",
help="update the use.local.desc file from metadata.xml")
help="override the PORTAGE_GPG_KEY variable",
dest="gpg_key")
common.add_option("--portdir",
- help="override the portage tree location",
+ help="override the portage tree location (deprecated in favor of --repositories-configuration)",
dest="portdir")
common.add_option("--portdir-overlay",
- help="override the PORTDIR_OVERLAY variable (requires that --repo is also specified)",
+ help="override the PORTDIR_OVERLAY variable (requires that --repo is also specified) (deprecated in favor of --repositories-configuration)",
dest="portdir_overlay")
+ common.add_option("--repositories-configuration",
+ help="override configuration of repositories (in format of repos.conf) (requires that --repo is also specified)",
+ dest="repositories_configuration")
common.add_option("--sign-manifests",
type="choice",
choices=('y', 'n'),
parser.error("Write access denied: --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")
+ if options.repo is None:
+ if options.repositories_configuration is not None:
+ parser.error("--repositories-configuration option requires --repo option")
+ if options.portdir_overlay is not None:
+ parser.error("--portdir-overlay option requires --repo option")
for atom in args:
try:
self.returncode |= 1
writemsg_level(
"Error listing cache entries for " + \
- "'%s/metadata/cache': %s, continuing...\n" % \
- (self._portdb.porttree_root, ce),
+ "'%s': %s, continuing...\n" % \
+ (trg_cache.location, ce),
level=logging.ERROR, noiselevel=-1)
else:
self.returncode |= 1
writemsg_level(
"Error listing cache entries for " + \
- "'%s/metadata/cache': %s, continuing...\n" % \
- (self._portdb.porttree_root, ce),
+ "'%s': %s, continuing...\n" % \
+ (trg_cache.location, ce),
level=logging.ERROR, noiselevel=-1)
if cp_missing:
self.generate_changelog(cp)
def egencache_main(args):
- parser, options, atoms = parse_args(args)
-
- config_root = options.config_root
# The calling environment is ignored, so the program is
# completely controlled by commandline arguments.
env = {}
+ if not sys.stdout.isatty():
+ portage.output.nocolor()
+ env['NOCOLOR'] = 'true'
+
+ parser, options, atoms = parse_args(args)
+
+ config_root = options.config_root
+
if options.repo is None:
env['PORTDIR_OVERLAY'] = ''
+ elif options.repositories_configuration is not None:
+ env['PORTAGE_REPOSITORIES'] = options.repositories_configuration
elif options.portdir_overlay:
env['PORTDIR_OVERLAY'] = options.portdir_overlay
default_opts = None
if not options.ignore_default_opts:
- default_opts = settings.get('EGENCACHE_DEFAULT_OPTS', '').split()
+ default_opts = portage.util.shlex_split(
+ settings.get('EGENCACHE_DEFAULT_OPTS', ''))
if default_opts:
parser, options, args = parse_args(default_opts + args)