diff options
Diffstat (limited to 'URPM')
-rw-r--r-- | URPM/Build.pm | 16 | ||||
-rw-r--r-- | URPM/Resolve.pm | 4 |
2 files changed, 12 insertions, 8 deletions
diff --git a/URPM/Build.pm b/URPM/Build.pm index 18a02d6..d4921f2 100644 --- a/URPM/Build.pm +++ b/URPM/Build.pm @@ -26,8 +26,12 @@ sub parse_rpms_build_headers { unless ($options{clean}) { opendir DIR, $dir; while (my $file = readdir DIR) { - $file =~ /(.+?-[^:\-]+-[^:\-]+\.[^:\-\.]+)(?::(\S+))?$/ or next; - $cache{$2 || $1} = $file; + my ($fullname, $filename) = $file =~ /(.+?-[^:\-]+-[^:\-]+\.[^:\-\.]+)(?::(\S+))?$/ or next; + my @stat = stat "$dir/$_"; + $cache{$filename || $fullname} = { file => $file, + size => $stat[7], + time => $stat[9], + }; } closedir DIR; } @@ -36,12 +40,12 @@ sub parse_rpms_build_headers { my ($key) = m!([^/]*)\.rpm$! or next; #- get rpm filename. my ($id, $filename); - if ($cache{$key} && -s "$dir/$cache{$key}") { - ($id, undef) = $urpm->parse_hdlist("$dir/$cache{$key}", !$options{callback}); - defined $id or die "bad header $dir/$cache{$key}\n"; + if ($cache{$key} && $cache{$key}{time} > 0 && $cache{$key}{time} >= (stat $_)[9]) { + ($id, undef) = $urpm->parse_hdlist("$dir/$cache{$key}{file}", !$options{callback}); + defined $id or die "bad header $dir/$cache{$key}{file}\n"; $options{callback} and $options{callback}->($urpm, $id, %options); - $filename = $cache{$key}; + $filename = $cache{$key}{file}; } else { ($id, undef) = $urpm->parse_rpm($_); defined $id or die "bad rpm $_\n"; diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 8b68932..a8489f6 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -383,7 +383,7 @@ sub resolve_requested { next; #- always redo according to choices. } - #- now do the realy work, select the package. + #- now do the real work, select the package. my ($pkg) = @chosen; !$pkg || $pkg->flag_selected || exists $state->{selected}{$pkg->id} and next; @@ -427,7 +427,7 @@ sub resolve_requested { exists $dep->{from} ? (from => $dep->{from}) : @{[]}, }; - $options{no_flag_update} or $pkg->set_flag_required; + $pkg->set_flag_required; #- check if package is not already installed before trying to use it, compute #- obsoleted package too. this is valable only for non source package. |