aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mandriva.org>2007-03-01 20:45:50 +0000
committerAnssi Hannula <anssi@mandriva.org>2007-03-01 20:45:50 +0000
commit471c53ddf3d16c951d69820a7b6c22f9f3493235 (patch)
tree689750ee99116c773ea29d8807853027c8540571
parenta922f9536fb5e87f62e26fe4a67d37cecd6a249f (diff)
downloadiurt-471c53ddf3d16c951d69820a7b6c22f9f3493235.tar
iurt-471c53ddf3d16c951d69820a7b6c22f9f3493235.tar.gz
iurt-471c53ddf3d16c951d69820a7b6c22f9f3493235.tar.bz2
iurt-471c53ddf3d16c951d69820a7b6c22f9f3493235.tar.xz
iurt-471c53ddf3d16c951d69820a7b6c22f9f3493235.zip
add per-package build_timeout configuration support
-rwxr-xr-xiurt228
1 files changed, 25 insertions, 3 deletions
diff --git a/iurt2 b/iurt2
index b5421dc..8654829 100755
--- a/iurt2
+++ b/iurt2
@@ -74,7 +74,9 @@ $run{todo} = [];
{--config_help | --dkms {--media <media regexp>}
--chroot --arch {i586|x86_64|ppc} --distro {cooker|2006.0|community/2006.0|...} } |
--rebuild {cooker|2006.0|community/2006.0|...} {i586|x86_64|ppc|...} {filename1.src.rpm} {filename2.src.rpm} ... {filenamen.src.rpm} }",
- "$program_name is a perl script to rebuild automatically several rpm in chroot, given a sourcerpm repository, and mail authors or rebuilder when problems occurs.",
+ "$program_name is a perl script to rebuild automatically several rpm in chroot, given a sourcerpm repository, and mail authors or rebuilder when problems occurs.
+
+ e.g.: iurt --repository /dis/ -p foo\@foo.net -r cooker x86_64 /SRPMS/main/release/mkcd-4.2.5-1mdv2007.1.src.rpm",
sub { $arg or usage($program_name, \@params) }, "" ],
[ "", "distro", 1, "<distro>",
"Set the distribution",
@@ -261,6 +263,18 @@ $run{todo} = [];
($run{status_mail}) = @_;
1;
}, "Setting status mail option" ],
+ [ "", "with", 1, "<flag>",
+ "Use specified --with flag with rpm (can be used multiple times)",
+ sub {
+ ($run{with_flags}) = $run{with_flags} . " --with " . @_[0];
+ 1;
+ }, "Adding specified extra --with parameter to rpm" ],
+ [ "", "without", 1, "<flag>",
+ "Use specified --without flag with rpm (can be used multiple times)",
+ sub {
+ ($run{with_flags}) = $run{with_flags} . " --without " . @_[0];
+ 1;
+ }, "Adding specified extra --without parameter to rpm" ],
);
open(my $LOG, ">&STDERR");
@@ -353,6 +367,12 @@ my %config_usage = (
'curl',
]
},
+ build_timeout => {
+ desc => 'Maximum build time after which the build process is terminated',
+ default => {
+ default => 18000,
+ },
+ },
cache_home => {
desc => 'Where to store the cache files',
default => "$HOME/.bugs"
@@ -820,20 +840,22 @@ retry:
debug_mail => $run{debug},
log => "$local_spool/log/$log_dirname/"); # or next; As this failed quite often, do not stop
plog('NOTIFY', "Building $srpm");
- my $command = "rpm --rebuild /home/$luser/rpm/SRPMS/$srpm";
+ my $command = "rpm --rebuild $run{with_flags} /home/$luser/rpm/SRPMS/$srpm";
if ($run{stop}) {
$urpmi->install_packages('chroot', $chroot_tmp, $local_spool, \%pack_provide, 'configure', "[ADMIN] installation of urpmi and sudo failed in the chroot $run{my_arch}", { check => 1, maintainer => $config->{admin} }, 'urpmi', 'sudo');
add_sudoers(\%run, $chroot_tmp, $luser);
$command = "rpm -b$run{stop} /home/$luser/rpm/SPECS/$spec";
}
+ my ($srpm_name) = $srpm =~ /(?:.*:)?(.*)-[^-]+-[^-]+\.src\.rpm$/;
+
if (!perform_command(qq(TMP=/home/$luser/tmp/ $sudo chroot $chroot_tmp /bin/su - $luser -c "$command"),
\%run, $config, $cache,
mail => $maintainer,
error => "[REBUILD] $srpm from $run{distro_tag} does not build correctly on $run{my_arch}",
logname => "build",
hash => "build_$srpm",
- timeout => 18000,
+ timeout => $config->{build_timeout}{$srpm_name} ? $config->{build_timeout}{$srpm_name} : $config->{build_timeout}{default},
srpm => $srpm,
debug_mail => $run{debug},
cc => $cc,