r53111 - /trunk/dh-make-perl/lib/DhMakePerl.pm

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Sat Feb 20 21:23:01 UTC 2010


Author: dmn
Date: Sat Feb 20 21:22:55 2010
New Revision: 53111

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=53111
Log:
access overrides via an object method

not elliminating the package global %overrides, as this is needed for the
'do()' mechanism in load_overrrides() to work.

Modified:
    trunk/dh-make-perl/lib/DhMakePerl.pm

Modified: trunk/dh-make-perl/lib/DhMakePerl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl.pm?rev=53111&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl.pm Sat Feb 20 21:22:55 2010
@@ -10,7 +10,7 @@
 __PACKAGE__->mk_accessors(
     qw(
         cfg apt_contents main_dir debian_dir meta bdepends bdependsi depends
-        priority section maintainer arch start_dir
+        priority section maintainer arch start_dir overrides
         )
 );
 
@@ -75,8 +75,6 @@
 
 # TODO:
 # * get more info from the package (maybe using CPAN methods)
-
-our %overrides;
 
 use constant debstdversion => '3.8.4';
 
@@ -1923,6 +1921,9 @@
     return "$name <$email>";
 }
 
+# a package glocal is needed here so that the 'do $overrides' below sees it
+our %overrides;
+
 sub load_overrides {
     my ($self) = @_;
 
@@ -1931,6 +1932,8 @@
         do $overrides if -f $overrides;
         $overrides = catfile( $self->cfg->home_dir, 'overrides');
         do $overrides if -f $overrides;
+
+        $self->overrides( \%overrides );
     };
     if ($@) {
         die "Error when processing the overrides files: $@";
@@ -2045,7 +2048,7 @@
     my ($self) = @_;
 
     my ( $data, $checkver, $subkey );
-    $data = $overrides{$perlname};
+    $data = $self->overrides->{$perlname};
 
     return unless defined $data;
     die "Value of '$perlname' in overrides not a hashref\n"




More information about the Pkg-perl-cvs-commits mailing list