Bug #194025 - Lock /var/db/pkg in post_merge() during the
authorZac Medico <zmedico@gentoo.org>
Thu, 27 Sep 2007 17:55:52 +0000 (17:55 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 27 Sep 2007 17:55:52 +0000 (17:55 -0000)
"Regenerating GNU info directory index" routine. (trunk r7853)

svn path=/main/branches/2.1.2/; revision=7854

bin/emerge

index 529767ebcd8f6b9d6704af9ed59d888ad624d7f0..f5690df2185a71942ed4e433b6fa820042ffa511 100755 (executable)
@@ -4497,11 +4497,18 @@ def post_emerge(settings, mtimedb, retval):
        else:
                mod_echo.finalize()
 
-       if "noinfo" not in settings.features:
-               chk_updated_info_files(target_root, infodirs, info_mtimes, retval)
+       vdb_path = os.path.join(target_root, portage.VDB_PATH)
+       portage_util.ensure_dirs(vdb_path)
+       vdb_lock = portage_locks.lockdir(vdb_path)
+       try:
+               if "noinfo" not in settings.features:
+                       chk_updated_info_files(target_root, infodirs, info_mtimes, retval)
+               mtimedb.commit()
+       finally:
+               portage_locks.unlockdir(vdb_lock)
 
        chk_updated_cfg_files(target_root, config_protect)
-       mtimedb.commit()
+
        sys.exit(retval)