From: Zac Medico Date: Sun, 15 May 2011 05:21:08 +0000 (-0700) Subject: Use vardbapi.lock() where applicable. X-Git-Tag: v2.1.9.50~97 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a891dbf9456a5ab93db28fafc45cfded2beaf8d0;p=portage.git Use vardbapi.lock() where applicable. --- diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 5e6c31284..c1484f2c1 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -356,7 +356,8 @@ def post_emerge(myaction, myopts, myfiles, portage.util.ensure_dirs(vdb_path) vdb_lock = None if os.access(vdb_path, os.W_OK) and not "--pretend" in myopts: - vdb_lock = portage.locks.lockdir(vdb_path) + vardbapi.lock() + vdb_lock = True if vdb_lock: try: @@ -366,7 +367,7 @@ def post_emerge(myaction, myopts, myfiles, mtimedb.commit() finally: if vdb_lock: - portage.locks.unlockdir(vdb_lock) + vardbapi.unlock() chk_updated_cfg_files(settings['EROOT'], config_protect) diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py index 8fff516c1..533174499 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -11,6 +11,7 @@ from portage import os from portage.dbapi._expand_new_virt import expand_new_virt from portage.output import bold, colorize, darkgreen, green from portage._sets import SETPREFIX +from portage._sets.base import EditablePackageSet from portage.util import cmp_sort_key from _emerge.emergelog import emergelog @@ -57,7 +58,8 @@ def unmerge(root_config, myopts, unmerge_action, vdb_lock = None try: if os.access(vdb_path, os.W_OK): - vdb_lock = portage.locks.lockdir(vdb_path) + vartree.dbapi.lock() + vdb_lock = True realsyslist = [] for x in sets["system"].getAtoms(): @@ -293,10 +295,8 @@ def unmerge(root_config, myopts, unmerge_action, finally: if vdb_lock: vartree.dbapi.flush_cache() - portage.locks.unlockdir(vdb_lock) - - from portage._sets.base import EditablePackageSet - + vartree.dbapi.unlock() + # generate a list of package sets that are directly or indirectly listed in "selected", # as there is no persistent list of "installed" sets installed_sets = ["selected"]