[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.6-27-gbb9fd6d



The following commit has been merged in the master branch:
commit bb9fd6d0ed34ff1c8e124c48e6a521ca5bc6df09
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Mar 25 14:05:03 2012 +0200

    coll/{index,bin-pkg-control}: compress index files
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/collection/bin-pkg-control b/collection/bin-pkg-control
index e973a1a..53c1be1 100755
--- a/collection/bin-pkg-control
+++ b/collection/bin-pkg-control
@@ -33,6 +33,10 @@ my (@jobs, $job);
 if ( -e "$dir/control"){
     delete_dir ("$dir/control") or fail 'Cannot remove old control dir';
 }
+unlink "$dir/control-index" or fail "control-index: $!"
+    if -e "$dir/control-index";
+unlink "$dir/control-index.gz" or fail "control-index.gz: $!"
+    if -e "$dir/control-index.gz";
 
 mkdir ("$dir/control", 0777) or fail "mkdir control: $!";
 
@@ -51,14 +55,15 @@ spawn($job,
       ['tar', 'xf', "$dir/control.tar", '-C', "$dir/control", '&']);
 
 $job = { fail => 'error',
-         out  => "$dir/control-index",
+         out  => "$dir/control-index.gz",
          err  => "$dir/control-index-errors" };
 
 push @jobs, $job;
 # create index of control.tar.gz
 spawn($job,
       ['tar', 'tvf', "$dir/control.tar"],
-      '|', ['sort', '-k', '6'], '&');
+      '|', ['sort', '-k', '6'],
+      '|', ['gzip', '--best', '-c'], '&');
 
 reap(@jobs);
 undef @jobs;
diff --git a/collection/bin-pkg-control.desc b/collection/bin-pkg-control.desc
index ac97c7b..b5e08f6 100644
--- a/collection/bin-pkg-control.desc
+++ b/collection/bin-pkg-control.desc
@@ -2,4 +2,4 @@ Collector-Script: bin-pkg-control
 Info: This script extracts the contents of control.tar into the control/
  and creates control-index as well.
 Type: binary, udeb
-Version: 1
+Version: 2
diff --git a/collection/index b/collection/index
index a276508..f2cc24c 100755
--- a/collection/index
+++ b/collection/index
@@ -37,8 +37,12 @@ use Lintian::Processable::Package;
 ($#ARGV == 2) or fail 'syntax: index <pkg> <type> <dir>';
 my ($pkg, $type, $dir) = @ARGV;
 
-unlink "$dir/index" or fail "Could not unlink index: $!" if -e "$dir/index";
-unlink "$dir/index-errors" or fail "Could not unlink index-errors: $!" if -e "$dir/index-errors";
+unlink "$dir/index" or fail "Could not unlink index: $!"
+    if -e "$dir/index";
+unlink "$dir/index.gz" or fail "Could not unlink index.gz: $!"
+    if -e "$dir/index.gz";
+unlink "$dir/index-errors" or fail "Could not unlink index-errors: $!"
+    if -e "$dir/index-errors";
 
 if ($type ne 'source') {
     index_deb();
@@ -187,8 +191,9 @@ sub index_src {
     }
     # Now that we have the file names we want, write them out sorted to the index
     # file.
-    spawn({ fail => 'error', out_append => "$dir/index" },
-          sub { print @result }, '|', ['sort', '-k', '6']);
+    spawn({ fail => 'error', out => "$dir/index.gz" },
+          sub { print @result }, '|', ['sort', '-k', '6'],
+          '|', ['gzip', '--best', '-c']);
     return 1;
 }
 
@@ -201,7 +206,7 @@ sub index_deb {
     }
 
     $job = { fail => 'error',
-             out  => "$dir/index",
+             out  => "$dir/index.gz",
              err  => "$dir/index-errors" };
     push @jobs, $job;
     # (replaces dpkg-deb -c)
@@ -210,10 +215,11 @@ sub index_deb {
           ['dpkg-deb', '--fsys-tarfile', "$dir/deb" ],
           '|', ['tar', 'tfv', '-'],
           '|', ['sed', '-e', 's/^h/-/'],
-          '|', ['sort', '-k', '6'], '&');
+          '|', ['sort', '-k', '6'],
+          '|', ['gzip', '--best', '-c'], '&');
 
     $job = { fail => 'error',
-             out  => "$dir/index-owner-id",
+             out  => "$dir/index-owner-id.gz",
              err  => '/dev/null' };
     push @jobs, $job;
     # (replaces dpkg-deb -c)
@@ -222,7 +228,8 @@ sub index_deb {
           ['dpkg-deb', '--fsys-tarfile', "$dir/deb" ],
           '|', ['tar', '--numeric-owner', '-tvf', '-'],
           '|', ['sed', '-e', 's/^h/-/'],
-          '|', ['sort', '-k', '6'], '&');
+          '|', ['sort', '-k', '6'],
+          '|', ['gzip', '--best', '-c'], '&');
 
     reap(@jobs);
     undef @jobs;
diff --git a/collection/index.desc b/collection/index.desc
index 7baecb3..bd0de5f 100644
--- a/collection/index.desc
+++ b/collection/index.desc
@@ -1,5 +1,5 @@
 Collector-Script: index
 Info: This script create an index file of the contents of a package.
 Type: source, binary, udeb
-Version: 2
+Version: 3
 
diff --git a/debian/changelog b/debian/changelog
index 1b818d9..1c390e9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -40,8 +40,13 @@ lintian (2.5.7) UNRELEASED; urgency=low
 
   * collection/*:
     + [NT] Use Lintian::Collect to access the package index.
+  * collection/bin-pkg-control{,.desc}:
+    + [NT] Compress control-index file and bump version of
+      bin-pkg-control.
   * collection/file-info{,.desc}:
     + [NT] Compress file-info output and bump version of file-info.
+  * collection/index{,.desc}:
+    + [NT] Compress index output and bump version of index.
   * collection/objdump-info:
     + [NT] Use "fail" from Util.pm rather than embedding a copy of
       it.
diff --git a/lib/Lintian/Collect/Package.pm b/lib/Lintian/Collect/Package.pm
index 03b2954..24b6777 100644
--- a/lib/Lintian/Collect/Package.pm
+++ b/lib/Lintian/Collect/Package.pm
@@ -114,11 +114,11 @@ sub _fetch_index_data {
     my (%idxh, %dir_counts);
     my $num_idx;
     my %rhlinks;
-    open my $idx, '<', "$base_dir/$index"
-        or croak "cannot open index file $base_dir/$index: $!";
+    open my $idx, '-|', 'gzip', '-dc', "$base_dir/${index}.gz"
+        or croak "cannot open index file $base_dir/${index}.gz: $!";
     if ($indexown) {
-        open $num_idx, '<', "$base_dir/$indexown"
-            or croak "cannot open index file $base_dir/$indexown: $!";
+        open $num_idx, '-|', 'gzip', '-dc', "$base_dir/${indexown}.gz"
+            or croak "cannot open index file $base_dir/${indexown}.gz: $!";
     }
     while (<$idx>) {
         chomp;

-- 
Debian package checker


Reply to: