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

[SCM] Debian package checker branch, master, updated. 2.5.13-45-g2855e9d



The following commit has been merged in the master branch:
commit d36380b6f3e8d9f77d76a3ecb59631499b93762a
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Jun 29 13:06:02 2013 +0200

    coll: Stop creating empty "*-errors" files
    
    bin-pkg-control, unpacked and index creates "error" files for the
    STDERR output from tar.  However, often there is no output on STDERR
    leaving these files empty, so remove them in that case to save a
    few inodes per entry.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/collection/bin-pkg-control b/collection/bin-pkg-control
index 9bd096c..f53ba69 100755
--- a/collection/bin-pkg-control
+++ b/collection/bin-pkg-control
@@ -25,6 +25,8 @@ use strict;
 use warnings;
 use autodie;
 
+use constant ERROR_FILES => qw(control-index-errors control-errors);
+
 use lib "$ENV{'LINTIAN_ROOT'}/lib";
 use Lintian::Command qw(spawn reap);
 use Lintian::Util qw(delete_dir fail);
@@ -36,8 +38,11 @@ my (@jobs, $job);
 if ( -e "$dir/control"){
     delete_dir ("$dir/control") or fail 'Cannot remove old control dir';
 }
-unlink("$dir/control-index") if -e "$dir/control-index";
-unlink("$dir/control-index.gz") if -e "$dir/control-index.gz";
+
+for my $file ('control-index.gz', ERROR_FILES) {
+    my $path = "$dir/$file";
+    unlink($path) if -e $path;
+}
 
 mkdir("$dir/control", 0777);
 
@@ -75,6 +80,12 @@ unlink("$dir/control.tar");
 spawn({ fail => 'error' },
       ['chmod', '-R', 'u+rX,o-w', "$dir/control"]);
 
+# Remove empty error files...
+for my $file (ERROR_FILES) {
+    my $path = "$dir/$file";
+    unlink($path) if -z $path;
+}
+
 }
 
 collect (@ARGV) if $0 =~ m,(?:^|/)bin-pkg-control$,;
diff --git a/collection/bin-pkg-control.desc b/collection/bin-pkg-control.desc
index 7406c40..218642c 100644
--- a/collection/bin-pkg-control.desc
+++ b/collection/bin-pkg-control.desc
@@ -2,5 +2,5 @@ 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: 2
+Version: 3
 Interface: perl-coll
diff --git a/collection/index b/collection/index
index 7973957..d5a7dac 100755
--- a/collection/index
+++ b/collection/index
@@ -96,6 +96,9 @@ sub index_deb {
     reap(@jobs);
     undef @jobs;
 
+    # Remove the error file if it is empty...
+    unlink("$dir/index-errors") if -z "$dir/index-errors";
+
     return 1;
 }
 
diff --git a/collection/index.desc b/collection/index.desc
index a46e86f..f1e1a04 100644
--- a/collection/index.desc
+++ b/collection/index.desc
@@ -2,5 +2,5 @@ Collector-Script: index
 Info: This script create an index file of the contents of a package.
 Type: source, binary, udeb
 Needs-Info: unpacked [source]
-Version: 4
+Version: 5
 Interface: perl-coll
diff --git a/collection/unpacked b/collection/unpacked
index dbf204e..ff7597f 100755
--- a/collection/unpacked
+++ b/collection/unpacked
@@ -87,6 +87,9 @@ if ($type eq 'source') {
             ['chmod', '-R', 'u+rwX,go-w', "$dir/unpacked"]);
 }
 
+# Remove the error file if it is empty
+unlink("$dir/unpacked-errors") if -z "$dir/unpacked-errors";
+
 }
 
 sub dump_errors {
diff --git a/collection/unpacked.desc b/collection/unpacked.desc
index a52cd5b..52d3fcc 100644
--- a/collection/unpacked.desc
+++ b/collection/unpacked.desc
@@ -2,6 +2,6 @@ Collector-Script: unpacked
 Author: Raphael Geissert <atomo64@gmail.com>
 Info: This script unpacks the package under the unpacked/ directory
 Type: binary, udeb, source
-Version: 1
+Version: 2
 Auto-Remove: yes
 Interface: perl-coll
diff --git a/debian/changelog b/debian/changelog
index 0e1c67a..846dda3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -29,6 +29,8 @@ lintian (2.5.14) UNRELEASED; urgency=low
   * coll/*:
     + [NT] Set "Auto-Remove: yes" on several collections to
       reduce the "inode pressure" on lintian.d.o.
+    + [NT] Reduce the number of inodes used by removing some files,
+      when these are empty.
   * coll/debfiles:
     + [NT] Remove test of the presence of unpacked.
   * coll/file-info{,.desc}:

-- 
Debian package checker


Reply to: