@@ -, +, @@ --- bin/egencache | 12 +++++++++--- man/egencache.1 | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) --- a/bin/egencache +++ a/bin/egencache @@ -39,7 +39,7 @@ from portage import os, _encodings, _unicode_encode, _unicode_decode from _emerge.MetadataRegen import MetadataRegen from portage.cache.cache_errors import CacheError, StatCollision from portage.manifest import guessManifestFileType -from portage.util import cmp_sort_key, writemsg_level +from portage.util import cmp_sort_key, normalize_path, writemsg_level from portage import cpv_getkey from portage.dep import Atom, isjustname from portage.versions import pkgcmp, pkgsplit, vercmp @@ -80,7 +80,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 or absolute path to repo to operate on (default repo is located at $PORTDIR)") common.add_option("--config-root", help="location of portage config files", dest="portage_configroot") @@ -727,8 +727,12 @@ def egencache_main(args): # completely controlled by commandline arguments. env = {} + repo_path = None if options.repo is None: env['PORTDIR_OVERLAY'] = '' + elif options.repo.startswith(os.path.sep) and os.path.exists(options.repo): + repo_path = normalize_path(options.repo) + env['PORTDIR_OVERLAY'] = repo_path if options.cache_dir is not None: env['PORTAGE_DEPCACHEDIR'] = options.cache_dir @@ -770,7 +774,9 @@ def egencache_main(args): portdb = portage.portdbapi(mysettings=settings) if options.repo is not None: - repo_path = portdb.getRepositoryPath(options.repo) + if repo_path is None: + repo_path = portdb.getRepositoryPath(options.repo) + if repo_path is None: parser.error("Unable to locate repository named '%s'" % \ (options.repo,)) --- a/man/egencache.1 +++ a/man/egencache.1 @@ -56,6 +56,7 @@ Name of the repo to operate on (default repo is located at \fBPORTDIR\fR). The name should correspond the value of a \fBrepo_name\fR entry (see \fBportage\fR(5)) from one of the repositories that is configured via the \fBPORTDIR\fR or \fBPORTDIR_OVERLAY\fR variables (see \fBmake.conf\fR(5)). +Alternatively, REPO can be given as an absolute path to the repository. .TP .BR "\-\-rsync" When used together with the \fB\-\-update\fR action, this enables a workaround --