diff options
author | Guillem Jover <guillem@debian.org> | 2013-04-23 21:26:57 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-04-24 01:16:59 +0200 |
commit | 48c226fc7861c3414c6e014a1d55279d424d9b96 (patch) | |
tree | 503452d40e8ffc57a1c51251846be061e2affbc6 /dselect/methods | |
parent | f1f4ddf435050fa001562e31b65c6a7a69b211e0 (diff) | |
download | dpkg-48c226fc7861c3414c6e014a1d55279d424d9b96.tar.gz |
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.
Diffstat (limited to 'dselect/methods')
-rw-r--r-- | dselect/methods/Dselect/Ftp.pm | 8 | ||||
-rwxr-xr-x | dselect/methods/ftp/install | 4 | ||||
-rwxr-xr-x | dselect/methods/ftp/setup | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/dselect/methods/Dselect/Ftp.pm b/dselect/methods/Dselect/Ftp.pm index 750d6604b..fc21d1522 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 795255e8a..08bb84426 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 6988c902d..f3ca8f11b 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" . |