aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xiurt222
1 files changed, 14 insertions, 8 deletions
diff --git a/iurt2 b/iurt2
index 5aae5cf..28ddab9 100755
--- a/iurt2
+++ b/iurt2
@@ -25,7 +25,9 @@
#
# - use a cache (rpmctl cache for example) to find maintainer
# - add icecream compilation support
-# - add a --set option to compile a set of packages
+# - add a --group option to compile a set of packages (in progress)
+# - add a function to update a packages when it obviously need to be recompile
+# - Maybe call the function from the initial todo list (thus making the argument ordering important)
#
use strict;
use Hdlist;
@@ -116,9 +118,12 @@ $run{todo} = [ ];
print *{$run{LOG}}, "command line: @ARGV\n";
1
}, "Log file" ],
- [ "m", "media", -1, "",
+ [ "m", "media", -1, "<media 1> <media 2> ... <media 3>",
"Media to rebuild",
sub { ($run{media}) = @_; 1 }, "Adding a media to rebuild" ],
+ [ "n", "no", 0, "",
+ "Perform all the check but do not compile anything",
+ sub { ($run{no_compile}) = 1 }, "Setting the no compilation flag" ],
[ "r", "rebuild", -2, "<distro> <architecture> <srpm 1> <srpm 2> ... <srpm n>",
"Rebuild the packages, e.g. $program_name -r cooker x86_64 /home/foo/rpm/SRPMS/foo-2.3-12mdv2007.0.src.rpm",
sub {
@@ -404,7 +409,8 @@ if (!-d $chroot_tmp) {
$chroot_tmp = "$config->{local_home}/chroot_tmp/$run{user}/$chroot_name.$run{run}";
# now exit if there is nothing to do and it was just a cleaning pass
-if (!@{$run{todo}} && !$run{debug} && !$run{shell} && !$run{rebuild}) {
+if ($run{no_compile} || !@{$run{todo}} && !$run{debug} && !$run{shell} && !$run{rebuild}) {
+ send_status_mail(\%run, $config, $cache) if ($run{status_mail});
print {$run{LOG}} "iurt: no package to compile :(\n";
unlink "$run{pidfile_home}/$run{pidfile}" if $run{pidfile};
exit
@@ -605,14 +611,13 @@ do {
my $p = $pack_provide{$missing_deps} || $missing_deps;
my ($missing_package_name, $first_maint);
if ($missing_package !~ /\.src$/) {
- ($missing_package_name) = $missing_package =~ /(.*)-[^-]+-[^-]+\.[^.]+$/;
($first_maint, $missing_package_name) = get_maint(\%run, $missing_package);
print {$run{LOG}} "iurt: likely $missing_package_name need to be rebuilt ($first_maint)\n" if $run{verbose} > 4;
} else {
$missing_package = ''
}
my $other_maint = get_maint(\%run, $p);
- print {$run{LOG}} "missing dep: $missing_deps ($other_maint) missing_pacakge $missing_package ($first_maint)\n";
+ print {$run{LOG}} "missing dep: $missing_deps ($other_maint) missing_package $missing_package ($first_maint)\n";
foreach my $m ($first_maint, $other_maint) {
if ($other_maint && $other_maint ne 'NOT_FOUND') {
$opt->{mail} = "warly\@mandriva.com";
@@ -1600,7 +1605,7 @@ sub add_packages {
if (!perform_command("sudo $run{urpmi_command} @packages",
$run, $config,
mail => $config->{admin},
- timeout => 120,
+ timeout => 300,
freq => 1,
retry => 2,
debug_mail => $run->{debug},
@@ -1668,7 +1673,7 @@ sub add_media {
if (!perform_command("sudo chroot $chroot urpmi.addmedia $media",
$run, $config,
mail => $config->{admin},
- timeout => 120,
+ timeout => 300,
freq => 1,
retry => 2,
debug_mail => $run->{debug})) {
@@ -1867,7 +1872,7 @@ sub send_status_mail {
foreach my $version (keys %$h) {
if (ref $h->{$version}) {
$text .= " $pack should be recompile because\n $missing ". ($version ? "$version " : ''). "is not provided anymore\n";
- $text .= " to compile ". join("\n ". @{$h->{$version}}). "\n"
+ $text .= " to compile ". join("\n ", @{$h->{$version}}). "\n"
} else {
$text .= " $pack needs $missing ". ($version ? "$version " : ''). "\n";
}
@@ -1882,6 +1887,7 @@ sub send_status_mail {
$text .= " $rpm (see $config->{log_url}/$run{distro_tag}/$run{my_arch}/log/$rpm/)\n"
}
}
+ print "$text\n";
sendmail($run->{status_mail}, '' , "Iurt report for $run->{my_arch}/$run->{media}", "$text", 0, 0, 0)
}