Package: debhelper
Version: 4.2.36

Creating -dbg packages using dh_strip --dbg-package= result in packages
where for shared libraries symbolic liks are missing. These sym-links
are missing for the case where the SONAME of the shared library does not
match the filename:

SONAME libxerces-c.so.1.7
FILE   libxerces-c.so.1.7.0

In this case a symlink exists called (/usr/lib):

SYMLINK libxerces-c.so.1.7 -> libxerces-c.so.1.7.0

It is mandatory to copy this sym-link to the -dbg package to. Please
apply this patch to make this step happen.

--
Raphael Bossek
diff -Nru debhelper-4.2.36/debian/changelog debhelper-4.2.36.1/debian/changelog
--- debhelper-4.2.36/debian/changelog	2005-05-08 19:02:24.000000000 +0200
+++ debhelper-4.2.36.1/debian/changelog	2005-06-07 16:18:55.000000000 +0200
@@ -1,3 +1,9 @@
+debhelper (4.2.36.1) experimental; urgency=low
+
+  * Fixed dh_strip --dbg-package to handle sym-links for shared libraries.
+
+ -- Raphael Bossek <[EMAIL PROTECTED]>  Tue,  7 Jun 2005 16:18:46 +0200
+
 debhelper (4.2.36) unstable; urgency=low
 
   * Spanish translation update for dh_installdebconf(1).
diff -Nru debhelper-4.2.36/dh_strip debhelper-4.2.36.1/dh_strip
--- debhelper-4.2.36/dh_strip	2005-04-22 17:36:48.000000000 +0200
+++ debhelper-4.2.36.1/dh_strip	2005-06-08 17:39:03.000000000 +0200
@@ -102,11 +102,11 @@
 }
 
 # Check if a file is an elf binary, shared library, or static library,
-# for use by File::Find. It'll fill the following 3 arrays with anything
+# for use by File::Find. It'll fill the following 4 arrays with anything
 # it finds:
-my (@shared_libs, @executables, @static_libs);
+my (@shared_libs, @executables, @static_libs, @symlinks);
 sub testfile {
-	return if -l $_ or -d $_; # Skip directories and symlinks always.
+	return if -d $_; # Skip directories
 	
 	# See if we were asked to exclude this file.
 	# Note that we have to test on the full filename, including directory.
@@ -120,6 +120,10 @@
 
 	# Does its filename look like a shared library?
 	if (m/.*\.so.*?/) {
+		if (-l $_) {
+			push @symlinks, $fn;
+			return;
+		}
 		# Ok, do the expensive test.
 		my $type=get_file_type($_);
 		if ($type=~m/.*ELF.*shared.*/) {
@@ -127,7 +131,10 @@
 			return;
 		}
 	}
-	
+
+	# We do not expect any symlink otherwise.
+	return if -l $_;
+
 	# Is it executable? -x isn't good enough, so we need to use stat.
 	my (undef,undef,$mode,undef)=stat(_);
 	if ($mode & 0111) {
@@ -162,9 +169,14 @@
 	if (! -d $debug_dir) {
 		doit("install", "-d", $debug_dir);
 	}
-	doit("objcopy", "--only-keep-debug", $file, $debug_path);
-	# No reason for this to be executable.
-	doit("chmod", 644, $debug_path);
+	if (-l $file) {
+		doit("cp","-d",$file,$debug_path);
+	}
+	else {
+		doit("objcopy", "--only-keep-debug", $file, $debug_path);
+		# No reason for this to be executable.
+		doit("chmod", 644, $debug_path);
+	}
 	return $debug_path;
 }
 
@@ -207,6 +219,12 @@
 	foreach (@static_libs) {
 		doit("strip","--strip-debug",$_);
 	}
+
+	if ($keep_debug) {
+		foreach (@symlinks) {
+			make_debug($_, $tmp, $debugtmp);
+		}
+	}
 }
 
 =head1 SEE ALSO

Reply via email to