diff options
-rw-r--r-- | urpm.pm | 34 | ||||
-rwxr-xr-x | urpmi | 18 | ||||
-rw-r--r-- | urpmi.spec | 7 |
3 files changed, 37 insertions, 22 deletions
@@ -1284,6 +1284,8 @@ sub search_packages { #- it is a way of speedup, providing the name of a package directly help #- to find the package. #- this is necessary if providing a name list of package to upgrade. + my $pkg = $urpm->{params}{info}{$v}; + defined $pkg->{id} and $exact{$v} = $pkg->{id}, next; unless ($options{fuzzy}) { my $pkg = $urpm->{params}{names}{$v}; if (defined $pkg->{id} && ($options{src} ? $pkg->{arch} eq 'src' : $pkg->{arch} ne 'src')) { @@ -1897,6 +1899,19 @@ sub download_source_packages { #- make sure everything is correct on input... @{$urpm->{media}} == @$list or return; + #- examine if given medium is already inside a removable device. + my $check_notfound = sub { + my ($id, $dir) = @_; + if (!$dir || -e $dir) { + foreach (values %{$list->[$id]}) { + /^(removable_?[^_:]*|file):\/(.*\/([^\/]*))/ or next; + -r $2 or return 1; + } + } else { + return 2; + } + return 0; + }; #- removable media have to be examined to keep mounted the one that has #- more package than other (size is better ?). my $examine_removable_medium = sub { @@ -1904,22 +1919,11 @@ sub download_source_packages { my $medium = $urpm->{media}[$id]; $media{$id} = undef; if (my ($prefix, $dir) = $medium->{url} =~ /^(removable[^:]*|file):\/(.*)/) { - my $check_notfound = sub { - if (-e $dir) { - foreach (values %{$list->[$id]}) { - /^(removable_?[^_:]*|file):\/(.*\/([^\/]*))/ or next; - -r $2 or return 1; - } - } else { - return 2; - } - return 0; - }; #- the directory given does not exist or may be accessible #- by mounting some other. try to figure out these directory and #- mount everything necessary. $urpm->try_mounting($dir); - while ($check_notfound->()) { + while ($check_notfound->($id, $dir)) { $ask_for_medium or $urpm->{fatal}(4, _("medium \"%s\" is not selected", $medium->{name})); $urpm->try_umounting($dir); system("eject", $device); $ask_for_medium->($medium->{name}, $medium->{removable}) or @@ -1967,6 +1971,12 @@ sub download_source_packages { if (@{$removables{$device}} > 1) { my @sorted_media = sort { values %{$list->[$a]} <=> values %{$list->[$b]} } @{$removables{$device}}; + #- check if a removable device is already mounted (and files present). + if (my ($already_mounted_medium) = grep { !$check_notfound->($_) } @sorted_media) { + @sorted_media = grep { $_ ne $already_mounted_medium } @sorted_media; + unshift @sorted_media, $already_mounted_medium; + } + #- mount all except the biggest one. foreach (@sorted_media[0 .. $#sorted_media-1]) { $examine_removable_medium->($_, $device, 'copy'); @@ -199,12 +199,9 @@ foreach (grep { !$_->{ignore} && (!$update || $_->{update}) } @{$urpm->{media} | $urpm->parse_synthesis($_); } -if (@files) { - #- sanity check of pathname. - m|^/| or $_ = "./$_" foreach @files; - +if (@files || @src_files) { #- build closure with local package and return list of names. - push @names, $urpm->register_local_packages(@files); + push @names, $urpm->register_local_packages(@files, @src_files); } #- relocate depslist. @@ -217,14 +214,14 @@ $urpm->relocate_depslist_provides(); #- make sure basesystem exists before. my %packages; if (@names) { - $urpm->search_packages(\%packages, [ @names], + $urpm->search_packages(\%packages, [ @names ], all => $all, use_provides => $use_provides, fuzzy => $fuzzy) or $force or exit 1; } if (@src_names) { - $urpm->search_packages(\%packages, [ @src_names], + $urpm->search_packages(\%packages, [ @src_names ], all => $all, use_provides => $use_provides, fuzzy => $fuzzy, @@ -339,8 +336,11 @@ my %sources = $urpm->download_source_packages($local_sources, $list, ($X ? '' : }); #- install package. -@rpms_install = grep { $_ !~ /\.src.\.rpm/ } values %{$urpm->extract_packages_to_install(\%sources) || {}}; -@rpms_upgrade = grep { $_ !~ /\.src.\.rpm/ } values %sources; +if ($uid == 0) { + print STDERR "found $_\n" foreach values %sources; + @rpms_install = grep { $_ !~ /\.src\.rpm$/ } values %{$urpm->extract_packages_to_install(\%sources) || {}}; + @rpms_upgrade = grep { $_ !~ /\.src\.rpm$/ } values %sources; +} if (@rpms_install || @rpms_upgrade) { printf SAVEOUT _("installing %s\n", join(' ', @rpms_install, @rpms_upgrade)); @@ -2,7 +2,7 @@ Name: urpmi Version: 3.3 -Release: 11mdk +Release: 12mdk License: GPL Source0: %{name}.tar.bz2 Source1: %{name}.logrotate @@ -144,6 +144,11 @@ fi %changelog +* Wed Feb 20 2002 François Pons <fpons@mandrakesoft.com> 3.3-12mdk +- fixed installing dependancies of given src.rpm filename. +- fixed to keep removable device already mounted before asking + user to change. + * Tue Feb 19 2002 François Pons <fpons@mandrakesoft.com> 3.3-11mdk - fixed obsoletes on direct requires when a sense is given. - added a tracking method in urpm library for allowing upgrade. |