Explorar el Código

perl: Remove unused variables

Fixes Variables::ProhibitUnusedVariables.

Warned-by: perlcritic
Guillem Jover hace 13 años
padre
commit
5fb97d6dab

+ 1 - 1
dselect/methods/Dselect/Ftp.pm

@@ -47,7 +47,7 @@ sub read_config {
   $code = <$vars_fh>;
   close $vars_fh;
 
-  my $VAR1;
+  my $VAR1; ## no critic (Variables::ProhibitUnusedVariables)
   $conf = eval $code;
   die "Couldn't eval $vars content : $@\n" if ($@);
   if (ref($conf) =~ /HASH/) {

+ 1 - 1
dselect/methods/ftp/install

@@ -65,7 +65,7 @@ if (-f "$methdir/md5sums") {
     die "Couldn't read file $methdir/md5sums";
   my $code = <$md5sums_fh>;
   close $md5sums_fh;
-  my $VAR1;
+  my $VAR1; ## no critic (Variables::ProhibitUnusedVariables)
   my $res = eval $code;
   if ($@) {
     die "Couldn't eval $methdir/md5sums content: $@\n";

+ 0 - 2
dselect/methods/ftp/update

@@ -218,8 +218,6 @@ if($@) {
     $exit = 1;
 };
 
-my $ans;
-
 if ($packages_modified) {	# don't clear if nothing changed
     print <<'EOM';
 

+ 1 - 1
scripts/Dpkg/Source/Package/V1.pm

@@ -266,7 +266,7 @@ sub do_build {
 	           "-<upstreamversion> '%s'"), $dir, $basedirname);
     }
 
-    my ($tarname, $tardirname, $tardirbase, $origdirname);
+    my ($tarname, $tardirname, $tardirbase);
     if ($sourcestyle ne 'n') {
 	my ($origdirname, $origdirbase) = fileparse($origdir);
 

+ 0 - 1
scripts/Dpkg/Source/Patch.pm

@@ -587,7 +587,6 @@ sub check_apply {
     $self->prepare_apply($analysis, %opts);
     # Apply the patch
     $self->ensure_open('r');
-    my $error;
     my $patch_pid = spawn(
 	exec => [ 'patch', @{$opts{options}} ],
 	chdir => $destdir,

+ 1 - 1
scripts/dpkg-mergechangelogs.pl

@@ -86,7 +86,7 @@ unless (defined $old and defined $new_a and defined $new_b and
     exit(2);
 }
 
-my ($cho, $cha, $chb, $res);
+my ($cho, $cha, $chb);
 $cho = Dpkg::Changelog::Debian->new();
 $cho->load($old);
 $cha = Dpkg::Changelog::Debian->new();

+ 0 - 1
scripts/dpkg-shlibdeps.pl

@@ -145,7 +145,6 @@ error(_('error occurred while parsing %s'), 'Build-Depends/Build-Depends-Arch')
     unless defined $build_deps;
 
 my %dependencies;
-my %shlibs;
 
 # Statictics on soname seen in the whole run (with multiple analysis of
 # binaries)

+ 1 - 0
test/100_critic.t

@@ -80,6 +80,7 @@ my @policies = qw(
     ValuesAndExpressions::RequireUpperCaseHeredocTerminator
     Variables::ProhibitAugmentedAssignmentInDeclaration
     Variables::ProhibitPerl4PackageNames
+    Variables::ProhibitUnusedVariables
     Variables::ProtectPrivateVars
     Variables::RequireNegativeIndices
 );