diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-09-10 09:44:48 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-09-10 09:44:48 +0000 |
commit | 185d51d277a0b6f66cfd6beb8ccf8c6fe5d823dd (patch) | |
tree | 2a553c36b7f680a6c8b6eab897d42f335c1def50 /Rpmdrake | |
parent | 2e320d9bf7011e09d12817008ccba1992f315c6d (diff) | |
download | rpmdrake-185d51d277a0b6f66cfd6beb8ccf8c6fe5d823dd.tar rpmdrake-185d51d277a0b6f66cfd6beb8ccf8c6fe5d823dd.tar.gz rpmdrake-185d51d277a0b6f66cfd6beb8ccf8c6fe5d823dd.tar.bz2 rpmdrake-185d51d277a0b6f66cfd6beb8ccf8c6fe5d823dd.tar.xz rpmdrake-185d51d277a0b6f66cfd6beb8ccf8c6fe5d823dd.zip |
(fast_open_urpmi_db) fix opening the right RPM DB with --env
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/open_db.pm | 9 |
1 files changed, 8 insertions, 1 deletions
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]) . ")"; } } |