summaryrefslogtreecommitdiffstats
path: root/urpm/sys.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-26 22:15:01 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-26 22:15:01 +0000
commitc44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec (patch)
treeb2da6dc7c776492676551c367356dd18b2a3afdc /urpm/sys.pm
parent35ed07395593b5e85aaa16289218d09df1af868d (diff)
downloadurpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.tar
urpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.tar.gz
urpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.tar.bz2
urpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.tar.xz
urpmi-c44f8c40c4a6ff9bf60ed7b54e88244a79ba2cec.zip
- since find_mntpoints doesn't really return a list, make it clear
- return a struct instead of using %info + returned value
Diffstat (limited to 'urpm/sys.pm')
-rw-r--r--urpm/sys.pm21
1 files changed, 18 insertions, 3 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm
index 4dc160c1..d4484458 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -39,9 +39,24 @@ sub _read_fstab_or_mtab {
@l;
}
-#- find used mount point from a pathname
+sub find_a_mntpoint {
+ my ($dir) = @_;
+ _find_a_mntpoint($dir, {});
+}
+
+# deprecated
sub find_mntpoints {
my ($dir, $infos) = @_;
+ if (my $entry = _find_a_mntpoint($dir, $infos)) {
+ $entry->{mntpoint};
+ } else {
+ ();
+ }
+}
+
+#- find used mount point from a pathname
+sub _find_a_mntpoint {
+ my ($dir, $infos) = @_;
#- read /etc/fstab and check for existing mount point.
foreach (_read_fstab_or_mtab("/etc/fstab")) {
@@ -66,13 +81,13 @@ sub find_mntpoints {
#- will go outside the device itself (or at least will go into
#- regular already mounted device like /).
#- for simplification we refuse also any other device and stop here.
- return $pdir;
+ return $infos->{$pdir};
} elsif (-l $pdir) {
unshift @paths, split '/', _expand_symlink($pdir);
$pdir = '';
}
}
- ();
+ undef;
}
sub _expand_symlink {