summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-08-29 14:27:00 +0000
committerThierry Vignaud <tv@mandriva.org>2007-08-29 14:27:00 +0000
commit4e2e33173417b3dc03aefd090be77a155f293109 (patch)
treec1d7376d01a62f5c7f7217f8a18b474f3cf38daa /urpm.pm
parent1ce5a8fb021c895ac2e86c45765b7efdc5faad27 (diff)
downloadurpmi-4e2e33173417b3dc03aefd090be77a155f293109.tar
urpmi-4e2e33173417b3dc03aefd090be77a155f293109.tar.gz
urpmi-4e2e33173417b3dc03aefd090be77a155f293109.tar.bz2
urpmi-4e2e33173417b3dc03aefd090be77a155f293109.tar.xz
urpmi-4e2e33173417b3dc03aefd090be77a155f293109.zip
(create_var_lib_rpm) split it out of set_files()
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/urpm.pm b/urpm.pm
index 05442942..547b299e 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -73,18 +73,22 @@ sub set_files {
);
$urpm->{$_} = $h{$_} foreach keys %h;
+ create_var_lib_rpm($urpm, $urpmi_root, %h);
+
+ # policy is too use chroot environment only for --urpmi-root, not for --root:
+ if ($urpmi_root && -e "$urpmi_root/etc/rpm/macros") {
+ URPM::loadmacrosfile("$urpmi_root/etc/rpm/macros");
+ }
+}
+
+sub create_var_lib_rpm {
+ my ($urpm, $urpmi_root, %h) = @_;
require File::Path;
File::Path::mkpath([ $h{statedir},
(map { "$h{cachedir}/$_" } qw(headers partial rpms)),
dirname($h{config}),
"$urpmi_root/var/lib/rpm",
]);
-
- # policy is too use chroot environment only for --urpmi-root, not for --root:
- if ($urpmi_root && -e "$urpmi_root/etc/rpm/macros") {
- URPM::loadmacrosfile("$urpmi_root/etc/rpm/macros");
- }
-
}
sub protocol_from_url {