move buildlog to avoid copying by mistake in next build
authorZhang Qiang <qiang.z.zhang@intel.com>
Thu, 13 Sep 2012 13:12:19 +0000 (21:12 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Thu, 13 Sep 2012 13:12:19 +0000 (21:12 +0800)
For example:
run depannur to build ail succeeded, and the build log left in that
build root, next time run ail again, depanneur request root passwd
and user cancelled by Ctrl + C, then the build log for previous build
will be copied to fail dir by mistake.

Change-Id: Iff50f4a1378ba135c6763fc6f279bc689a6928ef

depanneur

index 8700ed3..180a9ca 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -806,7 +806,7 @@ sub build_package {
         system ("cp $scratch/home/abuild/rpmbuild/SRPMS/*.rpm $localrepo/$dist/src/SRPMS") == 0 or die "mv";
         system ("cp $scratch/home/abuild/rpmbuild/RPMS/*/*.rpm $localrepo/$dist/$arch/RPMS") == 0 or die "mv";
         mkdir_p "$localrepo/$dist/$arch/logs/success/$name-$version-$release";
-        system ("cp $scratch/.build.log $localrepo/$dist/$arch/logs/success/$name-$version-$release/log") == 0 or die "mv";
+        system ("mv $scratch/.build.log $localrepo/$dist/$arch/logs/success/$name-$version-$release/log") == 0 or die "mv";
         # Detach and terminate
         {
             lock($DETACHING);
@@ -825,7 +825,7 @@ sub build_package {
     } else {
         mkdir_p "$localrepo/$dist/$arch/logs/fail/$name-$version-$release";
         if ( -f "$scratch/.build.log" ) {
-            system ("cp $scratch/.build.log $localrepo/$dist/$arch/logs/fail/$name-$version-$release/log") == 0 or die "cp";
+            system ("mv $scratch/.build.log $localrepo/$dist/$arch/logs/fail/$name-$version-$release/log") == 0 or die "cp";
             warning("Build failed, Leaving the logs in $localrepo/$dist/$arch/logs/fail/$name-$version-$release/log");
         }
         # Detach and terminate