aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xiurt218
1 files changed, 12 insertions, 6 deletions
diff --git a/iurt2 b/iurt2
index 1e7b95b..cb20243 100755
--- a/iurt2
+++ b/iurt2
@@ -118,7 +118,7 @@ if (!$debug) {
}
} else {
print STDERR "iurt: an other iurt is running for $my_arch, pid $pid, since ",time - $time," seconds\n";
- # exit
+ exit
}
} else {
print STDERR "iurt: a previous iurt for $my_arch seems dead, cleaning.\n";
@@ -254,7 +254,7 @@ if (!@todo && !$debug) {
print "iurt: will try to compile $to_compile packages\n";
$cache->{run} ||= 1;
-my $run = $cache->{run}++;
+my $run = ++$cache->{run};
my $debug_tag = '_debug' if $debug;
@@ -274,11 +274,14 @@ if (!$nocheckchroot) {
if ($unionfs) {
clean_chroot($chroot) or die "FATAL iurt: Could no prepare initial chroot";
- $unionfs_dir = "$config->{local_home}/iurt_unionfs$debug_tag";
- -d $unionfs_dir or mkdir $unionfs_dir
}
}
+if ($unionfs) {
+ $unionfs_dir = "$config->{local_home}/iurt_unionfs$debug_tag";
+ -d $unionfs_dir or mkdir $unionfs_dir
+}
+
my $local_spool = "$config->{local_home}/iurt/$distro_tag/$my_arch";
if (!-d "$config->{local_home}/iurt/$distro_tag/") {
mkdir "$config->{local_home}/iurt/$distro_tag";
@@ -287,6 +290,11 @@ if (!-d "$config->{local_home}/iurt/$distro_tag/") {
mkdir "$local_spool/log"
}
}
+
+my $s = sub { print "iurt: dumping cache...\n"; dump_cache(); exit };
+$SIG{TERM} = $s;
+$SIG{INT} = $s;
+
my %done;
my $wait_limit;
my $done;
@@ -299,8 +307,6 @@ foreach (my $i ; $i < @todo; $i++) {
check_version($srpm) or next;
if ($debug) { $debug++ == 2 and exit }
$done++;
- # dump cache every ten packages (we can be killed by other iurt if we are stuck)
- if (!$done % 10) { dump_cache() }
print "iurt: packages $srpm [$done/$to_compile]\n";
if ($unionfs) {
my $tmpfs;