From 0947117f25160a83948100464397eae080545bb5 Mon Sep 17 00:00:00 2001
From: Don Armstrong <don@volo>
Date: Sat, 23 Sep 2006 01:51:21 -0700
Subject: [PATCH]  * Use warnings in Debbugs::Packages  * Only export when
 asked to export  * Use the proper configuration items, instead of assuming
 that    they're in the debbugs package.

---
 Debbugs/Packages.pm | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/Debbugs/Packages.pm b/Debbugs/Packages.pm
index 8c22da66..9ea1f1c9 100644
--- a/Debbugs/Packages.pm
+++ b/Debbugs/Packages.pm
@@ -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: $!";
     }
 
-- 
2.39.5