diff --git a/conserver/mockbuild.pl b/conserver/mockbuild.pl index 64e493a..6d175e6 100755 --- a/conserver/mockbuild.pl +++ b/conserver/mockbuild.pl @@ -29,14 +29,16 @@ my $mock_uniqueext = ''; my $result_dir = "$script_dir/../build-output/list-conserver/conserver"; my $log_dir = "$script_dir/../build-logs/list-conserver/conserver"; my $skip_install = 0; +my $build_timestamp; GetOptions( - 'work-dir=s' => \$work_dir, - 'mock-cfg=s' => \$mock_cfg, - 'mock-uniqueext=s' => \$mock_uniqueext, - 'result-dir=s' => \$result_dir, - 'log-dir=s' => \$log_dir, - 'skip-install!' => \$skip_install, + 'work-dir=s' => \$work_dir, + 'mock-cfg=s' => \$mock_cfg, + 'mock-uniqueext=s' => \$mock_uniqueext, + 'result-dir=s' => \$result_dir, + 'log-dir=s' => \$log_dir, + 'skip-install!' => \$skip_install, + 'build-timestamp=i' => \$build_timestamp, ) or die usage(); die "Run as root (current uid=$>)\n" if $> != 0; @@ -44,6 +46,16 @@ for my $bin (qw(mock rpmbuild rpm)) { run("command -v " . sh_quote($bin) . " >/dev/null 2>&1"); } +# Deterministic builds: honor --build-timestamp (else Gitepoch, else git HEAD time), +# matching the other xcat-dep builders so mockbuild-all.pl can drive this one. +my $repo_root = abs_path("$script_dir/.."); +my $sde = $build_timestamp; +if (!$sde && -f "$repo_root/Gitepoch") { $sde = capture("cat " . sh_quote("$repo_root/Gitepoch")); } +if (!$sde || $sde !~ /^\d+$/) { + $sde = capture("git -C " . sh_quote($repo_root) . " log -1 --format=%ct HEAD 2>/dev/null"); +} +$ENV{SOURCE_DATE_EPOCH} = $sde if defined $sde && $sde =~ /^\d+$/; + my $arch = capture('uname -m'); if (!$mock_cfg) { my $os_id = capture(q{bash -lc 'source /etc/os-release; echo $ID'}); diff --git a/mockbuild-all.pl b/mockbuild-all.pl index 520677a..6343818 100755 --- a/mockbuild-all.pl +++ b/mockbuild-all.pl @@ -221,6 +221,7 @@ my @dep_builders = ( { name => 'ipmitool-xcat', script => "$repo_root/ipmitool/mockbuild.pl" }, { name => 'syslinux-xcat', script => "$repo_root/syslinux/mockbuild.pl" }, { name => 'goconserver', script => "$repo_root/goconserver/mockbuild.pl" }, + { name => 'conserver-xcat', script => "$repo_root/conserver/mockbuild.pl" }, { name => 'xnba-undi', script => "$repo_root/xnba/mockbuild.pl" }, );