@@ -49,6 +49,8 @@ def main():
49
49
"Any preexisting BUILD, BUILDROOT, RPMS or SRPMS directories will be removed first. "
50
50
"If --output-dir is set, the RPMS and SRPMS directories will be copied to it "
51
51
"after the build." )
52
+ parser .add_argument ('--ccache' , action = 'store' ,
53
+ help = "Use given directory as a cache for ccache, mounted in the container" )
52
54
parser .add_argument ('--define' ,
53
55
help = "Definitions to be passed to rpmbuild (if --build-local is "
54
56
"passed too). Example: --define 'xcp_ng_section extras', for building the 'extras' "
@@ -111,6 +113,12 @@ def main():
111
113
docker_args += ["-v" , "%s:/home/builder/rpmbuild" %
112
114
os .path .abspath (args .build_local )]
113
115
docker_args += ["-e" , "BUILD_LOCAL=1" ]
116
+ if args .ccache :
117
+ docker_args += ["-v" , f"{ args .ccache } :/home/builder/ccachedir" ,
118
+ "-e" , "CCACHE_DIR=/home/builder/ccachedir" ,
119
+ # FIXME
120
+ "-e" , "PATH=/usr/lib64/ccache:/home/builder/.local/bin:/home/builder/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ,
121
+ ]
114
122
if args .define :
115
123
docker_args += ["-e" , "RPMBUILD_DEFINE=%s" % args .define ]
116
124
if args .rpmbuild_opts :
0 commit comments