aboutsummaryrefslogtreecommitdiff
path: root/sboupgrade
diff options
context:
space:
mode:
authorJacob Pipkin <j@dawnrazor.net>2012-06-05 12:44:48 -0500
committerJacob Pipkin <j@dawnrazor.net>2012-06-05 12:44:48 -0500
commita158c22df50796bbf02d876d6197635a1899aba6 (patch)
tree22714fae8f37adafe1be78f8488b523edbbdcb1e /sboupgrade
parentae9bb71900fe625562c124debcf4f7b316a1bb3a (diff)
downloadsbotools2-a158c22df50796bbf02d876d6197635a1899aba6.tar.xz
factored out "open my $fh, $op, $file" and made it robust in one fell swoop
Diffstat (limited to 'sboupgrade')
-rwxr-xr-xsboupgrade6
1 files changed, 3 insertions, 3 deletions
diff --git a/sboupgrade b/sboupgrade
index 0cd946e..8bf2831 100755
--- a/sboupgrade
+++ b/sboupgrade
@@ -198,13 +198,13 @@ sub readme_prompt {
script_error ('readme_prompt requires an argument.') unless exists $_[0];
my $sbo = shift;
my $readme_path = get_readme_path ($sbo);
- open my $readme_file, '<', $readme_path;
- my $readme = do {local $/; <$readme_file>};
+ my $fh = open_read ($readme_path);
+ my $readme = do {local $/; <$fh>};
+ close $fh;
unless (grok_requirements ($sbo, $readme) ) {
grok_user_group ($readme);
my $opts = grok_options ($readme);
print "\n". $readme if $opts eq "7";
- close $readme_file;
my $name = $compat32 eq 'TRUE' ? "$sbo-compat32" : $sbo;
print "\nProceed with $name? [y]: ";
my $test = <STDIN>;