aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2013-07-23 22:41:20 +0200
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2013-07-23 22:41:20 +0200
commit04612ddc5200e7cd796fb0b49b69d77b5e502ab3 (patch)
treeb32392e629586b5dce69a8b250dfaf8c42bcd7b5 /bin/egencache
parentgetmaskingreason: handle UNKNOWN_REPO (diff)
downloadportage-04612ddc5200e7cd796fb0b49b69d77b5e502ab3.tar.gz
portage-04612ddc5200e7cd796fb0b49b69d77b5e502ab3.tar.bz2
portage-04612ddc5200e7cd796fb0b49b69d77b5e502ab3.zip
egencache: Require --repo option.
Diffstat (limited to 'bin/egencache')
-rwxr-xr-xbin/egencache31
1 files changed, 9 insertions, 22 deletions
diff --git a/bin/egencache b/bin/egencache
index 2c5dddce9..921c4612d 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -97,7 +97,7 @@ def parse_args(args):
common = optparse.OptionGroup(parser, 'Common options')
common.add_option("--repo",
action="store",
- help="name of repo to operate on (default repo is located at $PORTDIR)")
+ help="name of repo to operate on")
common.add_option("--config-root",
help="location of portage config files",
dest="portage_configroot")
@@ -111,10 +111,10 @@ def parse_args(args):
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) (deprecated in favor of --repositories-configuration)",
+ help="override the PORTDIR_OVERLAY variable (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)",
+ help="override configuration of repositories (in format of repos.conf)",
dest="repositories_configuration")
common.add_option("--sign-manifests",
type="choice",
@@ -213,10 +213,7 @@ def parse_args(args):
(options.cache_dir,))
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")
+ parser.error("--repo option is required")
for atom in args:
try:
@@ -862,9 +859,7 @@ def egencache_main(args):
config_root = options.config_root
- if options.repo is None:
- env['PORTDIR_OVERLAY'] = ''
- elif options.repositories_configuration is not None:
+ if options.repositories_configuration is not None:
env['PORTAGE_REPOSITORIES'] = options.repositories_configuration
elif options.portdir_overlay:
env['PORTDIR_OVERLAY'] = options.portdir_overlay
@@ -897,18 +892,10 @@ def egencache_main(args):
parser.error('No action specified')
return 1
- repo_path = None
- if options.repo is not None:
- repo_path = settings.repositories.treemap.get(options.repo)
- if repo_path is None:
- parser.error("Unable to locate repository named '%s'" % \
- (options.repo,))
- return 1
- else:
- repo_path = settings.repositories.mainRepoLocation()
- if not repo_path:
- parser.error("PORTDIR is undefined")
- return 1
+ repo_path = settings.repositories.treemap.get(options.repo)
+ if repo_path is None:
+ parser.error("Unable to locate repository named '%s'" % (options.repo,))
+ return 1
repo_config = settings.repositories.get_repo_for_location(repo_path)