summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/sys.pm28
1 files changed, 17 insertions, 11 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm
index 295321bc..b6ef73be 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -71,23 +71,29 @@ sub find_mntpoints {
#- for simplification we refuse also any other device and stop here.
last;
} elsif (-l $pdir) {
- while (my $v = readlink $pdir) {
- if ($pdir =~ m|^/|) {
- $pdir = $v;
- } else {
- while ($v =~ s!^\.\./!!) {
- $pdir =~ s!/[^/]+/*$!!;
- }
- $pdir .= "/$v";
- }
- }
- unshift @paths, split '/', $pdir;
+ unshift @paths, split '/', _expand_symlink($pdir);
$pdir = '';
}
}
@mntpoints;
}
+sub _expand_symlink {
+ my ($pdir) = @_;
+
+ while (my $v = readlink $pdir) {
+ if ($pdir =~ m|^/|) {
+ $pdir = $v;
+ } else {
+ while ($v =~ s!^\.\./!!) {
+ $pdir =~ s!/[^/]+/*$!!;
+ }
+ $pdir .= "/$v";
+ }
+ }
+ $pdir;
+}
+
sub clean_rpmdb_shared_regions {
my ($prefix) = @_;
unlink glob("$prefix/var/lib/rpm/__db.*");