diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-11-06 20:31:56 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-11-06 20:31:56 +0100 |
commit | 213b00300713555b29305ac0de530b1c80f7be85 (patch) | |
tree | fb221683bec01d4cef00b98ce771070a9027a99e | |
parent | c41824c9aac00698bceee634a9ae4225fb3a1167 (diff) | |
download | drakiso-213b00300713555b29305ac0de530b1c80f7be85.tar drakiso-213b00300713555b29305ac0de530b1c80f7be85.tar.gz drakiso-213b00300713555b29305ac0de530b1c80f7be85.tar.bz2 drakiso-213b00300713555b29305ac0de530b1c80f7be85.tar.xz drakiso-213b00300713555b29305ac0de530b1c80f7be85.zip |
perl_checker cleanups
-rwxr-xr-x | draklive | 36 |
1 files changed, 18 insertions, 18 deletions
@@ -563,7 +563,7 @@ sub create_bootloader { create_classical_bootloader($live); } - create_efi_boot_image($live) if ($live->{settings}{arch} eq 'x86_64'); + create_efi_boot_image($live) if $live->{settings}{arch} eq 'x86_64'; } sub remove_unneeded_bootlogo_locales { @@ -717,7 +717,7 @@ sub create_cdrom_master { mkdir_p(dirname($dest)); } build_iso_image( - $live, $opts, + $live, $dest, $live->get_builddir . $live->{prefix}{build}{boot} . get_syslinux_path($live->{media}, $opts), $label, @@ -738,11 +738,12 @@ sub create_cdrom_master { } sub build_iso_image { - my ($live, $opts, $dest, $isolinux_cfg, $label, @opts) = @_; + my ($live, $dest, $isolinux_cfg, $label, @opts) = @_; my $progress = MDV::Draklive::Progress->new(100, time()); my $in_progress; autoflush STDOUT 1; + local $_; run_foreach(sub { if (/^\s*([0-9.]+)%\s*done,/) { $progress->{current} = int($1); @@ -814,7 +815,7 @@ sub get_partition_loop { sub get_harddisk_geometry { my ($media) = @_; - my $geom = $media->{geom} || { + $media->{geom} || { heads => 16, sectors => 63, # sectors per track }; @@ -827,7 +828,7 @@ sub get_hd_from_layout { $required_sectors += $geom->{sectors}; # keep one more track $geom->{cylinders} = POSIX::ceil($required_sectors / ($geom->{sectors} * $geom->{heads})); my $total_sectors = $geom->{cylinders} * $geom->{heads} * $geom->{sectors}; - my $hd = bless { + bless { totalsectors => $total_sectors, geom => $geom, file => $dest, @@ -862,7 +863,7 @@ sub set_part_real_device { } sub allocate_master { - my ($live, $media, $opts) = @_; + my ($media, $opts) = @_; $media->supplement_slash_size($opts->{slash_size}) if $opts->{slash_size}; my $hd = get_hd_from_layout($media, $opts->{device}); @@ -872,7 +873,7 @@ sub allocate_master { } sub format_master { - my ($live, $media, $opts) = @_; + my ($media, $opts) = @_; $media->supplement_slash_size($opts->{slash_size}) if $opts->{slash_size}; @@ -905,13 +906,14 @@ sub format_master { sub format_disk { my ($live, $opts) = @_; local $opts->{slash_size} = guess_disk_master_size($live); - format_master($live, $live->{media}, $opts); + format_master($live->{media}, $opts); } sub guess_disk_master_size { my ($live) = @_; - my $slash_size = @{$live->{mount}{dirs} || []} ? + # slash_size: + @{$live->{mount}{dirs} || []} ? (directory_usage($live->get_builddir . $live->{prefix}{build}{loopbacks}, 'apparent') + directory_usage($live->get_builddir . $live->{prefix}{build}{boot}) + directory_usage($live->get_builddir . $live->{prefix}{build}{files}) @@ -923,8 +925,8 @@ sub create_disk_master { my ($live, $opts) = @_; local $opts->{slash_size} = guess_disk_master_size($live); local $opts->{device} = get_disk_master_path($live); - allocate_master($live, $live->{media}, $opts); - format_master($live, $live->{media}, $opts); + allocate_master($live->{media}, $opts); + format_master($live->{media}, $opts); record_master($live, $opts); } @@ -970,8 +972,8 @@ sub record_cdrom_path { or die "no device defined in media configuration\n"; #- CD-Rom images can be hybrid, thus handle recording on both CD-Rom and disks - my $_device = basename(expand_symlinks($device)); - my $sysfs_device = "/sys/block/$_device/capability"; + $device = basename(expand_symlinks($device)); + my $sysfs_device = "/sys/block/$device/capability"; #- GENHD_FL_CD is 8 (include/linux/genhd.h) my $is_cdrom = !-e $sysfs_device || hex(cat_($sysfs_device)) & 8; @@ -1136,8 +1138,6 @@ sub record_harddisk_master { my ($live, $opts) = @_; my $media = $live->{media}; - my $media_boot = $live->get_media_prefix('boot', $opts->{boot}); - my $media_loopbacks = $live->get_media_prefix('loopbacks', $opts->{boot}); my $main_device = get_media_device($live, $opts) or die "unable to find recording device (missing label? try with --device <device>)\n"; @@ -1408,8 +1408,8 @@ sub create_usb_replicator { my %files = get_disk_replicator_files($live); local $opts->{slash_size} = fold_left { $::a + $::b } map { directory_usage($_, 'apparent') } keys(%files); local $opts->{device} = get_disk_replicator_path($live); - allocate_master($live, $live->{replicator}{media}, $opts); - format_master($live, $live->{replicator}{media}, $opts); + allocate_master($live->{replicator}{media}, $opts); + format_master($live->{replicator}{media}, $opts); record_usb_replicator($live, $opts); } @@ -1462,7 +1462,7 @@ sub create_cdrom_replicator { my $label = $live->{replicator}{media}->get_media_label or die "the source device must be described by a label\n"; my $dest = get_cdrom_replicator_path($live); build_iso_image( - $live, $opts, + $live, $dest, $syslinux_cfg, $label, |