aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2015-05-16 13:57:11 -0700
committerZac Medico <zmedico@gentoo.org>2015-05-16 15:36:02 -0700
commit28d5b7e78e0fdad2479685ec257ab5b858195007 (patch)
tree04b1231c42c695c812acdd7447667e09ea1e0e70 /bin/egencache
parentbinarytree.get_pkgindex_uri: handle --gebinpkg=n (bug 549666) (diff)
downloadportage-28d5b7e78e0fdad2479685ec257ab5b858195007.tar.gz
portage-28d5b7e78e0fdad2479685ec257ab5b858195007.tar.bz2
portage-28d5b7e78e0fdad2479685ec257ab5b858195007.zip
egencache --update-pkg-desc-index: handle read-only repo (bug 549616)
If the repo is read-only, write the cache to /var/cache/edb/dep where IndexedPortdb searches for it. X-Gentoo-Bug: 549616 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=549616 Acked-by: Brian Dolbec <dolsen@gentoo.org>
Diffstat (limited to 'bin/egencache')
-rwxr-xr-xbin/egencache17
1 files changed, 16 insertions, 1 deletions
diff --git a/bin/egencache b/bin/egencache
index f97432fd1..6075ccfdb 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -1086,8 +1086,23 @@ def egencache_main(args):
ret.append(scheduler.returncode)
if options.update_pkg_desc_index:
+ if repo_config.writable:
+ writable_location = repo_config.location
+ else:
+ writable_location = os.path.join(portdb.depcachedir,
+ repo_config.location.lstrip(os.sep))
+ msg = [
+ "WARNING: Repository is not writable: %s" % (
+ repo_config.location,),
+ " Using cache directory instead: %s" % (
+ writable_location,)
+ ]
+ msg = "".join(line + '\n' for line in msg)
+ writemsg_level(msg,
+ level=logging.WARNING, noiselevel=-1)
+
gen_index = GenPkgDescIndex(portdb, os.path.join(
- repo_config.location, "metadata", "pkg_desc_index"))
+ writable_location, "metadata", "pkg_desc_index"))
gen_index.run()
ret.append(gen_index.returncode)