From 8500b9980c2778fbce2fcb050d1049cee81809f8 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Mon, 26 Mar 2001 13:39:58 +0000 Subject: *** empty log message *** --- urpm.pm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'urpm.pm') 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 () { - 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. -- cgit v1.2.1