summaryrefslogtreecommitdiffstats
path: root/lib/MDV/Draklive
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-05-22 22:13:46 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-05-22 22:17:10 +0200
commit786171ebb7723a74b841f7c1c1457bd825783a16 (patch)
tree459ba49d5b26ecfe2d63a19eefeaee2fadb9bba7 /lib/MDV/Draklive
parent3f5f93364ec62e6384780d993d7ae24f27a43bda (diff)
downloaddrakiso-786171ebb7723a74b841f7c1c1457bd825783a16.tar
drakiso-786171ebb7723a74b841f7c1c1457bd825783a16.tar.gz
drakiso-786171ebb7723a74b841f7c1c1457bd825783a16.tar.bz2
drakiso-786171ebb7723a74b841f7c1c1457bd825783a16.tar.xz
drakiso-786171ebb7723a74b841f7c1c1457bd825783a16.zip
perl_checker cleanups
Diffstat (limited to 'lib/MDV/Draklive')
-rw-r--r--lib/MDV/Draklive/Live.pm2
-rw-r--r--lib/MDV/Draklive/Loopback.pm3
-rw-r--r--lib/MDV/Draklive/Media.pm2
-rw-r--r--lib/MDV/Draklive/Mounts.pm20
-rw-r--r--lib/MDV/Draklive/Utils.pm4
5 files changed, 15 insertions, 16 deletions
diff --git a/lib/MDV/Draklive/Live.pm b/lib/MDV/Draklive/Live.pm
index 9603879..545c96c 100644
--- a/lib/MDV/Draklive/Live.pm
+++ b/lib/MDV/Draklive/Live.pm
@@ -49,7 +49,7 @@ sub find_kernel {
sub get_initrd_name {
my ($live) = @_;
- 'initrd-'. $live->find_kernel->{version} . '.img';
+ 'initrd-' . $live->find_kernel->{version} . '.img';
}
sub get_lib_prefix {
diff --git a/lib/MDV/Draklive/Loopback.pm b/lib/MDV/Draklive/Loopback.pm
index 0032e6e..258f70e 100644
--- a/lib/MDV/Draklive/Loopback.pm
+++ b/lib/MDV/Draklive/Loopback.pm
@@ -117,7 +117,7 @@ our %loop_types;
mount => sub {
my ($live, $dir) = @_;
my $mnt = $live->{prefix}{live}{mnt} . $dir->{mountpoint};
- my $mount_opts = $dir->{mount_opts}?"-o $dir->{mount_opts}":"";
+ my $mount_opts = $dir->{mount_opts} ? "-o $dir->{mount_opts}" : "";
my $cmd = "mount -t tmpfs $mount_opts $mnt $mnt";
$dir->{fallback} ? qq(sh -c 'if ! grep -q " $mnt " /proc/mounts; then $cmd; fi') : $cmd;
},
@@ -135,7 +135,6 @@ sub get_loop_modules {
sub has_squashfs4_with {
my ($live, $comp) = @_;
- my $kernel = $live->find_kernel;
my $ucomp = uc($comp);
cat_($live->get_system_root . "/boot/config-" . $live->find_kernel->{version}) =~ /^CONFIG_SQUASHFS_$ucomp=y$/m;
}
diff --git a/lib/MDV/Draklive/Media.pm b/lib/MDV/Draklive/Media.pm
index c891ef0..8487e29 100644
--- a/lib/MDV/Draklive/Media.pm
+++ b/lib/MDV/Draklive/Media.pm
@@ -12,7 +12,7 @@ sub new {
$media->{partitions} ||= [ { mntpoint => '/' } ];
- for $mntpoint (qw(/ OEM_RESCUE)) {
+ foreach my $mntpoint (qw(/ OEM_RESCUE)) {
my $part = find { $_->{mntpoint} eq $mntpoint } @{$media->{partitions}};
$part->{fs_type} ||= $media->get_media_setting('fs');
if (my $label = $mntpoint eq '/' && $media->get_media_label) {
diff --git a/lib/MDV/Draklive/Mounts.pm b/lib/MDV/Draklive/Mounts.pm
index 5bdacd7..7aea117 100644
--- a/lib/MDV/Draklive/Mounts.pm
+++ b/lib/MDV/Draklive/Mounts.pm
@@ -2,7 +2,7 @@ package MDV::Draklive::Mounts;
use MDK::Common;
-my $_dir_distrib_sqfs = {
+my $dir_distrib_sqfs = {
mountpoint => '/distrib',
type => 'squashfs',
path => '/distrib',
@@ -10,13 +10,13 @@ my $_dir_distrib_sqfs = {
sort => "config/distrib.sort",
build_from => '/',
};
-my $_dir_memory = {
+my $dir_memory = {
mountpoint => '/memory',
type => 'tmpfs',
mount_opts => 'mode=755',
};
-my $_dir_modules = {
+my $dir_modules = {
mountpoint => '/modules',
type => 'modules',
path => '/modules',
@@ -36,7 +36,7 @@ our $simple_union = {
mountpoint => '/media',
type => 'plain',
},
- $_dir_memory,
+ $dir_memory,
],
};
@@ -44,7 +44,7 @@ our $squash_rw_union = {
root => '/union',
overlay => 'unionfs',
dirs => [
- $_dir_distrib_sqfs,
+ $dir_distrib_sqfs,
{
mountpoint => '/media/system',
type => 'plain',
@@ -58,9 +58,9 @@ sub volatile_squash_union {
root => '/union',
overlay => 'unionfs',
dirs => [
- $_dir_distrib_sqfs,
- if_($o_modules, $_dir_modules),
- $_dir_memory,
+ $dir_distrib_sqfs,
+ if_($o_modules, $dir_modules),
+ $dir_memory,
],
};
}
@@ -71,8 +71,8 @@ sub squash_union {
root => '/union',
overlay => 'unionfs',
dirs => [
- $_dir_distrib_sqfs,
- if_($o_modules, $_dir_modules),
+ $dir_distrib_sqfs,
+ if_($o_modules, $dir_modules),
{
mountpoint => '/system',
type => 'loopfs',
diff --git a/lib/MDV/Draklive/Utils.pm b/lib/MDV/Draklive/Utils.pm
index f98074a..7637d32 100644
--- a/lib/MDV/Draklive/Utils.pm
+++ b/lib/MDV/Draklive/Utils.pm
@@ -13,7 +13,7 @@ our @EXPORT = qw(directory_usage run_ run_foreach);
sub directory_usage {
my ($dir, $o_apparent) = @_;
my $apparent = $o_apparent && "--apparent-size";
- first(split /\s/, `du -s -B 1 $apparent $_[0]`);
+ first(split /\s/, `du -s -B 1 $apparent $dir`);
}
#- expand only if the pattern contains '*'
@@ -42,7 +42,7 @@ sub run_foreach {
my $selector = IO::Select->new($cmd_out);
while (my @ready = $selector->can_read) {
foreach my $fh (@ready) {
- local $_ = scalar<$fh>;
+ local $_ = scalar <$fh>;
return if /^open3:/;
$foreach->();
$selector->remove($fh) if eof($fh);