The following commit has been merged in the master branch:
commit 48c226fc7861c3414c6e014a1d55279d424d9b96
Author: Guillem Jover <[email protected]>
Date: Tue Apr 23 21:26:57 2013 +0200
dselect: Stop using 'use vars' in method scripts
This also fixes a typo ($VAL1 → $VAR1), and adds %config to the
Dselect::Ftp module exported variables.
diff --git a/dselect/methods/Dselect/Ftp.pm b/dselect/methods/Dselect/Ftp.pm
index 750d660..fc21d15 100644
--- a/dselect/methods/Dselect/Ftp.pm
+++ b/dselect/methods/Dselect/Ftp.pm
@@ -20,10 +20,9 @@ use warnings;
use Exporter qw(import);
-use vars qw(@EXPORT %config $VAR1);
-
-@EXPORT = qw(yesno do_connect do_mdtm add_site edit_site
- edit_config read_config store_config view_mirrors nb);
+our @EXPORT = qw(%config yesno do_connect do_mdtm add_site edit_site
+ edit_config read_config store_config view_mirrors nb);
+our %config;
sub nb {
my $nb = shift;
@@ -46,6 +45,7 @@ sub read_config {
$code = <VARS>;
close VARS;
+ my $VAR1;
$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 795255e..08bb844 100755
--- a/dselect/methods/ftp/install
+++ b/dselect/methods/ftp/install
@@ -19,8 +19,6 @@
use strict;
use warnings;
-use vars qw(%config $ftp);
-
eval q{
use Net::FTP;
use File::Path;
@@ -67,7 +65,7 @@ if (-f "$methdir/md5sums") {
die "Couldn't read file $methdir/md5sums";
my $code = <MD5SUMS>;
close MD5SUMS;
- use vars qw($VAL1);
+ my $VAR1;
my $res = eval $code;
if ($@) {
die "Couldn't eval $methdir/md5sums content: $@\n";
diff --git a/dselect/methods/ftp/setup b/dselect/methods/ftp/setup
index 6988c90..f3ca8f1 100755
--- a/dselect/methods/ftp/setup
+++ b/dselect/methods/ftp/setup
@@ -19,8 +19,6 @@
use strict;
use warnings;
-use vars qw(%config);
-
eval 'use Net::FTP;';
if ($@) {
print STDERR "Please install the 'perl' package if you want to use the\n" .
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]