r55732 - in /trunk/dh-make-perl: debian/changelog lib/Debian/AptContents.pm t/AptContents.t t/contents/sources.list

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Thu Apr 8 14:18:38 UTC 2010


Author: dmn
Date: Thu Apr  8 14:18:27 2010
New Revision: 55732

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=55732
Log:
AptContents: avoid scanning the same Contents file multiple times

Without this, the following entries in sources.list would cause the same
file (/var/cache/apt/apt-file/security.ubuntu.com_ubuntu_dists_karmic-security_Contents-i386.gz)
to be scanned three times:

	deb http://security.ubuntu.com/ubuntu karmic-security main restricted
	deb http://security.ubuntu.com/ubuntu karmic-security multiverse
	deb http://security.ubuntu.com/ubuntu karmic-security universe

Thanks to Nicolas Mendoza

Modified:
    trunk/dh-make-perl/debian/changelog
    trunk/dh-make-perl/lib/Debian/AptContents.pm
    trunk/dh-make-perl/t/AptContents.t
    trunk/dh-make-perl/t/contents/sources.list

Modified: trunk/dh-make-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/changelog?rev=55732&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/changelog (original)
+++ trunk/dh-make-perl/debian/changelog Thu Apr  8 14:18:27 2010
@@ -4,6 +4,8 @@
     --intrusive is given
   * AptContents/find_file_packages: strip the full section off the package name
     Closes RT#56100. Thanks to Nicolas Mendoza
+  * AptContents: avoid scanning the same Contents file multiple times. Thanks
+    to Nicolas Mendoza
 
  -- Damyan Ivanov <dmn at debian.org>  Tue, 09 Mar 2010 08:46:09 +0200
 

Modified: trunk/dh-make-perl/lib/Debian/AptContents.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/Debian/AptContents.pm?rev=55732&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/Debian/AptContents.pm (original)
+++ trunk/dh-make-perl/lib/Debian/AptContents.pm Thu Apr  8 14:18:27 2010
@@ -34,6 +34,7 @@
 use Debian::Version qw(deb_ver_cmp);
 use File::Spec::Functions qw( catfile catdir splitpath );
 use IO::Uncompress::Gunzip;
+use List::MoreUtils qw(uniq);
 use Module::CoreList ();
 use Storable;
 use AptPkg::Config;
@@ -237,7 +238,7 @@
         }
     }
 
-    return [ sort @res ];
+    return [ uniq sort @res ];
 }
 
 =item read_cache

Modified: trunk/dh-make-perl/t/AptContents.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/t/AptContents.t?rev=55732&op=diff
==============================================================================
--- trunk/dh-make-perl/t/AptContents.t (original)
+++ trunk/dh-make-perl/t/AptContents.t Thu Apr  8 14:18:27 2010
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 20;
+use Test::More tests => 21;
 
 BEGIN {
     use_ok 'Debian::AptContents';
@@ -109,4 +109,11 @@
 
 is( $apt_contents->find_perl_module_package('Moose'), 'libmoose-perl', 'Moose fund by module name' );
 
+is_deeply(
+    $apt_contents->get_contents_files,
+    [   "$Bin/contents/test_debian_dists_sid_Contents",
+        "$Bin/contents/test_debian_dists_testing_Contents"
+    ]
+);
+
 ok( unlink "$Bin/Contents.cache", 'Contents.cache unlnked' );

Modified: trunk/dh-make-perl/t/contents/sources.list
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/t/contents/sources.list?rev=55732&op=diff
==============================================================================
--- trunk/dh-make-perl/t/contents/sources.list (original)
+++ trunk/dh-make-perl/t/contents/sources.list Thu Apr  8 14:18:27 2010
@@ -1,6 +1,7 @@
 # dummy sources.list file used only for testing
 
 deb http://test/debian sid main
+deb http://test/debian testing main
 deb http://test/debian testing main
 deb     http://security.debian.org/ stable/updates main contrib non-free
 deb     http://www.toastfreeware.priv.at/debian stable/




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