summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-05-31 08:09:55 +0000
committerZac Medico <zmedico@gentoo.org>2007-05-31 08:09:55 +0000
commit0614e9930a2435489475a0b34c545cddd1b190ae (patch)
treee379bb58b11f5d58c28e3e8fce685b89ea97793e
parente7bdb8d58f23bf6a1764045c23526a665e18b833 (diff)
downloadportage-0614e9930a2435489475a0b34c545cddd1b190ae.tar.gz
portage-0614e9930a2435489475a0b34c545cddd1b190ae.tar.bz2
portage-0614e9930a2435489475a0b34c545cddd1b190ae.zip
Don't try to perform global updates on binary packages unless $PKGDIR is writable.
svn path=/main/trunk/; revision=6691
-rw-r--r--pym/portage/__init__.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index dda87bd71..71bd9188c 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -5067,21 +5067,25 @@ def _global_updates(trees, prev_mtimes):
settings=mysettings)
vardb = trees["/"]["vartree"].dbapi
bindb = trees["/"]["bintree"].dbapi
+ if not os.access(bindb.bintree.pkgdir, os.W_OK):
+ bindb = None
for update_cmd in myupd:
if update_cmd[0] == "move":
moves = vardb.move_ent(update_cmd)
if moves:
writemsg_stdout(moves * "@")
- moves = bindb.move_ent(update_cmd)
- if moves:
- writemsg_stdout(moves * "%")
+ if bindb:
+ moves = bindb.move_ent(update_cmd)
+ if moves:
+ writemsg_stdout(moves * "%")
elif update_cmd[0] == "slotmove":
moves = vardb.move_slot_ent(update_cmd)
if moves:
writemsg_stdout(moves * "s")
- moves = bindb.move_slot_ent(update_cmd)
- if moves:
- writemsg_stdout(moves * "S")
+ if bindb:
+ moves = bindb.move_slot_ent(update_cmd)
+ if moves:
+ writemsg_stdout(moves * "S")
# The above global updates proceed quickly, so they
# are considered a single mtimedb transaction.
@@ -5099,7 +5103,8 @@ def _global_updates(trees, prev_mtimes):
def onProgress(maxval, curval):
writemsg_stdout("*")
vardb.update_ents(myupd, onProgress=onProgress)
- bindb.update_ents(myupd, onProgress=onProgress)
+ if bindb:
+ bindb.update_ents(myupd, onProgress=onProgress)
else:
do_upgrade_packagesmessage = 1
@@ -5109,8 +5114,8 @@ def _global_updates(trees, prev_mtimes):
print
print
- if do_upgrade_packagesmessage and \
- listdir(os.path.join(mysettings["PKGDIR"], "All"), EmptyOnError=1):
+ if do_upgrade_packagesmessage and bindb and \
+ bindb.cpv_all():
writemsg_stdout(" ** Skipping packages. Run 'fixpackages' or set it in FEATURES to fix the")
writemsg_stdout("\n tbz2's in the packages directory. "+bold("Note: This can take a very long time."))
writemsg_stdout("\n")