summaryrefslogtreecommitdiffstats
path: root/perl-install/fs
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
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')
-rw-r--r--perl-install/fs/any.pm4
-rw-r--r--perl-install/fs/dmcrypt.pm4
-rw-r--r--perl-install/fs/dmraid.pm6
-rw-r--r--perl-install/fs/format.pm4
-rw-r--r--perl-install/fs/mount_options.pm2
-rw-r--r--perl-install/fs/mount_point.pm2
-rw-r--r--perl-install/fs/partitioning_wizard.pm6
-rw-r--r--perl-install/fs/remote/davfs.pm12
-rw-r--r--perl-install/fs/type.pm4
-rw-r--r--perl-install/fs/wild_device.pm4
10 files changed, 24 insertions, 24 deletions
diff --git a/perl-install/fs/any.pm b/perl-install/fs/any.pm
index 65ca02403..c84dc6a38 100644
--- a/perl-install/fs/any.pm
+++ b/perl-install/fs/any.pm
@@ -89,7 +89,7 @@ sub create_minimal_files() {
}
sub prepare_minimal_root {
- my ($all_hds) = @_;
+ my ($_all_hds) = @_;
fs::any::create_minimal_files();
@@ -98,7 +98,7 @@ sub prepare_minimal_root {
eval { fs::mount::usbfs($::prefix) };
# copy all needed devices, for bootloader install and mkinitrd
- cp_af("/dev", "$::prefix");
+ cp_af('/dev', $::prefix);
}
sub getAvailableSpace {
diff --git a/perl-install/fs/dmcrypt.pm b/perl-install/fs/dmcrypt.pm
index a226bcbc7..ae0f71714 100644
--- a/perl-install/fs/dmcrypt.pm
+++ b/perl-install/fs/dmcrypt.pm
@@ -16,7 +16,7 @@ sub _crypttab() { "$::prefix/etc/crypttab" }
sub init() {
whereis_binary('cryptsetup') or die "cryptsetup not installed";
- eval { modules::load('dm-crypt', 'xts', 'cbc', 'sha256_generic', if_(arch() =~ /i.86/, 'aes-i586'), if_( arch() =~ /x86_64/, 'aes-x86_64'), 'aes_generic') };
+ eval { modules::load('dm-crypt', 'xts', 'cbc', 'sha256_generic', if_(arch() =~ /i.86/, 'aes-i586'), if_(arch() =~ /x86_64/, 'aes-x86_64'), 'aes_generic') };
devices::init_device_mapper();
1;
}
@@ -67,7 +67,7 @@ sub format_part {
common::with_private_tmp_file($tmp_key_file, $part->{dmcrypt_key}, sub {
_run_or_die('--cipher=aes-xts-benbi', '--key-size=512', 'luksFormat', '--batch-mode', devices::make($part->{device}), $_[0]);
});
- fs::format::after_formatting($part, 1);
+ fs::format::after_formatting($part);
}
sub open_part {
diff --git a/perl-install/fs/dmraid.pm b/perl-install/fs/dmraid.pm
index a744f01af..80ba3de39 100644
--- a/perl-install/fs/dmraid.pm
+++ b/perl-install/fs/dmraid.pm
@@ -47,16 +47,16 @@ sub _raid_devices_raw() {
log::l("got: $_");
my %l; @l{qw(name size stride level status subsets devs spares)} = split(':');
$vgs{$l{name}} = 1 if defined $l{spares};
- if(/freeing device "(.*)", path "(.*)"/ && defined $vgs{$1}) {
+ if (/freeing device "(.*)", path "(.*)"/ && defined $vgs{$1}) {
log::l("$2 => $1");
- { $2 => $1 };
+ { $2 => $1 }
}
} call_dmraid('-d', '-s', '-c', '-c');
map {
chomp;
log::l("got: $_");
my %l; @l{qw(pv format vg level status size)} = split(':');
- if(defined $l{size} && defined $l{vg} && defined $pv2vg{$l{pv}} && !defined $vgs{$l{vg}}) {
+ if (defined $l{size} && defined $l{vg} && defined $pv2vg{$l{pv}} && !defined $vgs{$l{vg}}) {
log::l("using $pv2vg{$l{pv}} instead of $l{vg}");
$l{vg} = $pv2vg{$l{pv}};
}
diff --git a/perl-install/fs/format.pm b/perl-install/fs/format.pm
index de444c694..6e4568da7 100644
--- a/perl-install/fs/format.pm
+++ b/perl-install/fs/format.pm
@@ -196,7 +196,7 @@ sub part_raw {
delete $part->{device_LABEL_changed};
# Preserve UUID on fs where we couldn't enforce it while formatting
- my ($_pkg, $cmd) = @{$preserve_UUID{$fs_type}};
+ (undef, $cmd) = @{$preserve_UUID{$fs_type}};
run_program::raw($cmd, '-U', devices::make($dev)) if $cmd;
if (member($fs_type, qw(ext3 ext4))) {
@@ -241,7 +241,7 @@ sub clean_label {
if ($part->{device_LABEL}) {
my $fs_type = $part->{fs_type};
if ($LABELs{$fs_type}) {
- my ($option, $length, $handled_by_mount) = @{$LABELs{$fs_type}};
+ my ($_option, $length, $handled_by_mount) = @{$LABELs{$fs_type}};
if (length $part->{device_LABEL} > $length) {
my $short = substr($part->{device_LABEL}, 0, $length);
log::l("shortening LABEL $part->{device_LABEL} to $short");
diff --git a/perl-install/fs/mount_options.pm b/perl-install/fs/mount_options.pm
index bae101679..29c09ae79 100644
--- a/perl-install/fs/mount_options.pm
+++ b/perl-install/fs/mount_options.pm
@@ -207,7 +207,7 @@ sub set_default {
#- filesystem (e.g, for faster access on the
#- news spool to speed up news servers).
$options->{relatime} = $options->{noatime} = 0;
- $options->{detect_devices::isLaptop() ? 'noatime': 'relatime'} = 1 if !$opts{force_atime};
+ $options->{ detect_devices::isLaptop() ? 'noatime' : 'relatime' } = 1 if !$opts{force_atime};
}
if ($part->{fs_type} eq 'nfs') {
put_in_hash($options, {
diff --git a/perl-install/fs/mount_point.pm b/perl-install/fs/mount_point.pm
index 8dc4521ae..282b28ab6 100644
--- a/perl-install/fs/mount_point.pm
+++ b/perl-install/fs/mount_point.pm
@@ -49,7 +49,7 @@ sub suggest_mount_points {
sub suggest_mount_points_always {
my ($fstab) = @_;
- my @win = grep { isFat_or_NTFS($_) && !$_->{isMounted} && maybeFormatted($_) && !$_->{is_removable} && $_->{pt_type} != 0x12 && !isRecovery($_)} @$fstab;
+ my @win = grep { isFat_or_NTFS($_) && !$_->{isMounted} && maybeFormatted($_) && !$_->{is_removable} && $_->{pt_type} != 0x12 && !isRecovery($_) } @$fstab;
log::l("win parts: ", join ",", map { $_->{device} } @win) if @win;
if (@win == 1) {
#- Suggest /boot/efi on ia64.
diff --git a/perl-install/fs/partitioning_wizard.pm b/perl-install/fs/partitioning_wizard.pm
index 97e7472f5..a275d2774 100644
--- a/perl-install/fs/partitioning_wizard.pm
+++ b/perl-install/fs/partitioning_wizard.pm
@@ -30,7 +30,7 @@ sub to_Mb {
}
sub partition_with_diskdrake {
- my ($in, $all_hds, $fstab, $manual_fstab, $partitions, $partitioning_flags, $skip_mtab) = @_;
+ my ($in, $all_hds, $fstab, $manual_fstab, $_partitions, $partitioning_flags, $skip_mtab) = @_;
my $ok;
do {
@@ -48,7 +48,7 @@ sub partition_with_diskdrake {
}
my @fstab = fs::get::fstab($all_hds);
- unless ($root = fs::get::root_(\@fstab)) {
+ unless (fs::get::root_(\@fstab)) {
$ok = 0;
$in->ask_okcancel(N("Partitioning"), N("You must have a root partition.
To accomplish this, create a partition (or click on an existing one).
@@ -501,7 +501,7 @@ sub main {
my $mainbox = Gtk2::VBox->new;
- my @kinds = map { diskdrake::hd_gtk::hd2kind($_) } sort { $a->{is_removable} <=> $b->{is_removable} } @{$all_hds->{hds} };
+ my @kinds = map { diskdrake::hd_gtk::hd2kind($_) } sort { $a->{is_removable} <=> $b->{is_removable} } @{ $all_hds->{hds} };
push @kinds, map { diskdrake::hd_gtk::raid2kind($_) } @{$all_hds->{raids}};
push @kinds, map { diskdrake::hd_gtk::lvm2kind($_) } @{$all_hds->{lvms}};
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;
}
diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm
index 12db643bc..74c4a5a0b 100644
--- a/perl-install/fs/type.pm
+++ b/perl-install/fs/type.pm
@@ -310,7 +310,7 @@ sub type_subpart_from_magic {
$p;
}
-sub defaultFS { 'ext4' }
+sub defaultFS() { 'ext4' }
sub true_local_fs_types() { qw(btrfs ext3 ext2 ext4 reiserfs reiser4 xfs jfs) }
@@ -332,7 +332,7 @@ sub isRecovery {
# Extracted from /usr/share/hal/fdi/policy/10osvendor/20-storage-methods.fdi
# Hopefuly we'll ask to hal/udev someday
'RECOVERY', 'PQSERVICE', 'HP_RECOVERY', 'Recovery Partition', 'DellUtility', 'DellRestore', 'IBM_SERVICE', 'SERVICEV001', 'SERVICEV002')
- )
+ );
}
sub isTrueFS { isTrueLocalFS($_[0]) || member($_[0]{fs_type}, qw(nfs)) }
diff --git a/perl-install/fs/wild_device.pm b/perl-install/fs/wild_device.pm
index efb48d9d7..a1bf98c50 100644
--- a/perl-install/fs/wild_device.pm
+++ b/perl-install/fs/wild_device.pm
@@ -2,7 +2,7 @@ package fs::wild_device; # $Id: wild_device.pm 268572 2010-05-11 16:42:46Z pterj
use diagnostics;
use strict;
-
+use devices;
use common;
@@ -44,7 +44,7 @@ sub to_subpart {
($part{major}, $part{minor}) = unmakedev($rdev);
}
- my $symlink = readlink("$::prefix$dev") unless $dev =~ m!mapper/!;
+ my $symlink = $dev =~ m!mapper/! ? readlink("$::prefix$dev") : undef;
$dev =~ s!/u?dev/!!;
if ($symlink && $symlink !~ m!^/!) {