diff -Nru pkg-create-dbgsym-0.65/debian/changelog pkg-create-dbgsym-0.67/debian/changelog --- pkg-create-dbgsym-0.65/debian/changelog 2014-07-26 21:10:32.000000000 +0000 +++ pkg-create-dbgsym-0.67/debian/changelog 2015-04-30 14:12:05.000000000 +0000 @@ -1,3 +1,37 @@ +pkg-create-dbgsym (0.67) vivid; urgency=medium + + * testsuite: Add dhtest.customdbgsym for a package that produces its own + -dbgsym package, like our "linux" source package. Reproduces LP #1450464. + * pkg_create_dbgsym: When called with -B (i. e. from dh_strip), create a + marker for dh_gencontrol, so that the latter does not try to process + custom -dbgsym binaries. (LP: #1450464) + * dh_strip: Don't try to process *-dbgsym binaries. + + -- Martin Pitt Thu, 30 Apr 2015 16:12:05 +0200 + +pkg-create-dbgsym (0.66) vivid; urgency=medium + + * testsuite: Enable dhtest.versionoverride, and verify that ddeb has exact + same version as the corresponding deb. Reproduces LP #1448247. + * testsuite: Add "manualtest" which builds a package without debhelper or + any other abstractions, and calls pkg_create_dbgsym directly. + * pkg_create_dbgsym: Add -B option for only building the ddeb package dir in + debian/ but not building the .ddeb package yet. This keeps the default + behaviour for packages which call this manually, but allows us to modify + the ddeb package directory later during the package build process. + * Handle binary packages with different version than the source: + - Add our own dh_gencontrol wrapper which adjusts the ddeb's versions + after the original dh_gencontrol determined the final binary version of + the original debs, and then builds the .ddebs. + - dh_strip: Call pkg_create_dbgsym with -B, so that we move the actual + .ddeb generation into dh_gencontrol. + - preinst, postrm: Divert dh_gencontrol. + - LP: #1448247 + * debian/control: Drop obsolete (pre-lucid) Build-Conflicts. + * Bump Standards-Version to 3.9.6 (no changes required). + + -- Martin Pitt Tue, 28 Apr 2015 16:05:41 +0200 + pkg-create-dbgsym (0.65) utopic; urgency=medium * Check each element of Architecture separately using dpkg-architecture, diff -Nru pkg-create-dbgsym-0.65/debian/control pkg-create-dbgsym-0.67/debian/control --- pkg-create-dbgsym-0.65/debian/control 2014-07-26 21:09:15.000000000 +0000 +++ pkg-create-dbgsym-0.67/debian/control 2015-04-27 11:09:43.000000000 +0000 @@ -6,8 +6,7 @@ gdb, cdbs Maintainer: Martin Pitt -Standards-Version: 3.9.4 -Build-Conflicts: pkgbinarymangler (<< 66~) +Standards-Version: 3.9.6 Package: pkg-create-dbgsym Architecture: all @@ -16,7 +15,7 @@ pkg_create_dbgsym builds a debug symbol ddeb for a given package in a built source tree and adds it to debian/files. . - This package diverts and wraps debhelper's dh_strip. It automatically - calls pkg_create_dbgsym for all packages dh_strip is asked to act on. - As a result, by merely installing this package on buildds, all + This package diverts and wraps debhelper's dh_strip and dh_gencontrol. It + automatically calls pkg_create_dbgsym for all packages dh_strip is asked to + act on. As a result, by merely installing this package on buildds, all packages will automatically get ddebs built. diff -Nru pkg-create-dbgsym-0.65/debian/pkg-create-dbgsym.install pkg-create-dbgsym-0.67/debian/pkg-create-dbgsym.install --- pkg-create-dbgsym-0.65/debian/pkg-create-dbgsym.install 2014-07-26 21:09:15.000000000 +0000 +++ pkg-create-dbgsym-0.67/debian/pkg-create-dbgsym.install 2015-04-27 10:57:17.000000000 +0000 @@ -1,2 +1,3 @@ dh_strip usr/bin +dh_gencontrol usr/bin pkg_create_dbgsym usr/bin diff -Nru pkg-create-dbgsym-0.65/debian/pkg-create-dbgsym.lintian-overrides pkg-create-dbgsym-0.67/debian/pkg-create-dbgsym.lintian-overrides --- pkg-create-dbgsym-0.65/debian/pkg-create-dbgsym.lintian-overrides 2014-07-26 21:09:15.000000000 +0000 +++ pkg-create-dbgsym-0.67/debian/pkg-create-dbgsym.lintian-overrides 2015-04-27 10:57:17.000000000 +0000 @@ -1 +1,2 @@ pkg-create-dbgsym: binary-without-manpage usr/bin/dh_strip +pkg-create-dbgsym: binary-without-manpage usr/bin/dh_gencontrol diff -Nru pkg-create-dbgsym-0.65/debian/postrm pkg-create-dbgsym-0.67/debian/postrm --- pkg-create-dbgsym-0.65/debian/postrm 2014-07-26 21:09:15.000000000 +0000 +++ pkg-create-dbgsym-0.67/debian/postrm 2015-04-27 10:57:17.000000000 +0000 @@ -6,6 +6,7 @@ remove|purge) # Remove our diversion dpkg-divert --remove --rename --package pkg-create-dbgsym --divert /usr/bin/dh_strip.pkg-create-dbgsym /usr/bin/dh_strip > /dev/null + dpkg-divert --remove --rename --package pkg-create-dbgsym --divert /usr/bin/dh_gencontrol.pkg-create-dbgsym /usr/bin/dh_gencontrol > /dev/null ;; upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) diff -Nru pkg-create-dbgsym-0.65/debian/preinst pkg-create-dbgsym-0.67/debian/preinst --- pkg-create-dbgsym-0.65/debian/preinst 2014-07-26 21:09:15.000000000 +0000 +++ pkg-create-dbgsym-0.67/debian/preinst 2015-04-27 10:57:17.000000000 +0000 @@ -5,6 +5,7 @@ case "$1" in install|upgrade) dpkg-divert --add --rename --package pkg-create-dbgsym --divert /usr/bin/dh_strip.pkg-create-dbgsym /usr/bin/dh_strip > /dev/null + dpkg-divert --add --rename --package pkg-create-dbgsym --divert /usr/bin/dh_gencontrol.pkg-create-dbgsym /usr/bin/dh_gencontrol > /dev/null ;; abort-upgrade) diff -Nru pkg-create-dbgsym-0.65/dh_gencontrol pkg-create-dbgsym-0.67/dh_gencontrol --- pkg-create-dbgsym-0.65/dh_gencontrol 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/dh_gencontrol 2015-04-30 13:50:37.000000000 +0000 @@ -0,0 +1,211 @@ +#!/bin/sh +# wrapper around dh_gencontrol that updates the binary version of corresponding +# ddebs +# +# Author: Martin Pitt +# (C) 2015 Canonical Ltd. +# +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +set -e + +DEBUG=1 + +if [ -x /usr/bin/dh_gencontrol.pkg-create-dbgsym ]; then + REAL_DHGENCONTROL=/usr/bin/dh_gencontrol.pkg-create-dbgsym +elif [ "$0" != /usr/bin/dh_gencontrol ]; then + # called as "dh_gencontrol" somewhere before /usr/bin in the PATH, e.g. + # from the testsuite during package build + REAL_DHGENCONTROL=/usr/bin/dh_gencontrol + if ! [ -x "$REAL_DHGENCONTROL" ]; then + echo "FATAL: Can't run /usr/bin/dh_gencontrol; is debhelper installed?" >&2 + exit 1 + fi +else + echo "FATAL: Can't find the diverted original dh_gencontrol and /usr/bin/dh_gencontrol loops back to myself!" >&2 + exit 1 +fi + +# call real dh_gencontrol first, so that it will set correct package versions +$REAL_DHGENCONTROL "$@" + +HOSTARCH=`dpkg-architecture -qDEB_HOST_ARCH` + +# print debug message +dbg() { + [ -n "$DEBUG" ] || return 0 + echo "dh_gencontrol debug symbol wrapper: $@" +} + +# return 0 if $1 is in the string list $2, otherwise return 1 +in_list() +{ + echo "$2" | grep -q "\(^\|[[:space:]]\)$1\(\$\|[[:space:]]\)" +} + +# get set of all architecture dependent packages from debian/control +packages=$( + unset pkg + sed -n 's/[[:space:]]*$//; s/^\(Package\|Architecture\):[[:space:]]*\(.\+\)/\1 \2/p' debian/control | while read key val; do + if [ "$key" = Package ]; then + [ -z "$pkg" ] || { + echo "Error: Package: and Architecture: do not alternate in debian/control" >&2 + exit 1 + } + pkg="$val" + fi + if [ "$key" = Architecture ]; then + [ -n "$pkg" ] || { + echo "Error: Package: and Architecture: do not alternate in debian/control" >&2 + exit 1 + } + for arch in $val; do + if dpkg-architecture -a"$HOSTARCH" -i"$arch"; then + printf "$pkg " + break + fi + done + unset pkg + fi + done +) +dbg "all non-arch-all packages for this build platform $HOSTARCH: $packages" + +# parse command line to determine set of packages to act on +for p in $DH_OPTIONS $@; do + if [ -n "$next_arg_is_xopt" ]; then + xopts="$xopts -X$p" + unset next_arg_is_xopt + continue + fi + + p=${p#-O} + case "$p" in + -i|--indep) + unset actpkgs + optsel=1 + ;; + -a|--arch|-s|--same-arch) + actpkgs="$packages" + optsel=1 + ;; + -p*|--package=*) + pkg=${p#--package=} + pkg=${pkg#-p} + if ! in_list "$pkg" "$actpkgs" && in_list "$pkg" "$packages"; then + actpkgs="$pkg $actpkgs" + fi + optsel=1 + ;; + -N*|--no-package=*) + pkg=${p#--no-package=} + pkg=${pkg#-N} + if ! in_list "$pkg" "$ignorepkgs"; then + ignorepkgs="$pkg $ignorepkgs" + fi + ;; + -P*|--tmpdir=*) + pkgdirarg=${p#--tmpdir=} + pkgdirarg=${pkgdirarg#-P} + dbg "-P/--tmpdir option: setting temporary package dir to $pkgdirarg" + ;; + -X) + next_arg_is_xopt=1 + ;; + -X*) + xopts="$xopts $p" + ;; + esac +done + +[ -n "$optsel" ] || actpkgs="$packages" + +dbg "packages to act on: $actpkgs" +dbg "ignored packages: $ignorepkgs" + +# check for debhelper compat level 1 +dhcompat1=1 +if [ -e debian/compat ]; then + if [ "`cat debian/compat`" != 1 ]; then + unset dhcompat1 + fi +fi +if grep -q '^[[:space:]]*\(export[[:space:]]*\)\?DH_COMPAT[[:space:]]*:\?=[[:space:]]*[2-9]\>' debian/rules; then + unset dhcompat1 +elif grep -q '^[[:space:]]*\(export[[:space:]]*\)\?DH_COMPAT[[:space:]]*:\?=[[:space:]]*1\>' debian/rules; then + dhcompat1=1 +fi + +if [ -n "$dhcompat1" ]; then + first_control_pkg="`grep -m 1 ^Package debian/control | cut -f2- -d\ `" + dbg "using obsolete debhelper compat mode 1" +fi + +# process all packages +for p in $actpkgs; do + if in_list "$p" "$ignorepkgs" || + echo $p | grep -q -- '-dbg$' ; then + continue + fi + + if [ -n "$pkgdirarg" ]; then + pkgdir="$pkgdirarg" + elif [ -n "$dhcompat1" -a $p = "$first_control_pkg" ]; then + pkgdir=debian/tmp + else + pkgdir=debian/$p + fi + + ddebpkgdir=debian/${p}-dbgsym + if [ ! -d $ddebpkgdir ]; then + dbg "no $ddebpkgdir, skipping package $p" + continue + fi + + auto_stamp=$ddebpkgdir/DEBIAN/auto.pkg-create-dbgsym + if [ ! -e $auto_stamp ]; then + dbg "$ddebpkgdir not produced by pkg_create_dbgsym dh_strip wrapper, skipping package $p" + continue + fi + rm $auto_stamp + + dbg "processing package $p (pkgdir $pkgdir, ddeb package dir $ddebpkgdir)" + + # adjust ddeb version from deb, for dpkg-gencontrol's -v option + debversion=`grep '^Version:' $pkgdir/DEBIAN/control | cut -f2- -d\ ` + sed -i "s/^Version: .*\$/Version: $debversion/; /^Depends:/ s/(= .*)/(= $debversion)/" $ddebpkgdir/DEBIAN/control + # add Source: version too, if binary version is different + srcversion=`dpkg-parsechangelog -SVersion` + if [ "$debversion" != "$srcversion" ]; then + sed -i "/^Source:/ s/\$/ ($srcversion)/" $ddebpkgdir/DEBIAN/control + fi + + # build .ddeb from its package directory + ddebarch=`grep '^Architecture:' $ddebpkgdir/DEBIAN/control | cut -f2- -d\ ` + ddebsection=`grep '^Section:' $ddebpkgdir/DEBIAN/control | cut -f2- -d\ ` + ddebpriority=`grep '^Priority:' $ddebpkgdir/DEBIAN/control | cut -f2- -d\ ` + ddeb="${p}-dbgsym_${debversion#*:}_${ddebarch}.ddeb" + dbg "building $ddeb" + NO_PKG_MANGLE=1 dpkg-deb -Zxz --build $ddebpkgdir ../$ddeb + add_to_files_stamp=$ddebpkgdir/DEBIAN/add_to_files.pkg-create-dbgsym + if [ -e $add_to_files_stamp ]; then + rm $add_to_files_stamp + dbg "dpkg-distaddfile $ddeb $ddebsection $ddebpriority" + dpkg-distaddfile "$ddeb" "$ddebsection" "$ddebpriority" + fi + + # clean up ddeb pkg dir, since this package does not appear in debian/control + rm -rf "$ddebpkgdir" +done diff -Nru pkg-create-dbgsym-0.65/dh_strip pkg-create-dbgsym-0.67/dh_strip --- pkg-create-dbgsym-0.65/dh_strip 2014-07-26 21:09:38.000000000 +0000 +++ pkg-create-dbgsym-0.67/dh_strip 2015-04-30 13:57:49.000000000 +0000 @@ -197,7 +197,7 @@ # process all packages for p in $actpkgs; do if in_list "$p" "$ignorepkgs" || - echo $p | grep -q -- '-dbg$' ; then + echo $p | grep -Eq -- '-(dbg|dbgsym)$' ; then continue fi @@ -209,7 +209,10 @@ pkgdir=debian/$p fi - pkg_create_dbgsym $addtofiles $xopts $p $pkgdir "$nodebuglink" + # if the package calls dh_strip, we assume/require it also calls + # dh_gencontrol; so call in "don't build .ddeb package file" mode so that + # dh_gencontrol can update the version + pkg_create_dbgsym -B $addtofiles $xopts $p $pkgdir "$nodebuglink" done exec $REAL_DHSTRIP "$@" diff -Nru pkg-create-dbgsym-0.65/pkg_create_dbgsym pkg-create-dbgsym-0.67/pkg_create_dbgsym --- pkg-create-dbgsym-0.65/pkg_create_dbgsym 2014-07-26 21:09:15.000000000 +0000 +++ pkg-create-dbgsym-0.67/pkg_create_dbgsym 2015-04-30 13:50:13.000000000 +0000 @@ -24,6 +24,7 @@ # evaluate options blacklist="" add_to_files=0 +build_ddeb=1 DEB_HOST_GNU_TYPE=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) @@ -49,6 +50,14 @@ add_to_files=1 shift ;; + -B) + build_ddeb=0 + shift + ;; + -*) + echo "ERROR: Unknown option $p" >&2 + exit 1 + ;; *) break ;; @@ -98,6 +107,11 @@ dp="debian/${pkgname}-dbgsym" # debug package path dp=`readlink -f "$dp"` # debug package path +if [ -d "$dp" ]; then + echo "pkg_create_dbgsym: $dp already exists, ignoring" + exit 0 +fi + if [ -e "debian/compat" ] && [ "`cat debian/compat`" -ge 9 ]; then use_buildid="1" echo "Using buildid for compat level >= 9" @@ -193,9 +207,20 @@ echo "Error: parsed ddeb section or priority is empty" >&2 exit 1 } -ddeb="${ddebname}_${ddebversion}_${ddebarch}.ddeb" + +if [ "$build_ddeb" != "1" ]; then + dbg "deferring build of .ddeb to dh_gencontrol" + # leave marker to tell dh_gencontrol to process this + touch $dp/DEBIAN/auto.pkg-create-dbgsym + # leave marker for $add_to_files for dh_gencontrol to pick up + if [ "$add_to_files" = "1" ]; then + touch $dp/DEBIAN/add_to_files.pkg-create-dbgsym + fi + exit 0 +fi # build .ddeb and add it to debian/files +ddeb="${ddebname}_${ddebversion}_${ddebarch}.ddeb" dbg "building ddeb package" NO_PKG_MANGLE=1 dpkg-deb -Zxz --build $dp ../$ddeb if [ "$add_to_files" = "1" ]; then diff -Nru pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/changelog pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/changelog --- pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/changelog 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/changelog 2015-04-30 13:17:47.000000000 +0000 @@ -0,0 +1,5 @@ +dhtest.customdbgsym (1:2.3-1) foo; urgency=low + + * Initial release. + + -- Martin Pitt Fri, 16 Jun 2006 10:49:56 +0200 diff -Nru pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/compat pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/compat --- pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/compat 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/compat 2015-04-30 13:06:49.000000000 +0000 @@ -0,0 +1 @@ +5 diff -Nru pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/control pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/control --- pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/control 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/control 2015-04-30 13:46:59.000000000 +0000 @@ -0,0 +1,18 @@ +Source: dhtest.customdbgsym +Section: utils +Priority: extra +Maintainer: Martin Pitt +Build-Depends: debhelper (>= 4.1.0) +Standards-Version: 3.7.2 + +Package: dhtest1 +Architecture: any +Depends: ${shlibs:Depends} +Description: crash with a SIGFPE + Test package + +Package: dhtest1-dbgsym +Architecture: any +Depends: dhtest1 (= ${binary:Version}) +Description: debug symbols for package dhtest1 + Test package (custom debug symbols) diff -Nru pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/copyright pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/copyright --- pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/copyright 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/copyright 2015-04-30 13:06:49.000000000 +0000 @@ -0,0 +1 @@ +foo diff -Nru pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/rules pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/rules --- pkg-create-dbgsym-0.65/tests/dhtest.customdbgsym/debian/rules 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/dhtest.customdbgsym/debian/rules 2015-04-30 13:38:32.000000000 +0000 @@ -0,0 +1,43 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +clean: + dh_testdir + dh_testroot + dh_clean + +install: install-arch + +install-arch: + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + install -d debian/dhtest1/lib/dhtest + echo 'sys64738' > debian/dhtest1/lib/dhtest/someprog + install -d debian/dhtest1-dbgsym/usr/lib/debug/ + echo 'debug sys64738' > debian/dhtest1-dbgsym/usr/lib/debug/someprog + +binary-arch: install-arch + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + D=$$(ls ../dhtest1-dbgsym_*.deb); mv $$D $${D%deb}ddeb + sed -i '/^dhtest1-dbgsym/ s/\.deb/\.ddeb/' debian/files + +binary: binary-arch +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch diff -Nru pkg-create-dbgsym-0.65/tests/manualtest/crash2.c pkg-create-dbgsym-0.67/tests/manualtest/crash2.c --- pkg-create-dbgsym-0.65/tests/manualtest/crash2.c 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/manualtest/crash2.c 2015-04-27 10:34:45.000000000 +0000 @@ -0,0 +1,39 @@ +/* crash.c - demo program for libcrashreport + + (c) 2004 Martin Pitt + + This file is public domain. +*/ + +#include +#include +#include + +double h() +{ + double a = 1./0; + if (isinf(a)) + raise(SIGFPE); + return a; +} + +int g( int x, int y ) +{ + + return x+y+(int) h(); +} + +int f( int x ) +{ + return g( x, 42 ); +} + +int +main() +{ + int x; + + x = f(1); + printf( "x = %i, terminating normally now.\n", x ); + return 0; +} diff -Nru pkg-create-dbgsym-0.65/tests/manualtest/crash.c pkg-create-dbgsym-0.67/tests/manualtest/crash.c --- pkg-create-dbgsym-0.65/tests/manualtest/crash.c 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/manualtest/crash.c 2015-04-27 10:34:45.000000000 +0000 @@ -0,0 +1,34 @@ +/* crash.c - demo program for libcrashreport + + (c) 2004 Martin Pitt + + This file is public domain. +*/ + +#include + +void h(char* p) { + p[1] = 'a'; +} + +int g( int x, int y ) +{ + char* s = NULL; + h(s); + return x+y; +} + +int f( int x ) +{ + return g( x, 42 ); +} + +int +main() +{ + int x; + + x = f(1); + printf( "x = %i, terminating normally now.\n", x ); + return 0; +} diff -Nru pkg-create-dbgsym-0.65/tests/manualtest/debian/changelog pkg-create-dbgsym-0.67/tests/manualtest/debian/changelog --- pkg-create-dbgsym-0.65/tests/manualtest/debian/changelog 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/manualtest/debian/changelog 2015-04-27 10:35:10.000000000 +0000 @@ -0,0 +1,5 @@ +manualtest (1:2.3-1) foo; urgency=low + + * Initial release. + + -- Martin Pitt Fri, 16 Jun 2006 10:49:56 +0200 diff -Nru pkg-create-dbgsym-0.65/tests/manualtest/debian/compat pkg-create-dbgsym-0.67/tests/manualtest/debian/compat --- pkg-create-dbgsym-0.65/tests/manualtest/debian/compat 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/manualtest/debian/compat 2015-04-27 10:34:45.000000000 +0000 @@ -0,0 +1 @@ +5 diff -Nru pkg-create-dbgsym-0.65/tests/manualtest/debian/control pkg-create-dbgsym-0.67/tests/manualtest/debian/control --- pkg-create-dbgsym-0.65/tests/manualtest/debian/control 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/manualtest/debian/control 2015-04-27 10:47:14.000000000 +0000 @@ -0,0 +1,11 @@ +Source: manualtest +Section: utils +Priority: extra +Maintainer: Martin Pitt +Standards-Version: 3.7.2 + +Package: dhtest1 +Architecture: any +Depends: ${shlibs:Depends}, coreutils +Description: crash with a SIGSEGV + Test package diff -Nru pkg-create-dbgsym-0.65/tests/manualtest/debian/copyright pkg-create-dbgsym-0.67/tests/manualtest/debian/copyright --- pkg-create-dbgsym-0.65/tests/manualtest/debian/copyright 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/manualtest/debian/copyright 2015-04-27 10:34:45.000000000 +0000 @@ -0,0 +1 @@ +foo diff -Nru pkg-create-dbgsym-0.65/tests/manualtest/debian/rules pkg-create-dbgsym-0.67/tests/manualtest/debian/rules --- pkg-create-dbgsym-0.65/tests/manualtest/debian/rules 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/manualtest/debian/rules 2015-04-27 10:51:45.000000000 +0000 @@ -0,0 +1,43 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +build: build-arch + +build-arch: build-arch-stamp +build-arch-stamp: + $(MAKE) + touch build-arch-stamp + +clean: + rm -f build-arch-stamp build-indep-stamp debian/substvars debian/files + -$(MAKE) clean + rm -rf debian/tmp + +install: install-arch +install-arch: + $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + +binary-arch: build-arch install-arch + mkdir -p debian/tmp/usr/share/doc/dhtest1/ + gzip -c debian/changelog > debian/tmp/usr/share/doc/dhtest1/changelog.Debian.gz + install -p -m 644 -D debian/copyright debian/tmp/usr/share/doc/dhtest1/copyright + pkg_create_dbgsym -a dhtest1 debian/tmp/ + strip --remove-section=.comment --remove-section=.note --strip-unneeded debian/tmp/usr/bin/* + mkdir -p debian/tmp/DEBIAN + dpkg-shlibdeps debian/tmp/usr/bin/crash + dpkg-gencontrol + dpkg --build debian/tmp .. + +binary: binary-arch + +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch diff -Nru pkg-create-dbgsym-0.65/tests/manualtest/Makefile pkg-create-dbgsym-0.67/tests/manualtest/Makefile --- pkg-create-dbgsym-0.65/tests/manualtest/Makefile 1970-01-01 00:00:00.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/manualtest/Makefile 2015-04-27 10:34:45.000000000 +0000 @@ -0,0 +1,18 @@ +CFLAGS= -g -Wall -W -O0 + +LIBNAME=crashrep + +all: crash crash2 + +crash: crash.o + $(CC) $^ -o $@ + +crash2: crash2.o + $(CC) $^ -o $@ + +clean: + rm -f *.o crash crash2 + +install: all + install -d $(DESTDIR)/usr/bin + install crash crash2 $(DESTDIR)/usr/bin diff -Nru pkg-create-dbgsym-0.65/tests/run pkg-create-dbgsym-0.67/tests/run --- pkg-create-dbgsym-0.65/tests/run 2014-07-26 21:09:15.000000000 +0000 +++ pkg-create-dbgsym-0.67/tests/run 2015-04-30 13:45:57.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -e -TESTSOURCES="dhtest dhtest.doublestrip dhtest.samename dhtest.substvars dhtest.whitespace dhtest.nostrip dhtest.noargs dhtest.archspecific dhtest.tmpdirarg dhtest.compat1 dhtest.compat1override dhtest.compatenvvar dhtest.dbg dhtest.dbg.buildid dhtest.dbg2 dhtest.dbg3 dhtest.pydbg dhtest.dbg.empty cdbstest" +TESTSOURCES="dhtest dhtest.doublestrip dhtest.samename dhtest.substvars dhtest.whitespace dhtest.nostrip dhtest.noargs dhtest.archspecific dhtest.tmpdirarg dhtest.compat1 dhtest.compat1override dhtest.compatenvvar dhtest.dbg dhtest.dbg.buildid dhtest.dbg2 dhtest.dbg3 dhtest.pydbg dhtest.dbg.empty dhtest.versionoverride dhtest.customdbgsym cdbstest manualtest" print_result() { if [ -n "$fail" ]; then @@ -81,10 +81,16 @@ check_command "fakeroot debian/rules clean" "Cleaning source package $s" # debhelper compat 1 leaves debhelper.log behind, work around rm -f debian/debhelper.log + SRCVERSION=`dpkg-parsechangelog -SVersion` cd .. # check for leftovers check_command "diff -ur $s ../$s" "No leftover files after cleaning $s" + if [ "${s%customdbgsym*}" != "$s" ]; then + echo "skipping ddeb check for custom -dbgsym test" + continue + fi + dbg_pkgs='' for deb in *.deb; do @@ -116,13 +122,19 @@ DBGSYMNAME=`echo $ddeb|cut -d_ -f1` PKGNAME=${DBGSYMNAME%-dbgsym} PKGDEB=`echo $ddeb | sed 's/-dbgsym_/_/; s/\.ddeb/.deb/'` + DEBINFO=`dpkg -I $PKGDEB` + DEBVERSION=`echo "$DEBINFO" | grep "^[[:space:]]*Version:" | cut -f3 -d' '` PKGLIST=`dpkg -c $ddeb` PKGLIST=`echo "$PKGLIST" | grep -v ' \./$'` || true echo "$INFO" | egrep -q '^[[:space:]]*(Pre-Depends|Recommends|Suggests|Provides|Replaces|Conflicts|Breaks|Essential):' && fail=1 || true print_result "$ddeb has other dependencies stripped" "$INFO" - echo "$INFO" | grep -q "^[[:space:]]*Source: $s\$" || fail=1 + if [ "$DEBVERSION" = "$SRCVERSION" ]; then + echo "$INFO" | grep -q "^[[:space:]]*Source: $s\$" || fail=1 + else + echo "$INFO" | grep -q "^[[:space:]]*Source: $s ($SRCVERSION)\$" || fail=1 + fi print_result "$ddeb has a correct Source field" "$INFO" echo "$INFO" | grep -A1 "^[[:space:]]*Section: [a-zA-Z0-0]\+\$" | tail -n1 | grep -q '^[[:space:]]*Priority: '|| fail=1 @@ -131,6 +143,9 @@ echo "$INFO" | grep -q "^[[:space:]]*Description: debug symbols for package $PKGNAME\$" || fail=1 print_result "$ddeb has a correct (short) Description field" "$INFO" + [ "$VERSION" = "$DEBVERSION" ] || fail=1 + print_result "$ddeb has correct binary version $DEBVERSION" "$VERSION" + if [ -n "$dbg_pkgs" ]; then # if we already have a -dbg, the -dbgsym packages should be empty dummy # packages that merely depend on the -dbg packages; we already