From 233253809e978b7487956e9bd56957a848459821 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sun, 27 Jun 2010 15:15:33 +0100 Subject: [PATCH] Make make_libafs_tree.pl use strict and warnings Turn on the perl use strict and use warnings options in the make_libafs_tree script to better catch programming bugs. Change-Id: Ide358d40eda3cde9dd0261af11993560da71143a Reviewed-on: http://gerrit.openafs.org/2266 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/config/make_libafs_tree.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/config/make_libafs_tree.pl b/src/config/make_libafs_tree.pl index 2ed60b96b..fb8295d75 100755 --- a/src/config/make_libafs_tree.pl +++ b/src/config/make_libafs_tree.pl @@ -1,4 +1,7 @@ #!/usr/bin/perl +use strict; +use warnings; + $| = 1; # # Build the libafs_tree by reading component list files in the src dir, and copying the @@ -11,6 +14,11 @@ use File::Path; my $quiet = 0; my $showonly = 0; +my $treedir; +my $projdir; +my $sysname; +my $ostype; +my $objdir; while ( $_ = shift @ARGV ) { @@ -23,7 +31,7 @@ while ( $_ = shift @ARGV ) if (m/^-q/) { $quiet = 1; next; } if (m/^-n/) { $showonly = 1; next; } - usage; + &usage; } if ( !$treedir || !$projdir || !$ostype || !$sysname) { @@ -181,7 +189,7 @@ sub testArg { my ($arg) = @_; return $arg if ( $arg && $arg ne "" ); - usage; + &usage; } sub mkfullpath @@ -208,7 +216,9 @@ sub mkfullpath sub copyit { my ( $from, $to ) = @_; - my (@from, @new); + my @from; + my @new; + my @to; @from = stat($from); @to = stat($to); -- 2.39.5