summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-09-09 22:27:29 +0000
committerThierry Vignaud <tv@mandriva.org>2008-09-09 22:27:29 +0000
commit7a62087448c9a58ec1b9afe15977a24b55646f77 (patch)
tree5a3d6d765d3fe43aa1867f1786b6ff9a8cae5712 /urpm.pm
parent9f24337bca08689c3f9544271852ae8b1ae9fd8c (diff)
downloadurpmi-7a62087448c9a58ec1b9afe15977a24b55646f77.tar
urpmi-7a62087448c9a58ec1b9afe15977a24b55646f77.tar.gz
urpmi-7a62087448c9a58ec1b9afe15977a24b55646f77.tar.bz2
urpmi-7a62087448c9a58ec1b9afe15977a24b55646f77.tar.xz
urpmi-7a62087448c9a58ec1b9afe15977a24b55646f77.zip
(db_open_or_die__) factorize some code (the name might have to be changed...)
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/urpm.pm b/urpm.pm
index 49086c44..2ca2b95e 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -282,6 +282,16 @@ sub db_open_or_die_ {
db_open_or_die($urpm, $urpm->{root}, $b_write_perm);
}
+sub db_open_or_die__ {
+ if ($options{rpmdb}) {
+ $db = new URPM;
+ $db->parse_synthesis($options{rpmdb});
+ } else {
+ $db = urpm::db_open_or_die_($urpm);
+ }
+ $db;
+}
+
# please use higher level function db_open_or_die_()
sub db_open_or_die {
my ($urpm, $root, $b_write_perm) = @_;