summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-10-11 15:49:57 +0000
committerThierry Vignaud <tv@mageia.org>2012-10-11 15:49:57 +0000
commit3c45eb4fc32b4c7c92465b3d1d64aa593af65600 (patch)
tree671a57bbf3f503b2b7a321d5be8f70e1849f420a
parentbf13bd767bcf38fd60ab7fc43420cae35d6b0897 (diff)
downloadurpmi-3c45eb4fc32b4c7c92465b3d1d64aa593af65600.tar
urpmi-3c45eb4fc32b4c7c92465b3d1d64aa593af65600.tar.gz
urpmi-3c45eb4fc32b4c7c92465b3d1d64aa593af65600.tar.bz2
urpmi-3c45eb4fc32b4c7c92465b3d1d64aa593af65600.tar.xz
urpmi-3c45eb4fc32b4c7c92465b3d1d64aa593af65600.zip
(valid_statedir) introduce it
similar to valid_cachedir, so that urpm[fq] --use-distrib works as user
-rw-r--r--urpm.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/urpm.pm b/urpm.pm
index 5ec416a7..8f830013 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -159,6 +159,15 @@ sub userdir_prefix {
my ($_urpm) = @_;
'/tmp/.urpmi-';
}
+
+sub valid_statedir {
+ my ($urpm) = @_;
+ $< or return;
+
+ my $dir = ($urpm->{urpmi_root} || '') . userdir_prefix($urpm) . $< . "/lib";
+ init_dir($urpm, $dir);
+}
+
sub userdir {
#mdkonline uses userdir because it runs as user
my ($urpm) = @_;