Skip to content

Commit 2f02a9d

Browse files
committed
Use 'mv' instead of 'cp' for backing up builds
Move RPMs instead of copying. Moving saves time and disk space and preserves the original build timestamps.
1 parent 671d36d commit 2f02a9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mock/py/mockbuild/buildroot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,8 +1060,9 @@ def delete(self):
10601060
file_util.mkdirIfAbsent(dstdir)
10611061
rpms = glob.glob(os.path.join(srcdir, "*rpm"))
10621062
if len(rpms) > 0:
1063-
self.state.state_log.info("backup_results: saving with cp %s %s", " ".join(rpms), dstdir)
1064-
util.run(cmd="cp %s %s" % (" ".join(rpms), dstdir))
1063+
self.state.state_log.info("backup_results: saving with mv %s %s", " ".join(rpms), dstdir)
1064+
for rpm in rpms:
1065+
shutil.move(rpm, dstdir)
10651066

10661067
p = self.make_chroot_path()
10671068
self._lock_buildroot(exclusive=True)

0 commit comments

Comments
 (0)