diff -Nru pkg-create-dbgsym-0.42/debian/changelog pkg-create-dbgsym-0.43/debian/changelog --- pkg-create-dbgsym-0.42/debian/changelog 2010-04-22 09:36:38.000000000 +0100 +++ pkg-create-dbgsym-0.43/debian/changelog 2010-04-26 13:00:42.000000000 +0100 @@ -1,3 +1,12 @@ +pkg-create-dbgsym (0.43) lucid-proposed; urgency=low + + * pkg_create_dbgsym: Do not check debian/files for whether we already + processed a .ddeb, since Launchpad Soyuz disables dpkg-distaddfile for + ddebs still. Instead, skip the run if we do not find any unstripped binary + in the current package. (LP: #562418) + + -- Martin Pitt Mon, 26 Apr 2010 14:00:38 +0200 + pkg-create-dbgsym (0.42) lucid; urgency=low * Add tests/dhtest.doublestrip/: Call dh_strip twice, to check whether this diff -Nru pkg-create-dbgsym-0.42/pkg_create_dbgsym pkg-create-dbgsym-0.43/pkg_create_dbgsym --- pkg-create-dbgsym-0.42/pkg_create_dbgsym 2010-04-22 09:26:07.000000000 +0100 +++ pkg-create-dbgsym-0.43/pkg_create_dbgsym 2010-04-26 12:54:31.000000000 +0100 @@ -60,16 +60,15 @@ dp="debian/${pkgname}-dbgsym" # debug package path dp=`readlink -f "$dp"` # debug package path -if grep -q "^$pkgname-dbgsym_.*\.ddeb" debian/files; then - echo "ddeb for $pkgname already exists, ignoring" >&2 - exit 0 -fi - # find all ELF files and extract their debug symbols; also add debug links -# to original files +# to original files; if we do not find any unstripped files, then a likely +# cause is that we already ran this program on the current package, in which +# case we must not run it again to not destroy debug link CRC sums and produce +# empty ddebs +unset any_unstripped origdir=`pwd` cd $p -find -type f | while read f; do +find -type f | ( while read f; do # ignore static libraries if echo "$f" | grep -q '\.[ao]$'; then continue; fi # ignore non-ELF files @@ -78,6 +77,11 @@ if [ -n "$blacklist" ]; then if echo "$f" | fgrep -q "$blacklist"; then continue; fi fi + if ! readelf -S "$f" | grep -q ' .debug_'; then + # no debug information + continue + fi + any_unstripped=1 mkdir -p $dp/usr/lib/debug/`dirname "$f"` objcopy --only-keep-debug "$f" "$dp/usr/lib/debug/$f" || { @@ -89,6 +93,12 @@ exit 1 } done +if [ -z "$any_unstripped" ]; then + echo "$pkgname is already stripped, ignoring" >&2 + rm -rf $dp + exit 0 +fi +) cd $origdir if [ ! -d "$dp" ] || [ -z "`find $dp -type f`" ]; then