summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm2
-rwxr-xr-xurpmi18
-rw-r--r--urpmi.spec7
-rwxr-xr-xurpmq6
4 files changed, 21 insertions, 12 deletions
diff --git a/urpm.pm b/urpm.pm
index 0494201a..81b529a6 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1497,7 +1497,7 @@ sub parse_synthesis {
sub filter_packages_to_upgrade {
my ($urpm, $packages, $select_choices, %options) = @_;
my ($id, %track, %track_requires, %installed, %selected, %conflicts);
- my ($db, @packages) = (rpmtools::db_open(''), keys %$packages);
+ my ($db, @packages) = (rpmtools::db_open($options{root}), keys %$packages);
my $sig_handler = sub { rpmtools::db_close($db); exit 3 };
local $SIG{INT} = $sig_handler;
local $SIG{QUIT} = $sig_handler;
diff --git a/urpmi b/urpmi
index 533902e7..139c1b06 100755
--- a/urpmi
+++ b/urpmi
@@ -40,6 +40,7 @@ my $fuzzy = 0;
my $src = 0;
my $noclean = 0;
my $verbose = 0;
+my $root = '';
my $uid;
my @files;
@@ -109,6 +110,7 @@ for (@ARGV) {
/^--best-output$/ and do { $X ||= $ENV{DISPLAY} && -x "/usr/X11R6/bin/grpmi" && system('/usr/X11R6/bin/xtest', '') == 0;
next };
/^--comment$/ and do { push @nextargv, undef; next };
+ /^--root$/ and do { push @nextargv, \$root; next };
/^-(.*)$/ and do { foreach (split //, $1) {
/[\?h]/ and do { usage; next };
/a/ and do { $all = 1; next };
@@ -262,14 +264,14 @@ my $ask_choice = sub {
if ($auto_select) {
my (%to_remove, %keep_files);
- $urpm->select_packages_to_upgrade('', \%packages, \%to_remove, \%keep_files, use_parsehdlist => $complete);
+ $urpm->select_packages_to_upgrade($root, \%packages, \%to_remove, \%keep_files, use_parsehdlist => $complete);
#- if (keys(%to_remove) > 0) {
#- print STDERR "some packages have to be removed for being upgraded, this is not supported yet\n";
#- }
}
-$urpm->filter_packages_to_upgrade(\%packages, $ask_choice);
+$urpm->filter_packages_to_upgrade(\%packages, $ask_choice, root => $root);
#- my $track = $urpm->filter_packages_to_upgrade(\%packages, $ask_choice, track => 1);
#- require Data::Dumper;
#- print STDERR Data::Dumper->Dump([$track], ['$track']);
@@ -373,7 +375,7 @@ if (@rpms_install || @rpms_upgrade) {
exit 2;
}
$urpm->{log}("starting installing packages");
- if ($X) {
+ if ($X && !$root) {
system("grpmi", $WID ? ("--WID=$WID") : (),
(map { ("-noupgrade", $_) } @rpms_install), @rpms_upgrade);
if ($?) {
@@ -382,7 +384,7 @@ if (@rpms_install || @rpms_upgrade) {
}
} else {
if (@rpms_install) {
- system("rpm", "-i$rpm_opt", "--nodeps", @rpms_install);
+ system("rpm", "-i$rpm_opt", "--nodeps", @rpms_install, ($root ? ("--root", $root) : ()));
if (@$_) {
message(_("Installation failed"));
@@ -398,11 +400,11 @@ if (@rpms_install || @rpms_upgrade) {
}
$force or <STDIN> =~ /[$yesexpr]/ or exit 1;
$urpm->{log}("starting force installing packages without deps");
- system("rpm", "-i$rpm_opt", "--nodeps", "--force", @rpms_install);
+ system("rpm", "-i$rpm_opt", "--nodeps", "--force", @rpms_install, ($root ? ("--root", $root) : ()));
}
}
if (@rpms_upgrade) {
- system("rpm", "-U$rpm_opt", @rpms_upgrade);
+ system("rpm", "-U$rpm_opt", @rpms_upgrade, ($root ? ("--root", $root) : ()));
if ($?) {
message(_("Installation failed"));
@@ -418,7 +420,7 @@ if (@rpms_install || @rpms_upgrade) {
}
$force or <STDIN> =~ /[$yesexpr]/ or exit 1;
$urpm->{log}("starting installing packages without deps");
- system("rpm", "-U$rpm_opt", "--nodeps", @rpms_upgrade);
+ system("rpm", "-U$rpm_opt", "--nodeps", @rpms_upgrade, ($root ? ("--root", $root) : ()));
if ($?) {
message(_("Installation failed"));
@@ -429,7 +431,7 @@ if (@rpms_install || @rpms_upgrade) {
}
$force or <STDIN> =~ /[$yesexpr]/ or exit 1;
$urpm->{log}("starting force installing packages without deps");
- system("rpm", "-U$rpm_opt", "--nodeps", "--force", @rpms_upgrade);
+ system("rpm", "-U$rpm_opt", "--nodeps", "--force", @rpms_upgrade, ($root ? ("--root", $root) : ()));
}
}
}
diff --git a/urpmi.spec b/urpmi.spec
index 2e7f265a..b4cdded0 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -2,7 +2,7 @@
Name: urpmi
Version: 3.3
-Release: 16mdk
+Release: 17mdk
License: GPL
Source0: %{name}.tar.bz2
Source1: %{name}.logrotate
@@ -144,6 +144,11 @@ fi
%changelog
+* Thu Feb 28 2002 François Pons <fpons@mandrakesoft.com> 3.3-17mdk
+- added (undocumented) --root option to urpmi/urpmq to install in a
+ given root.
+- rebuild with newer po.
+
* Wed Feb 27 2002 François Pons <fpons@mandrakesoft.com> 3.3-16mdk
- fixed possible problem on urpmi update db (perl die workarounded).
diff --git a/urpmq b/urpmq
index c493d06d..94505fc5 100755
--- a/urpmq
+++ b/urpmq
@@ -76,6 +76,7 @@ for (@ARGV) {
/^--headers$/ and do { $query->{headers} = 1; next };
/^--sources$/ and do { $query->{sources} = 1; next };
/^--force$/ and do { $query->{force} = 1; next };
+ /^--root$/ and do { push @nextargv, \$query->{root}; next };
/^-(.*)$/ and do { foreach (split //, $1) {
/[\?h]/ and do { usage; next };
/d/ and do { $query->{deps} = 1; next };
@@ -152,7 +153,7 @@ if (@src_names) {
if ($query->{auto_select}) {
my (%to_remove, %keep_files);
- $urpm->select_packages_to_upgrade('', \%packages, \%to_remove, \%keep_files);
+ $urpm->select_packages_to_upgrade($query->{root}, \%packages, \%to_remove, \%keep_files);
if (keys(%to_remove) > 0) {
$urpm->{error}(_("some packages have to be removed for being upgraded, this is not supported yet\n"));
@@ -161,7 +162,8 @@ if ($query->{auto_select}) {
#- filter to add in packages selected required packages.
$query->{deps} and $urpm->filter_packages_to_upgrade(\%packages, undef,
- keep_alldeps => !$query->{upgrade});
+ keep_alldeps => !$query->{upgrade},
+ root => $query->{root});
#- get out of package that should not be upgraded.
$urpm->deselect_unwanted_packages(\%packages);