summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-03-26 13:39:58 +0000
committerFrancois Pons <fpons@mandriva.com>2001-03-26 13:39:58 +0000
commit8500b9980c2778fbce2fcb050d1049cee81809f8 (patch)
tree17e5cb204fb20ca49ddbc7d1fc338f3c75f99501 /urpm.pm
parentf09adc5ead5dfa93ea5c46086c4a6540600302fb (diff)
downloadurpmi-8500b9980c2778fbce2fcb050d1049cee81809f8.tar
urpmi-8500b9980c2778fbce2fcb050d1049cee81809f8.tar.gz
urpmi-8500b9980c2778fbce2fcb050d1049cee81809f8.tar.bz2
urpmi-8500b9980c2778fbce2fcb050d1049cee81809f8.tar.xz
urpmi-8500b9980c2778fbce2fcb050d1049cee81809f8.zip
*** empty log message ***
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/urpm.pm b/urpm.pm
index cdbd7aec..5df42b2a 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -469,23 +469,30 @@ sub update_media {
#- build list file according to hdlist used.
#- make sure group and other does not have any access to this file.
unless ($error) {
- local *LIST;
- my $mask = umask 077;
- open LIST, ">$urpm->{cachedir}/partial/$medium->{list}"
- or $error = 1, $urpm->{error}("unable to write list file of \"$medium->{name}\"");
- umask $mask;
+ #- sort list file contents according to depslist.ordered file.
+ my %list;
if (@files) {
foreach (@files) {
- print LIST "$prefix:/$_\n";
+ /\/([^\/]*)-[^-\/]*-[^-\/]*\.[^\/]*\.rpm/;
+ $list{"$prefix:/$_\n"} = ($urpm->{params}{info}{$1} || { id => 1000000000 })->{id};
}
} else {
local (*F, $_);
open F, "parsehdlist '$urpm->{cachedir}/partial/$medium->{hdlist}' |";
while (<F>) {
- print LIST "$medium->{url}/$_";
+ /\/([^\/]*)-[^-\/]*-[^-\/]*\.[^\/]*\.rpm/;
+ $list{"$medium->{url}/$_"} = ($urpm->{params}{info}{$1} || { id => 1000000000 })->{id};
}
close F;
}
+
+ #- write list file.
+ local *LIST;
+ my $mask = umask 077;
+ open LIST, ">$urpm->{cachedir}/partial/$medium->{list}"
+ or $error = 1, $urpm->{error}("unable to write list file of \"$medium->{name}\"");
+ umask $mask;
+ print LIST sort { $list{$a} <=> $list{$b} } keys %list;
close LIST;
#- check if at least something has been written into list file.