diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-01-11 16:54:22 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-01-11 16:54:22 +0000 |
commit | 3c6714052c3bb51abeefa2a3a161759d1036f3f0 (patch) | |
tree | cc220f86742eb232c96db00d2bea5cc12700f2a5 | |
parent | e77a0070a9e7682c6d5c9d84fcab8ce1212bd634 (diff) | |
download | urpmi-3c6714052c3bb51abeefa2a3a161759d1036f3f0.tar urpmi-3c6714052c3bb51abeefa2a3a161759d1036f3f0.tar.gz urpmi-3c6714052c3bb51abeefa2a3a161759d1036f3f0.tar.bz2 urpmi-3c6714052c3bb51abeefa2a3a161759d1036f3f0.tar.xz urpmi-3c6714052c3bb51abeefa2a3a161759d1036f3f0.zip |
cleanup: @headers is independent of the "foreach my $medium", moving it out of the loop
-rwxr-xr-x | urpmq | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -66,6 +66,8 @@ usage: ") . N(" --force - force invocation even if some packages do not exist. ") . N(" --ignorearch - allow to query rpms for unmatched architectures. ") . N(" --parallel - distributed urpmi across machines of alias. +") . N(" --root - use another root for rpm installation. +") . N(" --urpmi-root - use another root for urpmi db & rpm installation. ") . N(" --use-distrib - configure urpmi on the fly from a distrib tree. This permit to querying a distro. ") . N(" --probe-synthesis - use synthesis file. @@ -80,6 +82,7 @@ usage: ") . N(" --env - use specific environment (typically a bug report). ") . N(" --changelog - print changelog. ") . N(" --summary, -S - print summary. +") . N(" --verbose, -v - verbose mode. ") . N(" -a - select all matches on command line. ") . N(" -c - complete output with package to be removed. ") . N(" -d - extend query to package dependencies. @@ -94,7 +97,6 @@ usage: ") . N(" -RR - extended reverse search (includes virtual packages). ") . N(" -s - next package is a source package (same as --src). ") . N(" -u - remove package if a more recent version is already installed. -") . N(" -v - verbose mode. ") . N(" -y - impose fuzzy search (same as --fuzzy). ") . N(" -Y - like -y, but forces to match case-insensitively. ") . "\n" . N(" names or rpm files given on command line are queried. @@ -326,15 +328,16 @@ if ($urpm::args::options{list_aliases}) { # if not root, use a temporary directory to store headers my $tmp_header_dir = $< != 0 ? urpm::sys::mktempdir() : "$urpm->{cachedir}/headers"; my @selected = map { split /\|/ } keys %{$state->{selected}}; - foreach my $medium (@{$urpm->{media} || []}) { - if ($medium->{synthesis}) { - $urpm->{log}->(N("skipping media %s: no hdlist", $medium->{name})); - next; - } - if (my @headers = (grep { ! -s "$urpm->{cachedir}/headers/$_" } - map { my $pkg = $urpm->{depslist}[$_]; - $pkg && $pkg->header_filename } @selected)) - { + + if (my @headers = (grep { ! -s "$urpm->{cachedir}/headers/$_" } + map { my $pkg = $urpm->{depslist}[$_]; + $pkg && $pkg->header_filename } @selected)) { + + foreach my $medium (@{$urpm->{media} || []}) { + if ($medium->{synthesis}) { + $urpm->{log}->(N("skipping media %s: no hdlist", $medium->{name})); + next; + } my %h = map { $_ => 1 } @headers; @headers = keys %h; my $hdlist_path = urpm::media::any_hdlist($urpm, $medium); if (-s $hdlist_path) { @@ -356,6 +359,7 @@ if ($urpm::args::options{list_aliases}) { my $pkg = $urpm->{depslist}[$_] or next; #- even if non-root, search for a header in the global cachedir my $file = $local_sources->{$_} || $downloads{$_} || "$urpm->{cachedir}/headers/" . $pkg->header_filename; + warn "$file\n"; if (-s $file) { $pkg->update_header($file, keep_all_tags => 1); } elsif ($< != 0) { |