aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/pkg.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-08-13 09:11:32 +0000
committerThierry Vignaud <tv@mandriva.org>2007-08-13 09:11:32 +0000
commitb0750a5c41d051fed7f72b9db360dc57077eccac (patch)
treeb94cb56e161f6f08cacb52182fd720e6fce99bd0 /Rpmdrake/pkg.pm
parentbf342372f4ae607691b6ae7c72db444a617ca775 (diff)
downloadrpmdrake-b0750a5c41d051fed7f72b9db360dc57077eccac.tar
rpmdrake-b0750a5c41d051fed7f72b9db360dc57077eccac.tar.gz
rpmdrake-b0750a5c41d051fed7f72b9db360dc57077eccac.tar.bz2
rpmdrake-b0750a5c41d051fed7f72b9db360dc57077eccac.tar.xz
rpmdrake-b0750a5c41d051fed7f72b9db360dc57077eccac.zip
(open_urpmi_db,open_urpmi_db) add support for --rpm-root and --urpmi-root
(equivalent to urpmi --root and --urpmi-root options) Rationale: --root option is already defined for another purpose by rpmdrake
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rwxr-xr-xRpmdrake/pkg.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 5cfa59eb..709fafba 100755
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -35,12 +35,14 @@ use Rpmdrake::formatting;
use Rpmdrake::rpmnew;
use rpmdrake;
+use urpm;
use urpm::lock;
use urpm::install;
use urpm::signature;
use urpm::get_pkgs;
use urpm::select;
use urpm::main_loop;
+use urpm::args qw();
use Exporter;
@@ -156,7 +158,7 @@ sub open_rpm_db {
}
URPM::DB::open($dblocation) or die "Couldn't open RPM DB";
} else {
- URPM::DB::open or die "Couldn't open RPM DB";
+ URPM::DB::open($::options{'rpm-root'}->[0]) or die "Couldn't open RPM DB ($::options{'rpm-root'}->[0])";
}
}
@@ -232,6 +234,8 @@ sub open_urpmi_db() {
$urpm->{options}{'allow-nodeps'} = 1;
$urpm->{options}{'no-verify-rpm'} = $::options{'no-verify-rpm'};
$urpm->{options}{auto} = $::options{'auto'};
+ urpm::set_files($urpm, $::options{'urpmi-root'}->[0]) if $::options{'urpmi-root'}->[0];
+ urpm::args::set_root($urpm, $::options{'rpm-root'}->[0]) if $::options{'rpm-root'}->[0];
$urpm->{fatal} = sub {
$error_happened = 1;