summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-09-25 01:28:48 -0700
committerZac Medico <zmedico@gentoo.org>2010-09-25 01:28:48 -0700
commit30bc71ecff359ef5e674571eb979cc343222b703 (patch)
tree6f80aac4862fbb5151d5f6965cb5846b1ee1d24d
parent181e1613d9cd43563519a9439de99abe2a51d31c (diff)
downloadportage-30bc71ecff359ef5e674571eb979cc343222b703.tar.gz
portage-30bc71ecff359ef5e674571eb979cc343222b703.tar.bz2
portage-30bc71ecff359ef5e674571eb979cc343222b703.zip
Bug #338588 - Allow quickpkg to create packages even though the
current user doesn't have permission to lock /var/db/pkg.
-rwxr-xr-xbin/quickpkg13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/quickpkg b/bin/quickpkg
index 3e971f5d7..33c60d49f 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -22,7 +22,8 @@ from portage import os
from portage import xpak
from portage.dbapi.dep_expand import dep_expand
from portage.dep import use_reduce
-from portage.exception import InvalidAtom, InvalidData, InvalidDependString, PackageSetNotFound
+from portage.exception import InvalidAtom, InvalidData, InvalidDependString, \
+ PackageSetNotFound, PermissionDenied
from portage.util import ConfigProtect, ensure_dirs, shlex_split
from portage.dbapi.vartree import dblink, tar_contents
from portage.checksum import perform_md5
@@ -68,7 +69,12 @@ def quickpkg_atom(options, infos, arg, eout):
dblnk = dblink(cat, pkg, root,
vartree.settings, treetype="vartree",
vartree=vartree)
- dblnk.lockdb()
+ have_lock = False
+ try:
+ dblnk.lockdb()
+ have_lock = True
+ except PermissionDenied:
+ pass
try:
if not dblnk.exists():
# unmerged by a concurrent process
@@ -131,7 +137,8 @@ def quickpkg_atom(options, infos, arg, eout):
tar.close()
xpak.tbz2(binpkg_tmpfile).recompose_mem(xpdata)
finally:
- dblnk.unlockdb()
+ if have_lock:
+ dblnk.unlockdb()
bintree.inject(cpv, filename=binpkg_tmpfile)
binpkg_path = bintree.getname(cpv)
try: