aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--Rpmdrake/open_db.pm9
2 files changed, 10 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index ee3983e5..37dca76c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- fix opening the right RPM DB with --env
+
Version 4.18.1 - 9 September 2008, Thierry Vignaud
- rpmdrake:
diff --git a/Rpmdrake/open_db.pm b/Rpmdrake/open_db.pm
index 7b6cd896..70c5d2df 100644
--- a/Rpmdrake/open_db.pm
+++ b/Rpmdrake/open_db.pm
@@ -54,7 +54,14 @@ sub open_rpm_db {
}
URPM::DB::open($dblocation) or die "Couldn't open RPM DB";
} else {
- URPM::DB::open($::rpmdrake_options{'rpm-root'}[0]) or die "Couldn't open RPM DB ($::rpmdrake_options{'rpm-root'}[0])";
+ my $db;
+ if ($::env) {
+ $db = new URPM;
+ $db->parse_synthesis("$::env/rpmdb.cz");
+ } else {
+ $db = URPM::DB::open($::env || $::rpmdrake_options{'rpm-root'}[0]);
+ }
+ $db or die "Couldn't open RPM DB (" . ($::env ? "$::env/rpmdb.cz" : $::rpmdrake_options{'rpm-root'}[0]) . ")";
}
}