|
|
|
@ -1938,10 +1938,9 @@ class Builder(Update):
|
|
|
|
|
task_list = list(task.list) + task_list
|
|
|
|
|
|
|
|
|
|
vdb_path = "var/db/.pkg"
|
|
|
|
|
test_vdb_path = 'var/db/pkg-test'
|
|
|
|
|
test_vdb_path = '/tmp/pkg'
|
|
|
|
|
real_vdb_path = path.join(builder_path, VDB_PATH)
|
|
|
|
|
hide_vdb_path = path.join(builder_path, vdb_path)
|
|
|
|
|
test_vdb_path = path.join(builder_path, test_vdb_path)
|
|
|
|
|
try:
|
|
|
|
|
shutil.move(real_vdb_path, hide_vdb_path)
|
|
|
|
|
except (IOError, OSError):
|
|
|
|
@ -1956,9 +1955,6 @@ class Builder(Update):
|
|
|
|
|
self.skip_automagic(pkg, hide_vdb_path, real_vdb_path)
|
|
|
|
|
except (IOError, OSError):
|
|
|
|
|
if path.exists(real_vdb_path):
|
|
|
|
|
if path.exists(test_vdb_path):
|
|
|
|
|
shutil.rmtree(test_vdb_path)
|
|
|
|
|
shutil.copytree(real_vdb_path, test_vdb_path)
|
|
|
|
|
shutil.rmtree(real_vdb_path)
|
|
|
|
|
|
|
|
|
|
shutil.move(hide_vdb_path, real_vdb_path)
|
|
|
|
@ -2033,11 +2029,13 @@ class Builder(Update):
|
|
|
|
|
finally:
|
|
|
|
|
try:
|
|
|
|
|
if path.exists(real_vdb_path):
|
|
|
|
|
if path.exists(test_vdb_path):
|
|
|
|
|
shutil.rmtree(test_vdb_path)
|
|
|
|
|
shutil.copytree(real_vdb_path, test_vdb_path)
|
|
|
|
|
if path.exists(path.join(test_vdb_path, builder_path.split("/")[-1])):
|
|
|
|
|
shutil.rmtree(path.join(test_vdb_path, builder_path.split("/")[-1]))
|
|
|
|
|
makeDirectory(test_vdb_path)
|
|
|
|
|
shutil.copytree(real_vdb_path, path.join(test_vdb_path, builder_path.split("/")[-1]))
|
|
|
|
|
shutil.rmtree(real_vdb_path)
|
|
|
|
|
shutil.move(hide_vdb_path, real_vdb_path)
|
|
|
|
|
|
|
|
|
|
except (IOError, OSError):
|
|
|
|
|
raise BuilderError(_("Failed to unhide package database"))
|
|
|
|
|
self._report_automagic(automagic, automagic_clear, automagic_waste)
|
|
|
|
|