summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-29 15:46:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-29 15:46:25 +0000
commit50bfacb9170146abf3c11332cf509734d117a91f (patch)
tree6b07521f180be3ca940fdfa77fb2d5273a3cad19 /urpm
parentdf95f65347ad42a943b273e0bbaaf865826c93cc (diff)
downloadurpmi-50bfacb9170146abf3c11332cf509734d117a91f.tar
urpmi-50bfacb9170146abf3c11332cf509734d117a91f.tar.gz
urpmi-50bfacb9170146abf3c11332cf509734d117a91f.tar.bz2
urpmi-50bfacb9170146abf3c11332cf509734d117a91f.tar.xz
urpmi-50bfacb9170146abf3c11332cf509734d117a91f.zip
directly set $urpm->{root}, it's simpler
(also use it in urpm::get_pkgs::selected2list() even if callers didn't pass it)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/args.pm4
-rw-r--r--urpm/get_pkgs.pm4
-rw-r--r--urpm/media.pm4
-rw-r--r--urpm/select.pm3
4 files changed, 7 insertions, 8 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index b1d10f32..b843735d 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -120,8 +120,8 @@ my %options_spec = (
'skip=s' => \$options{skip},
'root=s' => sub {
require File::Spec;
- $options{root} = File::Spec->rel2abs($_[1]);
- if (!-d $options{root}) {
+ $urpm->{root} = File::Spec->rel2abs($_[1]);
+ if (!-d $urpm->{root}) {
$urpm->{fatal}->(9, N("chroot directory doesn't exist"));
}
$options{nolock} = 1;
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm
index 29a3ce1f..c1c150a6 100644
--- a/urpm/get_pkgs.pm
+++ b/urpm/get_pkgs.pm
@@ -85,7 +85,7 @@ sub selected2list {
} elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) {
my ($fullname) = keys(%{$file2fullnames{$filename} || {}});
if (defined(my $id = $fullname2id{$fullname})) {
- if (!/\.delta\.rpm$/ || $urpm->is_delta_installable($urpm->{depslist}[$id], $options{root})) {
+ if (!/\.delta\.rpm$/ || $urpm->is_delta_installable($urpm->{depslist}[$id], $urpm->{root})) {
$sources{$id} = "$medium->{url}/$filename";
}
}
@@ -118,7 +118,7 @@ sub selected2list {
unless (exists($list_examined{$fullname})) {
++$list_warning;
if (defined(my $id = $fullname2id{$fullname})) {
- if ($fi !~ /\.delta\.rpm$/ || $urpm->is_delta_installable($urpm->{depslist}[$id], $options{root})) {
+ if ($fi !~ /\.delta\.rpm$/ || $urpm->is_delta_installable($urpm->{depslist}[$id], $urpm->{root})) {
$sources{$id} = "$medium->{url}/" . $fi;
}
}
diff --git a/urpm/media.pm b/urpm/media.pm
index 217b6cd3..d2134128 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -442,7 +442,7 @@ sub write_config {
#- read urpmi.cfg file as well as necessary synthesis files
#- options :
-#- root
+#- root (deprecated, set directly $urpm->{root})
#- cmdline_skiplist
#- nocheck_access (used by read_config)
#-
@@ -479,7 +479,7 @@ sub configure {
}
} else {
#- nb: can't have both parallel and root
- $urpm->{root} = $options{root};
+ $urpm->{root} = $options{root} if $options{root};
}
$urpm->{root} && ! -c "$urpm->{root}/dev/null"
diff --git a/urpm/select.pm b/urpm/select.pm
index fa018352..658c80ec 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -235,7 +235,6 @@ sub resolve_dependencies {
#- callback_notfound
#- force
#- matches
-#- root
#- test
sub find_packages_to_remove {
my ($urpm, $state, $l, %options) = @_;
@@ -244,7 +243,7 @@ sub find_packages_to_remove {
#- invoke parallel finder.
$urpm->{parallel_handler}->parallel_find_remove($urpm, $state, $l, %options, find_packages_to_remove => 1);
} else {
- my $db = urpm::db_open_or_die($urpm, $options{root});
+ my $db = urpm::db_open_or_die($urpm, $urpm->{root});
my (@m, @notfound);
if (!$options{matches}) {