diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-11-25 17:01:40 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-11-25 17:01:40 +0000 |
commit | 2e6d59119850d63ab417e5ab725ffdf34fb283fa (patch) | |
tree | 3c4b2f295b27743a4d42418bb92794fc1cacd6d3 | |
parent | 2ba30f2e83f3a1f58a2ff75553ae2518d6f00730 (diff) | |
download | urpmi-2e6d59119850d63ab417e5ab725ffdf34fb283fa.tar urpmi-2e6d59119850d63ab417e5ab725ffdf34fb283fa.tar.gz urpmi-2e6d59119850d63ab417e5ab725ffdf34fb283fa.tar.bz2 urpmi-2e6d59119850d63ab417e5ab725ffdf34fb283fa.tar.xz urpmi-2e6d59119850d63ab417e5ab725ffdf34fb283fa.zip |
Don't use 'and my'
-rwxr-xr-x | urpmq | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -329,7 +329,8 @@ if ($urpm::args::options{list_aliases}) { # get descriptions of update sources my $updates_descr = $urpm->urpm::get_updates_description; # if not root, use a temporary directory to store headers - $< != 0 and my $tmp_header_dir = chomp_(`mktemp -d /tmp/urpmq.XXXXXX`); + my $tmp_header_dir = "$urpm->{cachedir}/headers"; + $< != 0 and $tmp_header_dir = chomp_(`mktemp -d /tmp/urpmq.XXXXXX`); foreach (0..$#{$urpm->{media} || []}) { if ($urpm->{media}[$_]{synthesis}) { $urpm->{log}->(N("skipping media %s: no hdlist\n", $urpm->{media}[$_]{name})); @@ -347,7 +348,7 @@ if ($urpm::args::options{list_aliases}) { : "$urpm->{statedir}/$urpm->{media}[$_]{hdlist}", quiet => 1, ); - $packer->extract_archive($< == 0 ? "$urpm->{cachedir}/headers" : $tmp_header_dir, @headers); + $packer->extract_archive($tmp_header_dir, @headers); } elsif (!%downloads) { #- fallback to retrieve rpm package before, so that --headers will be ok. %downloads = $urpm->download_source_packages({}, $list, force_local => 1); @@ -410,7 +411,7 @@ if ($urpm::args::options{list_aliases}) { } } } - -d $tmp_header_dir and rmdir $tmp_header_dir; + -d $tmp_header_dir && $< != 0 and rmdir $tmp_header_dir; } elsif ($urpm::args::options{sources}) { print join "\n", values %$local_sources; values %$local_sources and print "\n"; foreach (0..$#{$urpm->{media} || []}) { |