diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-24 20:48:45 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-24 20:48:45 +0000 |
commit | 2669414d012181b98cbdd2a3fb4677b2700bd5d2 (patch) | |
tree | c253718a123309531902aac897f1d20412d38729 /urpm | |
parent | 8e669ac1dd7e925d9fb4f2e6b0f42e69f8458b4e (diff) | |
download | urpmi-2669414d012181b98cbdd2a3fb4677b2700bd5d2.tar urpmi-2669414d012181b98cbdd2a3fb4677b2700bd5d2.tar.gz urpmi-2669414d012181b98cbdd2a3fb4677b2700bd5d2.tar.bz2 urpmi-2669414d012181b98cbdd2a3fb4677b2700bd5d2.tar.xz urpmi-2669414d012181b98cbdd2a3fb4677b2700bd5d2.zip |
create _parse_hdlist_or_synthesis() and use it.
(nb: {must_build_synthesis} can still be set on {virtual} media, it won't do
anything... for now :)
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/media.pm | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/urpm/media.pm b/urpm/media.pm index 956cec08..2410d7af 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -1028,6 +1028,15 @@ sub _parse_synthesis { ($medium->{start}, $medium->{end}) = $urpm->parse_synthesis($synthesis_file, $o_callback ? (callback => $o_callback) : @{[]}); } +sub _parse_hdlist_or_synthesis { + my ($urpm, $medium, $hdlist_or) = @_; + + if ($medium->{synthesis}) { + _parse_synthesis($urpm, $medium, $hdlist_or); + } else { + _parse_hdlist($urpm, $medium, $hdlist_or); + } +} sub _parse_maybe_hdlist_or_synthesis { my ($urpm, $medium, $hdlist_or) = @_; @@ -1636,17 +1645,14 @@ sub _update_medium_second_pass { ($medium->{start}, $medium->{end}) = $urpm->parse_headers(dir => "$urpm->{cachedir}/headers", headers => $medium->{headers}, ); - } elsif ($medium->{synthesis}) { - if ($medium->{virtual}) { - if (file_from_file_url($medium->{url})) { - _parse_synthesis($urpm, $medium, hdlist_or_synthesis_for_virtual_medium($medium)); - } - } else { - _parse_synthesis($urpm, $medium, statedir_synthesis($urpm, $medium)); - } } else { - _parse_hdlist($urpm, $medium, statedir_hdlist($urpm, $medium)); - $medium->{must_build_synthesis} ||= 1; + my $hdlist_or = $medium->{virtual} ? hdlist_or_synthesis_for_virtual_medium($medium) : + $medium->{synthesis} ? + statedir_synthesis($urpm, $medium) : + statedir_hdlist($urpm, $medium); + _parse_hdlist_or_synthesis($urpm, $medium, $hdlist_or); + + $medium->{must_build_synthesis} = !$medium->{synthesis}; } $callback && $callback->('done', $medium->{name}); |