diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-11-29 11:00:16 -0800 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-11-29 11:00:16 -0800 |
commit | b7a857315121186ae7e67c761f8ad0cc5c1575ef (patch) | |
tree | d19962721686857f842c9a9f1787a615e4a3ec23 | |
parent | 348fc91c018e71a2ada68e7203a09cab60f775cb (diff) | |
download | vyatta-op-b7a857315121186ae7e67c761f8ad0cc5c1575ef.tar.gz vyatta-op-b7a857315121186ae7e67c761f8ad0cc5c1575ef.zip |
boot-image: fix perl critic warnings
Bug 6886
Mostly changes to use explicit glob() function.
-rwxr-xr-x | scripts/vyatta-boot-image.pl | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scripts/vyatta-boot-image.pl b/scripts/vyatta-boot-image.pl index 68d016f..2d53f1c 100755 --- a/scripts/vyatta-boot-image.pl +++ b/scripts/vyatta-boot-image.pl @@ -190,7 +190,7 @@ sub deleteGrubEntries { my $p = (stat($grub_cfg))[2]; return 'Failed to modify GRUB configuration' - if (!defined($p) || !chmod(($p & 07777), $tfile)); + if (!defined($p) || !chmod(($p & oct(7777)), $tfile)); system("mv $tfile $grub_cfg"); return 'Failed to delete GRUB entries' if ($? >> 8); return undef; @@ -244,7 +244,7 @@ sub image_vyatta_version { return "unknown"; } - my @squash_files = </live/image/boot/$image_name/*.squashfs>; + my @squash_files = glob("/live/image/boot/$image_name/*.squashfs"); foreach my $squash_file (@squash_files) { if (-e $squash_file) { system("sudo mkdir /tmp/squash_mount"); @@ -369,8 +369,7 @@ sub select_by_name { # Find the entry that matches the new default version my $entries = $gref->{'entries'}; - my $entry; - foreach $entry (@{$entries}) { + foreach my $entry (@{$entries}) { # Skip non-vyatta entries next if (!defined($entry->{'ver'})); @@ -436,9 +435,7 @@ sub del_non_image_files { system("echo Deleting disk-based system files at: `date` >> $logfile"); system("echo Run by: `whoami` >> $logfile"); - my @entries=</live/image/*>; - my $entry; - foreach $entry (@entries) { + foreach my $entry (glob("/live/image/*")) { if ($entry eq "/live/image/boot") { print "Skipping $entry.\n"; } else { |