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

[SCM] Debian package checker branch, master, updated. 2.5.1-71-g7ef8953



The following commit has been merged in the master branch:
commit 7ef895344167c40ec91f3285be8f8b632bacaeb9
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Jul 11 10:38:30 2011 +0200

    Made coll/file-info able to code if unpacked becomes a symlink

diff --git a/collection/file-info b/collection/file-info
index bf8519c..a1acb65 100755
--- a/collection/file-info
+++ b/collection/file-info
@@ -35,11 +35,17 @@ my $last = '';
 -f 'fields/source' or fail('file-info invoked in wrong directory');
 
 unlink('file-info');
-chdir('unpacked')
-    or fail("cannot chdir to unpacked directory: $!");
 
-open(FILE_INFO, '>', '../file-info')
+# Open files before we chdir, since unpacked could be a symlink (at
+# the time of writing, it never is, but it could be a reasonable way
+# of fixing #262783)
+open(FILE_INFO, '>', 'file-info')
     or fail("cannot open file-info: $!");
+open(INDEX, '<', 'index')
+    or fail("cannot open index file: $!");
+
+chdir('unpacked')
+    or fail("cannot chdir to unpacked directory: $!");
 
 my $collect = sub {
     my @lines = map { split "\n" } @_;
@@ -91,8 +97,7 @@ my %opts = ( pipe_in => FileHandle->new,
 	     fail => 'never' );
 spawn(\%opts, ['xargs', '-0r', 'file', '-F', '', '--print0', '--']);
 $opts{pipe_in}->blocking(1);
-open(INDEX, '<', '../index')
-    or fail("cannot open index file: $!");
+
 while (<INDEX>) {
     chomp;
     $_ = (split(' ', $_, 6))[5];
diff --git a/debian/changelog b/debian/changelog
index eaba568..0ddd930 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -120,6 +120,8 @@ lintian (2.5.2) UNRELEASED; urgency=low
       file is not gzip compressed.  This should reduce the number
       of false-positives gz-file-not-gzip tags.
       (Closes: #620289)
+    + [NT] Open files before using chdir.  In the future unpacked
+      may be a symlink.
   * collection/index{,.desc}:
     + [NT] Updated to handle source packages and with support for
       multi tarball source packages.

-- 
Debian package checker


Reply to: