check and use scratch.incremental first
authorZhang Qiang <qiang.z.zhang@intel.com>
Thu, 13 Sep 2012 08:55:01 +0000 (16:55 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Thu, 13 Sep 2012 13:06:02 +0000 (21:06 +0800)
Without this patch, if scratch.incremental already exsit and
scratch.{arch}.0 exists too, depanneur still need to create new
scrach.incremental buildroot

Change-Id: I26855f36eada3216c9f7ea75efe2967b93ad1301

depanneur

index 05a053b81e9ac6aa5d72f8ead6c9aa62195982db..8700ed33b3d40ec39d9f4b94a94f8b0833f541f1 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -756,7 +756,9 @@ sub build_package {
     if ($incremental == 1) {
         info("Doing incremental build");
         my $buildcmd = "";
-        if ( ! -d "$scratch/home/abuild/rpmbuild/BUILD/$name-$version" ) {
+        if ( -d "$scratch_dir.incremental/home/abuild/rpmbuild/BUILD/$name-$version" ) {
+            $scratch = "$scratch_dir.incremental";
+        } elsif ( ! -d "$scratch/home/abuild/rpmbuild/BUILD/$name-$version" ){
             debug("Build directory exists");
             $scratch = "$scratch_dir.incremental";
             push @args, "--stage=\"-bp\"";