]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Use warnings in Debbugs::Packages
authorDon Armstrong <don@volo>
Sat, 23 Sep 2006 08:51:21 +0000 (01:51 -0700)
committerDon Armstrong <don@volo>
Sat, 23 Sep 2006 08:51:21 +0000 (01:51 -0700)
 * Only export when asked to export
 * Use the proper configuration items, instead of assuming that
   they're in the debbugs package.

Debbugs/Packages.pm

index 8c22da66d0a03c834c7a3dbad763e3ba100f4428..9ea1f1c9307b0009e5003a61942ceab5acd2f485 100644 (file)
@@ -1,18 +1,25 @@
 package Debbugs::Packages;
 
+use warnings;
 use strict;
 
 use Debbugs::Config qw(:config :globals);
 
-use Exporter ();
-use vars qw($VERSION @ISA @EXPORT);
+use base qw(Exporter);
+use vars qw($VERSION @EXPORT_OK %EXPORT_TAGS @EXPORT);
 
 BEGIN {
     $VERSION = 1.00;
 
-    @ISA = qw(Exporter);
-    @EXPORT = qw(getpkgsrc getpkgcomponent getsrcpkgs
-                binarytosource sourcetobinary getversions);
+     @EXPORT = ();
+     %EXPORT_TAGS = (versions => [qw(getverions)],
+                    mapping  => [qw(getpkgsrc getpkgcomponent getsrcpkgs),
+                                 qw(binarytosource sourcetobinary)
+                                ],
+                   );
+     @EXPORT_OK = ();
+     Exporter::export_ok_tags(qw(versions mapping));
+     $EXPORT_TAGS{all} = [@EXPORT_OK];
 }
 
 use Fcntl qw(O_RDONLY);
@@ -193,11 +200,11 @@ Returns versions of the package in distribution at a specific architecture
 my %_versions;
 sub getversions {
     my ($pkg, $dist, $arch) = @_;
-    return () unless defined $debbugs::gVersionIndex;
+    return () unless defined $gVersionIndex;
     $dist = 'unstable' unless defined $dist;
 
     unless (tied %_versions) {
-        tie %_versions, 'MLDBM', $debbugs::gVersionIndex, O_RDONLY
+        tie %_versions, 'MLDBM', $gVersionIndex, O_RDONLY
             or die "can't open versions index: $!";
     }