add ccache --pkg-ccache option 40/254740/1
authorHyunggi Lee <hyunggi.lee@samsung.com>
Tue, 9 Mar 2021 05:48:11 +0000 (14:48 +0900)
committerHyunggi Lee <hyunggi.lee@samsung.com>
Tue, 9 Mar 2021 05:48:11 +0000 (14:48 +0900)
build package will run follow
 - rsync ccache.tar  to .build.oldpackages/_ccache.tar

Change-Id: I05a972a527f6daf8148f1b802fd04f96fc60bcf4
Signed-off-by: Hyunggi Lee <hyunggi.lee@samsung.com>
depanneur

index a289bc3a58788a8fc4d93b64ed9570b281741a38..2a920f78bbc3e0beb33df746770c50feb6e0e2a1 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -135,6 +135,8 @@ my $overwrite = 0;      # rebuilt packages if it's already built out
 my $MAX_THREADS = 1;    # max threads depanneur creates
 my $extra_packs = "";   # extra packages which should install to build root
 my $ccache = 0;         # use ccache to speed up building
+my $pkg_ccache = "";    # use ccacahge /path/to/ccache.tar
+                        # path to archive of ccache directory content.
 my $icecream = 0;       # use icecream to specify the number of parallel processes
 my $noinit = 0;         # don't check build root, just go into it and building
 my $keep_packs = 0;     # don't remove useless rpm packages from build root
@@ -231,6 +233,7 @@ GetOptions (
     "threads=s" => \$MAX_THREADS,
     "extra-packs=s" => \$extra_packs,
     "ccache" => \$ccache,
+    "pkg-ccache=s" => \$pkg_ccache,
     "icecream=s" => \$icecream,
     "noinit" => \$noinit,
     "keep-packs" => \$keep_packs,
@@ -1970,6 +1973,9 @@ sub build_package {
     push @args, "--arch '$archpath'";
     push @args, "'$srpm_filename'";
     push @args, "--ccache" if ($ccache);
+    if (! $pkg_ccache eq "") {
+        push @args, "--pkg-ccache '$pkg_ccache'";
+    }
     push @args, "--icecream '$icecream'" if ($icecream);
     push @args, "--baselibs" if ($create_baselibs);
     if (! $extra_packs eq "") {