diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-21 10:29:45 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-21 10:29:45 +0000 |
commit | df273081437fc4bdc5a5cb18201eb49ed73a4a21 (patch) | |
tree | ba370d2b9754328a4b29e542fa2a6a324e3650ef /urpm.pm | |
parent | fab258f403d9fe9f5e5b9300ae7205921e67edcd (diff) | |
download | urpmi-df273081437fc4bdc5a5cb18201eb49ed73a4a21.tar urpmi-df273081437fc4bdc5a5cb18201eb49ed73a4a21.tar.gz urpmi-df273081437fc4bdc5a5cb18201eb49ed73a4a21.tar.bz2 urpmi-df273081437fc4bdc5a5cb18201eb49ed73a4a21.tar.xz urpmi-df273081437fc4bdc5a5cb18201eb49ed73a4a21.zip |
_update_medium_second_pass: move what is not $second_pass dependent in _update_medium_build_hdlist_synthesis()
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -1811,12 +1811,13 @@ sub _update_medium_first_pass_failed { #- take care of modified medium only, or all if all have to be recomputed. sub _update_medium_second_pass { - my ($urpm, $medium, $second_pass, $callback) = @_; + my ($urpm, $medium, $callback) = @_; $callback and $callback->('parse', $medium->{name}); + #- a modified medium is an invalid medium, we have to read back the previous hdlist #- or synthesis which has not been modified by first pass above. - if ($second_pass) { + if ($medium->{headers} && !$medium->{modified}) { $urpm->{log}(N("reading headers from medium \"%s\"", $medium->{name})); ($medium->{start}, $medium->{end}) = $urpm->parse_headers(dir => "$urpm->{cachedir}/headers", @@ -1834,7 +1835,12 @@ sub _update_medium_second_pass { _parse_hdlist($urpm, $medium, statedir_hdlist($urpm, $medium)); $medium->{must_build_synthesis} ||= 1; } - } + + $callback && $callback->('done', $medium->{name}); +} + +sub _update_medium_build_hdlist_synthesis { + my ($urpm, $medium) = @_; if ($medium->{headers} && !$medium->{modified}) { _build_hdlist_using_rpm_headers($urpm, $medium); @@ -1847,7 +1853,6 @@ sub _update_medium_second_pass { _build_synthesis($urpm, $medium); } } - $callback && $callback->('done', $medium->{name}); } sub remove_obsolete_headers_in_cache { @@ -1937,9 +1942,12 @@ sub update_media { $urpm->unresolved_provides_clean; } - #- second pass consists in reading again synthesis or hdlists. foreach my $medium (grep { !$_->{ignore} } @{$urpm->{media}}) { - _update_medium_second_pass($urpm, $medium, $second_pass, $options{callback}); + if ($second_pass) { + #- second pass consists in reading again synthesis or hdlists. + _update_medium_second_pass($urpm, $medium, $options{callback}); + } + _update_medium_build_hdlist_synthesis($urpm, $medium); } if ($urpm->{modified}) { |