summaryrefslogtreecommitdiffstats
path: root/perl-install/fs/remote/davfs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-23 19:50:35 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-23 19:50:35 +0000
commitf4bc86bc94aeeeffb8a82b16b38b760590b80bdf (patch)
treeb5a904657487cd5dfec16ca195ee72b9098a086f /perl-install/fs/remote/davfs.pm
parentcb09d79bc963f95780d214aa12e695d8f9e338e2 (diff)
downloaddrakx-f4bc86bc94aeeeffb8a82b16b38b760590b80bdf.tar
drakx-f4bc86bc94aeeeffb8a82b16b38b760590b80bdf.tar.gz
drakx-f4bc86bc94aeeeffb8a82b16b38b760590b80bdf.tar.bz2
drakx-f4bc86bc94aeeeffb8a82b16b38b760590b80bdf.tar.xz
drakx-f4bc86bc94aeeeffb8a82b16b38b760590b80bdf.zip
perl_checker cleanups
Diffstat (limited to 'perl-install/fs/remote/davfs.pm')
-rw-r--r--perl-install/fs/remote/davfs.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/perl-install/fs/remote/davfs.pm b/perl-install/fs/remote/davfs.pm
index 5df0fe771..6c31b9ea6 100644
--- a/perl-install/fs/remote/davfs.pm
+++ b/perl-install/fs/remote/davfs.pm
@@ -6,7 +6,7 @@ use diagnostics;
use common;
use fs::mount_options;
-sub secrets_file { "$::prefix/etc/davfs2/secrets" }
+sub secrets_file() { "$::prefix/etc/davfs2/secrets" }
sub fstab_entry_to_credentials {
my ($part) = @_;
@@ -14,7 +14,7 @@ sub fstab_entry_to_credentials {
my ($options, $unknown) = fs::mount_options::unpack($part);
my %h = map { $_ => delete $options->{"$_="} } qw(username password);
foreach (qw(username password)) {
- $h{$_} = 'nobody' if !$h{$_};
+ $h{$_} ||= 'nobody';
}
$h{mntpoint} = $part->{mntpoint} or return;
fs::mount_options::pack_($part, $options, $unknown), \%h;
@@ -45,7 +45,7 @@ sub mountpoint_credentials_save {
}
-sub read_credentials_raw {
+sub read_credentials_raw() {
from_double_quoted(cat_(secrets_file()));
}
@@ -66,12 +66,12 @@ sub from_double_quoted {
my ($file) = @_;
my @l;
my @lines = split("\n",$file);
- foreach (@lines){
+ foreach (@lines) {
my ($mnt, $user, $pass, $comment);
if (/^\s*(#.*)?$/) {
$comment = $1;
} else {
- if(/^(?:"((?:\\.|[^"])*)"|((?:\\.|[^"\s#])+))\s+(?:"((?:\\.|[^"])*)"|((?:\\.|[^"\s#])+))(?:\s+(?:"((?:\\.|[^"])*)"|((?:\\.|[^"\s#])+)))?(?:\s*|\s*(#.*))?$/) {
+ if (/^(?:"((?:\\.|[^"])*)"|((?:\\.|[^"\s#])+))\s+(?:"((?:\\.|[^"])*)"|((?:\\.|[^"\s#])+))(?:\s+(?:"((?:\\.|[^"])*)"|((?:\\.|[^"\s#])+)))?(?:\s*|\s*(#.*))?$/) {
$mnt = "$1$2";
$mnt =~ s/\\(.)/$1/g;
$user = "$3$4";
@@ -83,7 +83,7 @@ sub from_double_quoted {
die "bad entry $_";
}
}
- push @l, {'mntpoint'=>$mnt, 'username'=>$user, 'password'=>$pass, 'comment'=>$comment};
+ push @l, { 'mntpoint' => $mnt, 'username' => $user, 'password' => $pass, 'comment' => $comment };
}
@l;
}