r53256 - in /trunk/dh-make-perl: debian/changelog lib/DhMakePerl.pm

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Tue Feb 23 07:49:40 UTC 2010


Author: dmn
Date: Tue Feb 23 07:49:23 2010
New Revision: 53256

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=53256
Log:
do not crash when APT package cache cannot be opened

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

Modified: trunk/dh-make-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/changelog?rev=53256&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/changelog (original)
+++ trunk/dh-make-perl/debian/changelog Tue Feb 23 07:49:23 2010
@@ -5,6 +5,7 @@
   * in --make mode, rename any existing debian/ directory to debian.bak/,
     overwriting the later if it exists
   * when looking for docs, ignore .svn/ too
+  * do not crash when APT's package cache cannot be opened
 
  -- Damyan Ivanov <dmn at debian.org>  Fri, 19 Feb 2010 22:47:26 +0200
 

Modified: trunk/dh-make-perl/lib/DhMakePerl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl.pm?rev=53256&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl.pm Tue Feb 23 07:49:23 2010
@@ -2082,8 +2082,15 @@
 sub package_already_exists {
     my( $self, $apt_contents ) = @_;
 
-    my $apt_cache = AptPkg::Cache->new;
-    my $found = $apt_cache->packages->lookup( $self->pkgname );
+    my $found;
+
+    eval {
+        my $apt_cache = AptPkg::Cache->new;
+        $found = $apt_cache->packages->lookup( $self->pkgname )
+            if $apt_cache;
+    };
+
+    warn "Error initializing AptPkg::Cache: $@" if $@;
 
     if ($found) {
         warn "**********\n";




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