aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xRpmdrake/init.pm2
-rwxr-xr-xRpmdrake/pkg.pm6
2 files changed, 7 insertions, 1 deletions
diff --git a/Rpmdrake/init.pm b/Rpmdrake/init.pm
index 4db876e5..5f45502b 100755
--- a/Rpmdrake/init.pm
+++ b/Rpmdrake/init.pm
@@ -48,6 +48,8 @@ N(" --no-verify-rpm don't verify packages signatures"),
N(" --parallel=alias,host be in parallel mode, use \"alias\" group, use \"host\" machine to show needed deps"),
N(" --pkg-nosel=pkg1,.. show only these packages"),
N(" --pkg-sel=pkg1,.. preselect these packages"),
+N(" --rpm-root use another root for rpm installation"),
+N(" --urpmi-root use another root for urpmi db & rpm installation"),
N(" --root force to run as root"),
N(" --search=pkg run search for \"pkg\""),
chomp_(N(" --version - print this tool's version number.
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;