Call createdirdeps only if repo refresh needed 85/251285/1
authorHyokeun Jeon <hyokeun.jeon@samsung.com>
Tue, 12 Jan 2021 07:22:46 +0000 (16:22 +0900)
committerHyokeun Jeon <hyokeun.jeon@samsung.com>
Tue, 12 Jan 2021 07:22:59 +0000 (16:22 +0900)
- Do not have to create cache.local after the build.
- Change to one time when starting the next build.
- Build time improvement: 10 minutes savings for 1895 packges

Change-Id: I96005334bff71f5a129d340531c7666e38e12fce

depanneur

index 2be73b05c62dde4b4b37db2971510d5aec32cf06..241ef0301d1aa07524f4914b86307c9ac278db1c 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -1850,6 +1850,15 @@ sub update_repo_with_rpms {
     }
 }
 
+#---------------------------------------------------------------------
+# create repo.cache.local
+#---------------------------------------------------------------------
+sub create_cache_local {
+    my_system("'$build_dir'/createdirdeps '$rpm_repo_path' > '$order_dir'/.repo.cache.local ");
+    my_system("echo D: >> '$order_dir'/.repo.cache.local");
+    my_system("cat '$order_dir'/.repo.cache.local '$order_dir'/.repo.cache.remote >'$order_dir'/.repo.cache");
+}
+
 #---------------------------------------------------------------------
 # Generate buid command and run it
 #---------------------------------------------------------------------
@@ -2120,10 +2129,6 @@ sub build_package {
                     my_system ("sudo ln '$_' '$rpm_repo_path'");
                 }
             }
-
-            my_system("'$build_dir'/createdirdeps '$rpm_repo_path' > '$order_dir'/.repo.cache.local ");
-            my_system("echo D: >> '$order_dir'/.repo.cache.local");
-            my_system("cat '$order_dir'/.repo.cache.local '$order_dir'/.repo.cache.remote >'$order_dir'/.repo.cache");
         }
         info("finished building $name");
         $packages_built = 1;
@@ -2943,6 +2948,7 @@ while (! $TERM) {
         lock($DETACHING);
         if ($dirty) {
             # there is any package has been built
+            create_cache_local();
             refresh_repo();
             update_expansion_errors();
             #update_pkgdeps();