diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-10-27 11:38:11 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-10-27 11:38:11 +0000 |
commit | b494812daced7acbb49aaf27671cde8a4f055b7e (patch) | |
tree | c8be06534263a1f3d99723ba7a2dd836caa3d173 /urpm.pm | |
parent | 58ee3cbcf2b07a7538b3265605d1effa6823d9da (diff) | |
download | urpmi-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.pm | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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; } |