aboutsummaryrefslogtreecommitdiffstats
path: root/iurt2
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2006-01-06 22:33:53 +0000
committerFlorent Villard <warly@mandriva.com>2006-01-06 22:33:53 +0000
commitf6182b666e3d3ca208b603fcc5bee4d31a36e83d (patch)
tree9be6c23491c59becfe6ea6e38754f71ca714a13a /iurt2
parente22910a8df8b708ad08455b48fc8d3d01fea24db (diff)
downloadiurt-f6182b666e3d3ca208b603fcc5bee4d31a36e83d.tar
iurt-f6182b666e3d3ca208b603fcc5bee4d31a36e83d.tar.gz
iurt-f6182b666e3d3ca208b603fcc5bee4d31a36e83d.tar.bz2
iurt-f6182b666e3d3ca208b603fcc5bee4d31a36e83d.tar.xz
iurt-f6182b666e3d3ca208b603fcc5bee4d31a36e83d.zip
Dump cache on sigint. Re-exit if iurt is already running. Initialise unionfs path in nocheckchroot mode
Diffstat (limited to 'iurt2')
-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;