From 4b8a0f3f3dcf60dac2ce308ea08d413a535af29f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:12:14 +0200 Subject: Adding upstream version 5.4.4. Signed-off-by: Daniel Baumann --- tests/buildinfo.test | 656 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 656 insertions(+) create mode 100644 tests/buildinfo.test (limited to 'tests/buildinfo.test') diff --git a/tests/buildinfo.test b/tests/buildinfo.test new file mode 100644 index 0000000..e3d4c7a --- /dev/null +++ b/tests/buildinfo.test @@ -0,0 +1,656 @@ +set -u +. "$TESTSDIR"/test.inc + + +gensource() { + srcname="$1" + version="$2" + build="$3" + mkdir "${srcname}-${version}" + cd "${srcname}-${version}" + mkdir debian + cat > debian/rules <<'EOF' +#!/usr/bin/make -f +tmp = $(CURDIR)/debian/tmp +build-indep build-arch: +binary-indep binary-arch: + rm -f debian/files # prep + # wrong directory, but not relevant for the test + install -m 755 -d $(tmp)/DEBIAN $(tmp)/usr/share/doc/documentation + echo "I have told you so" > $(tmp)/usr/share/doc/documentation/NEWS + gzip -c9 debian/changelog > $(tmp)/usr/share/doc/documentation/changelog.gz + chown -R root.root $(tmp) && chmod -R go=rX $(tmp) + dpkg-gencontrol -isp + dpkg --build $(tmp) .. +clean: + rm -f debian/files +.PHONY: clean binary-arch binary-indep binary build build-indep buil-arch +EOF + chmod a+x debian/rules + cat > debian/changelog < Sat, 15 Jan 2011 17:12:05 +2700 +EOF + + cat > debian/control < +Standards-Version: Aleph_17 + +EOF + cat >> debian/control + # sadly dpkg-buildinfo does not allow faking the architecture, so this gets more ugly: + echo simulating: dpkg-buildpackage -rfakeroot -us -uc -S + fakeroot debian/rules clean + (cd .. && dpkg-source -b "${srcname}-${version}") + dpkg-genchanges --build=source > "../${srcname}_${version}_source.changes" + dpkg-genbuildinfo --build=source + dpkg-genchanges --build=source > "../${srcname}_${version}_sourceandbuild.changes" + if ! grep buildinfo "../${srcname}_${version}_sourceandbuild.changes" ; then + ed -s "../${srcname}_${version}_sourceandbuild.changes" < "../${srcname}_${version}_binary.changes" + cd .. +} + +gensource 'source-a' '1' all << EOF +Package: onlyall +Architecture: all +Description: documentation + documentation +EOF +gensource 'source-b' '2' any << EOF +Package: onlyany +Architecture: any +Description: binaries + binaries +EOF + +mkdir "source-c-3" +cd "source-c-3" +mkdir debian +cat > debian/rules <<'EOF' +#!/usr/bin/make -f +build-indep build-arch: +binary-indep binary-arch: binary-%: + rm -rf debian/tmp #prep + install -m 755 -d debian/tmp/DEBIAN debian/tmp/usr/share/doc/some$* + echo "I have told you so" > debian/tmp/usr/share/doc/some$*/NEWS + gzip -c9 debian/changelog > debian/tmp/usr/share/doc/some$*/changelog.gz + chown -R root.root debian/tmp && chmod -R go=rX debian/tmp + dpkg-gencontrol -isp -psome$* -Pdebian/tmp + dpkg --build debian/tmp .. +clean: + rm -f debian/files -r debian/tmp +.PHONY: clean binary-arch binary-indep binary build build-indep buil-arch +EOF +chmod a+x debian/rules +cat > debian/changelog < Sat, 15 Jan 2011 17:12:05 +2700 +EOF + +cat > debian/control < +Standards-Version: Aleph_17 + +Package: somearch +Architecture: any +Description: binaries + binaries + +Package: someindep +Architecture: all +Description: scripts + scripts +EOF +# sadly dpkg-buildinfo does not allow faking the architecture, so this gets more ugly: +echo simulating dpkg-buildpackage -rfakeroot -us -uc --build="full" +fakeroot debian/rules clean +(cd .. && dpkg-source -b source-c-3) +debian/rules build-arch ; debian/rules build-indep +fakeroot debian/rules binary-arch +fakeroot debian/rules binary-indep +dpkg-genbuildinfo --build=full +dpkg-genchanges --build=full > "../source-c_3_full.changes" +cd .. + +rm -r source-a-1 source-b-2 source-c-3 + +# first check include: +mkdir conf +cat > conf/options < conf/distributions < conf/distributions < conf/distributions < conf/distributions < conf/incoming <> conf/incoming <