|
|
|
@ -1718,8 +1718,12 @@ class Builder(Update):
|
|
|
|
|
real_vdb_path = path.join(builder_path, VDB_PATH)
|
|
|
|
|
hide_vdb_path = path.join(builder_path, vdb_path)
|
|
|
|
|
|
|
|
|
|
real_vdb_path_with_hide = path.join(builder_path, VDB_PATH, ".pkg")
|
|
|
|
|
|
|
|
|
|
if path.exists(hide_vdb_path):
|
|
|
|
|
raise BuilderError("Wrong build state: /var/db/.pkg found")
|
|
|
|
|
if path.exists(real_vdb_path_with_hide):
|
|
|
|
|
raise BuilderError("Wrong build state: /var/db/pkg/.pkg found")
|
|
|
|
|
if not path.exists(real_vdb_path):
|
|
|
|
|
raise BuilderError(_("Wrong build state: /var/db/pkg not found"))
|
|
|
|
|
return True
|
|
|
|
@ -1817,6 +1821,8 @@ class Builder(Update):
|
|
|
|
|
self.endTask(True)
|
|
|
|
|
finally:
|
|
|
|
|
try:
|
|
|
|
|
if path.exists(real_vdb_path):
|
|
|
|
|
os.rmdir(real_vdb_path)
|
|
|
|
|
shutil.move(hide_vdb_path, real_vdb_path)
|
|
|
|
|
except (IOError, OSError):
|
|
|
|
|
raise BuilderError(_("Failed to unhide package database"))
|
|
|
|
|