diff options
author | Florent Villard <warly@mandriva.com> | 2006-03-31 14:42:26 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2006-03-31 14:42:26 +0000 |
commit | befe8d625f6900d3c992faeb7cd16c4152eb2629 (patch) | |
tree | cce10ec46c3ed25eca37233e30f38dad64305918 | |
parent | 275abdcc960d12efb338d298913b25ec7fea85ce (diff) | |
download | iurt-befe8d625f6900d3c992faeb7cd16c4152eb2629.tar iurt-befe8d625f6900d3c992faeb7cd16c4152eb2629.tar.gz iurt-befe8d625f6900d3c992faeb7cd16c4152eb2629.tar.bz2 iurt-befe8d625f6900d3c992faeb7cd16c4152eb2629.tar.xz iurt-befe8d625f6900d3c992faeb7cd16c4152eb2629.zip |
split cache by media too
-rwxr-xr-x | iurt2 | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -247,7 +247,7 @@ if ($run{distro} ne 'cooker') { if (!$run{debug} && $run{media} || $run{chroot}) { $run{pidfile_home} = "$config->{cache_home}/"; - $run{pidfile} = "iurt.$run{distro_tag}.$run{my_arch}"; + $run{pidfile} = "iurt.$run{distro_tag}.$run{my_arch}.$run{media}"; check_pid(\%run) } @@ -258,7 +258,7 @@ if ($run{chroot}) { check_chroot($chroot, $chroot_tar, \%run) } -my $cachefile = "$config->{cache_home}/iurt.$run{distro_tag}.$run{my_arch}.cache"; +my $cachefile = "$config->{cache_home}/iurt.$run{distro_tag}.$run{my_arch}.$run{media}.cache"; $run{cachefile} = $cachefile; my $cache; my $clear_cache = 1; @@ -269,13 +269,13 @@ if (-f $cachefile && $run{use_cache}) { opendir my $cache_dir, $config->{cache_home}; my $to_load; foreach my $file (readdir $cache_dir) { - (my $date) = $file =~ /iurt\.$run{distro_tag}\.$run{my_arch}\.cache\.tmp\.(\d{8})/ or next; + (my $date) = $file =~ /iurt\.$run{distro_tag}\.$run{my_arch}\.$run{media}\.cache\.tmp\.(\d{8})/ or next; if ($date > $to_load && -s "$config->{cache_home}/$file" > $config->{cache_min_size}) { $to_load = $date; $cachefile = "$config->{cache_home}/$file" } } - print "To load: $to_load\n"; + print {$run{LOG}} "iurt: loading alternate cache file $cachefile\n"; $cache = do $cachefile or print "FATAL iurt: could not load cache $cachefile ($!)\n" } $clear_cache = 0 if $cache @@ -1049,8 +1049,14 @@ sub check_pid { my $pid = <$test_PID>; my (@stat) = stat $pf; my $time = $stat[9]; - print {$run->{LOG}} "iurt: an other iurt is running for $run->{my_arch} on $pid_host, pid $pid, since ",time - $time," seconds\n"; - exit + my $diff = time - $time; + my $msg = "iurt: an other iurt is running for $run->{my_arch} on $pid_host, pid $pid, since $diff seconds"; + if ($diff < 36000) { + print {$run->{LOG}} "$msg\n"; + exit + } else { + print {$run->{LOG}} "$msg, ignoring it\n" + } } } $run->{pidfile} .= ".pid"; |