set -u . "$TESTSDIR"/test.inc # first create a fake package with logs and byhand files: mkdir documentation-9876AD cd documentation-9876AD mkdir debian cat > debian/rules <<'EOF' #!/usr/bin/make tmp = $(CURDIR)/debian/tmp binary-indep: 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) .. echo "I forgot" >> ../manifesto.txt echo "What?" >> ../history.txt dpkg-distaddfile manifesto.txt byhand - dpkg-distaddfile history.txt byhand - .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: documentation Architecture: all Description: documentation documentation EOF cd .. dpkg-source -b documentation-9876AD "" cd documentation-9876AD fakeroot make -f debian/rules binary-indep > ../documentation_9876AD_coal+all.log OUTPUT=test.changes dpkg-genchanges > "$OUTPUT".pre # simulate dpkg-genchanges behaviour currently in sid so the testsuite runs for backports, too awk 'BEGIN{inheader=0} /^Files:/ || (inheader && /^ /) {inheader = 1; next} {inheader = 0 ; print}' "$OUTPUT".pre | sed -e 's/ \+$//' >../"$OUTPUT" echo "Files:" >> ../"$OUTPUT" awk 'BEGIN{inheader=0} (inheader && /^ .*\.deb$/) {print ; next} /^Files:/ || (inheader && /^ /) {inheader = 1; next} {inheader = 0 ;next}' "$OUTPUT".pre >>../"$OUTPUT" awk 'BEGIN{inheader=0} (inheader && /^ .*\.txt$/) {print ; next} /^Files:/ || (inheader && /^ /) {inheader = 1; next} {inheader = 0 ;next}' "$OUTPUT".pre >>../"$OUTPUT" awk 'BEGIN{inheader=0} /^Files:/ || (inheader && /^ .*\.(deb|txt)$/) {inheader = 1 ; next } (inheader && /^ /) {print ; next} {inheader = 0 ;next}' "$OUTPUT".pre >>../"$OUTPUT" cd .. rm -r documentation-9876AD ed -s test.changes < conf/distributions < conf/distributions <results.expected < conf/distributions <results.expected < conf/distributions <results.expected < conf/incoming <results.expected <> conf/incoming < results cat > results.expected < results cat > results.expected <> conf/distributions < conf/handle-byhand.sh <<'EOF' #!/bin/sh echo "byhand-script called with: " "'$*'" >&2 EOF cat > conf/handle-alternate.sh <<'EOF' #!/bin/sh echo "alternate-script called with: " "'$*'" >&2 EOF chmod u+x conf/handle-alternate.sh chmod u+x conf/handle-byhand.sh testrun - processincoming foo 3< results cat > results.expected < results cat > results.expected < results cat > results.expected <> conf/distributions < results cat > results.expected <