summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-10-27 11:38:11 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-10-27 11:38:11 +0000
commitb494812daced7acbb49aaf27671cde8a4f055b7e (patch)
treec8be06534263a1f3d99723ba7a2dd836caa3d173 /urpm.pm
parent58ee3cbcf2b07a7538b3265605d1effa6823d9da (diff)
downloadurpmi-b494812daced7acbb49aaf27671cde8a4f055b7e.tar
urpmi-b494812daced7acbb49aaf27671cde8a4f055b7e.tar.gz
urpmi-b494812daced7acbb49aaf27671cde8a4f055b7e.tar.bz2
urpmi-b494812daced7acbb49aaf27671cde8a4f055b7e.tar.xz
urpmi-b494812daced7acbb49aaf27671cde8a4f055b7e.zip
simplify: instead of passing around {rpmdb}, set $urpm->{env_rpmdb} and use it
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm12
1 files changed, 4 insertions, 8 deletions
diff --git a/urpm.pm b/urpm.pm
index 5e8b48cb..93d0c992 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -151,6 +151,7 @@ sub set_env {
$urpm->{prefer_list} = "$env/prefer.list";
$urpm->{prefer_vendor_list} = "$env/prefer.vendor.list";
$urpm->{statedir} = $env;
+ $urpm->{env_rpmdb} = "$env/rpmdb.cz";
}
sub set_files {
@@ -280,17 +281,12 @@ sub is_cdrom_url {
sub db_open_or_die_ {
my ($urpm, $b_write_perm) = @_;
- db_open_or_die($urpm, $urpm->{root}, $b_write_perm);
-}
-
-sub db_open_or_die__ {
- my ($urpm, $o_rpmdb) = @_;
my $db;
- if ($o_rpmdb) {
+ if ($urpm->{env_rpmdb}) {
$db = new URPM;
- $db->parse_synthesis($o_rpmdb);
+ $db->parse_synthesis($urpm->{env_rpmdb});
} else {
- $db = urpm::db_open_or_die_($urpm);
+ $db = db_open_or_die($urpm, $urpm->{root}, $b_write_perm);
}
$db;
}