Browse Source

dpkg-gensymbols: skip directories during scan of package build dir

* scripts/dpkg-gensymbols: Don't scan directories which are
symlinks. They might point outside of the package build dir which
results in addition of libraries which are not in the package.
The libc6 package on amd64 is affected with a symlink "lib64" ->
"/lib".
Raphael Hertzog 18 years ago
parent
commit
ee51a78c13
3 changed files with 18 additions and 1 deletions
  1. 8 0
      ChangeLog
  2. 7 0
      debian/changelog
  3. 3 1
      scripts/dpkg-gensymbols.pl

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+2008-01-26  Raphael Hertzog  <hertzog@debian.org>
+
+	* scripts/dpkg-gensymbols: Don't scan directories which are
+	symlinks. They might point outside of the package build dir which
+	results in addition of libraries which are not in the package.
+	The libc6 package on amd64 is affected with a symlink "lib64" ->
+	"/lib".
+
 2008-01-24  Raphael Hertzog  <hertzog@debian.org>
 
 	* configure.ac: Release 1.14.16.5.

+ 7 - 0
debian/changelog

@@ -1,3 +1,10 @@
+dpkg (1.14.16.6) UNRELEASED; urgency=low
+
+  * Let dpkg-gensymbols skip directories which are just symlinks when scanning
+    the package build dir.
+
+ -- Raphael Hertzog <hertzog@debian.org>  Sat, 26 Jan 2008 19:20:40 +0100
+
 dpkg (1.14.16.5) unstable; urgency=low
 
   * Fix dpkg-gensymbols handling of #include so that one can include multiple

+ 3 - 1
scripts/dpkg-gensymbols.pl

@@ -140,7 +140,9 @@ if (not scalar @files) {
     foreach my $path (@librarypaths) {
 	my $libdir = "$packagebuilddir$path";
 	$libdir =~ s{/+}{/}g;
-	next if not -d $libdir;
+	lstat $libdir;
+	next if not -d _;
+	next if -l _; # Skip directories which are symlinks
 	opendir(DIR, "$libdir") ||
 	    syserr(_g("Can't read directory %s: %s"), $libdir, $!);
 	push @files, grep {