my $cleanonce = 0;
my $debug = 0;
my $incremental = 0;
+my $run_configure = 0;
my $overwrite = 0;
my $MAX_THREADS = 1;
my $suffix = "";
"suffix=s" => \$suffix,
"debug" => \$debug,
"incremental" => \$incremental,
+ "no-configure" => \$run_configure,
"threads=s" => \$MAX_THREADS,
);
-
my $scratch_dir = "$build_root/local/scratch.$arch";
if ( $exclude_from_file ne "" && -e $exclude_from_file ) {
if ($MAX_THREADS > 1 ) {
$redirect = "> /dev/null 2>&1";
}
- if ($incremental) {
- my $incremental_opt = "--short-circuit --stage -bc";
+ my $incremental_opt = "";
+ if ($incremental == 1) {
+ print "Doing incremental build\n";
+ my $buildcmd = "";
+ if ( ! -d "$scratch/home/abuild/rpmbuild/BUILD/$name-$version" ) {
+ print "Build directory exists\n";
+ my $incremental_opt = "--stage=\"-bp\"";
+ $scratch = "$scratch_dir.incremental";
+ $buildcmd = "sudo BUILD_ROOT=$scratch BUILD_DIR=\"$build_dir\" $virtualenv/usr/bin/build --uid $zuid:$zgid --jobs 4 $clean_option $incremental_opt --cachedir $cache_dir --dist $dist --configdir $dist_configs $repos $srpm_filename $redirect ";
+ system ($buildcmd);
+ } else {
+ print "Build directory does not exist\n";
+ }
+ my $mount = "sudo mount -o bind $path $scratch/home/abuild/rpmbuild/BUILD/$name-$version";
+ system($mount);
+ my $incremental_opt = "--short-circuit --stage=\"-bc\"";
+ my $no_configure = "";
+ if ($run_configure == 1 ) {
+ $no_configure = "--define '%configure echo' --define '%autogen echo' --define '%reconfigure echo'";
+ }
+ $buildcmd = "sudo BUILD_ROOT=$scratch BUILD_DIR=\"$build_dir\" $virtualenv/usr/bin/build $no_configure --no-topdir-cleanup --no-init --uid $zuid:$zgid --jobs 4 $clean_option $incremental_opt --cachedir $cache_dir --dist $dist --configdir $dist_configs $repos $srpm_filename $redirect ";
+ system ($buildcmd);
+ $mount = "sudo umount $scratch/home/abuild/rpmbuild/BUILD/$name-$version";
+ system($mount);
+ # Detach and terminate
+ {
+ lock($DETACHING);
+ threads->detach() if ! threads->is_detached();
+ }
+ print GREEN, "finished incremental building $name\n", RESET;
+ exit(1);
}
my $buildcmd = "sudo BUILD_ROOT=$scratch BUILD_DIR=\"$build_dir\" $virtualenv/usr/bin/build --uid $zuid:$zgid --jobs 4 $clean_option $incremental_opt --cachedir $cache_dir --dist $dist --configdir $dist_configs $repos $srpm_filename $redirect ";
debug("$buildcmd");