summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-11-03 12:53:38 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-11-03 12:53:38 +0000
commite1d535c87f59dd6afef003fdd7b2e2ae98849476 (patch)
tree317f4760abb73d2f0cc6ba2d1976f97792316432
parent030f63c4a6aaa1bef66522d62a2123d5a2253a8b (diff)
downloadurpmi-e1d535c87f59dd6afef003fdd7b2e2ae98849476.tar
urpmi-e1d535c87f59dd6afef003fdd7b2e2ae98849476.tar.gz
urpmi-e1d535c87f59dd6afef003fdd7b2e2ae98849476.tar.bz2
urpmi-e1d535c87f59dd6afef003fdd7b2e2ae98849476.tar.xz
urpmi-e1d535c87f59dd6afef003fdd7b2e2ae98849476.zip
Don't use MDK::Common
-rw-r--r--urpm.pm25
1 files changed, 20 insertions, 5 deletions
diff --git a/urpm.pm b/urpm.pm
index ce465a71..7ab86565 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -4,7 +4,6 @@ package urpm;
no warnings 'utf8';
use strict;
-use MDK::Common;
use File::Find ();
use urpm::msg;
use urpm::download;
@@ -92,7 +91,7 @@ sub sync_webfetch {
!$option_downloader && exists $urpm->{global_config}{downloader}
and $option_downloader = $urpm->{global_config}{downloader};
if ($option_downloader) {
- $preferred = find { $_ eq $option_downloader } @available_webfetch;
+ ($preferred) = grep { $_ eq $option_downloader } @available_webfetch;
}
#- else first downloader of @webfetch is the default one
$preferred ||= $available_webfetch[0];
@@ -2459,7 +2458,8 @@ sub get_source_packages {
#- clean download directory, do it here even if this is not the best moment.
if ($options{clean_all}) {
- MDK::Common::rm_rf("$urpm->{cachedir}/partial");
+ require File::Path;
+ File::Path::rmtree(["$urpm->{cachedir}/partial"]);
mkdir "$urpm->{cachedir}/partial";
}
@@ -3062,7 +3062,11 @@ sub install {
if (@readmes) {
foreach (@readmes) {
print "-" x 70, "\n", N("More information on package %s", $_->[1]), "\n";
- print cat_($_->[0]), "-" x 70, "\n";
+ my $fh; open $fh, '<', $_->[0] and do {
+ print while <$fh>;
+ close $fh;
+ };
+ print "-" x 70, "\n";
}
}
return @l;
@@ -3219,6 +3223,8 @@ sub unselected_packages {
grep { $state->{rejected}{$_}{backtrack} } keys %{$state->{rejected} || {}};
}
+sub uniq { my %l; $l{$_} = 1 foreach @_; grep { delete $l{$_} } @_ }
+
sub translate_why_unselected {
my (undef, $state, @l) = @_;
@@ -3331,6 +3337,15 @@ sub check_sources_signatures {
sort keys %invalid_sources;
}
+sub dump_description_file {
+ my ($urpm, $media_name) = @_;
+ open my $fh, '<', "$urpm->{statedir}/descriptions.$media_name"
+ or return ();
+ my @slurp = <$fh>;
+ close $fh;
+ return @slurp;
+}
+
#- get reason of update for packages to be updated
#- use all update medias if none given
sub get_updates_description {
@@ -3340,7 +3355,7 @@ sub get_updates_description {
@update_medias or @update_medias = grep { !$_->{ignore} && $_->{update} } @{$urpm->{media}};
- foreach (map { cat_("$urpm->{statedir}/descriptions.$_->{name}"), '%package dummy' } @update_medias) {
+ foreach (map { $urpm->dump_description_file($_->{name}), '%package dummy' } @update_medias) {
/^%package (.+)/ and do {
exists $cur->{importance} && !member($cur->{importance}, qw(security bugfix)) and $cur->{importance} = 'normal';
$update_descr{$_} = $cur foreach @{$cur->{pkgs}};