The following commit has been merged in the master branch:
commit 5fb97d6dabbe6591527d338b71fb6cb2499447d9
Author: Guillem Jover <[email protected]>
Date:   Tue Jan 1 02:17:12 2013 +0100

    perl: Remove unused variables
    
    Fixes Variables::ProhibitUnusedVariables.
    
    Warned-by: perlcritic

diff --git a/dselect/methods/Dselect/Ftp.pm b/dselect/methods/Dselect/Ftp.pm
index dc0cc3a..6d63760 100644
--- a/dselect/methods/Dselect/Ftp.pm
+++ b/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/) {
diff --git a/dselect/methods/ftp/install b/dselect/methods/ftp/install
index de365e3..25b8378 100755
--- a/dselect/methods/ftp/install
+++ b/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";
diff --git a/dselect/methods/ftp/update b/dselect/methods/ftp/update
index bb3050c..048044b 100755
--- a/dselect/methods/ftp/update
+++ b/dselect/methods/ftp/update
@@ -218,8 +218,6 @@ if($@) {
     $exit = 1;
 };
 
-my $ans;
-
 if ($packages_modified) {      # don't clear if nothing changed
     print <<'EOM';
 
diff --git a/scripts/Dpkg/Source/Package/V1.pm 
b/scripts/Dpkg/Source/Package/V1.pm
index a8829e9..83b43c4 100644
--- a/scripts/Dpkg/Source/Package/V1.pm
+++ b/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);
 
diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm
index 051eb9e..e9837b0 100644
--- a/scripts/Dpkg/Source/Patch.pm
+++ b/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,
diff --git a/scripts/dpkg-mergechangelogs.pl b/scripts/dpkg-mergechangelogs.pl
index 203e560..9977869 100755
--- a/scripts/dpkg-mergechangelogs.pl
+++ b/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();
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 625c599..92480cf 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/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)
diff --git a/test/100_critic.t b/test/100_critic.t
index 7e7fb5d..bf50cd8 100644
--- a/test/100_critic.t
+++ b/test/100_critic.t
@@ -80,6 +80,7 @@ my @policies = qw(
     ValuesAndExpressions::RequireUpperCaseHeredocTerminator
     Variables::ProhibitAugmentedAssignmentInDeclaration
     Variables::ProhibitPerl4PackageNames
+    Variables::ProhibitUnusedVariables
     Variables::ProtectPrivateVars
     Variables::RequireNegativeIndices
 );

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to