From 2000017de47d25a6ac921e62e5d884cf204b9d4f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 30 Oct 2016 19:49:31 +0000 Subject: [PATCH] Test suite: gbp-orig: New test (for #841094) Signed-off-by: Ian Jackson --- debian/tests/control | 2 +- tests/tests/gbp-orig | 75 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100755 tests/tests/gbp-orig diff --git a/debian/tests/control b/debian/tests/control index 142488fc..a9f66649 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -21,7 +21,7 @@ Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8) Restrictions: x-dgit-git-only -Tests: absurd-gitapply build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gitconfig import-dsc import-native import-nonnative inarchivecopy mismatches-contents mismatches-dscchanges newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt +Tests: absurd-gitapply build-modes build-modes-asplit build-modes-gbp-asplit clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp distropatches-reject drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig import-dsc import-native import-nonnative inarchivecopy mismatches-contents mismatches-dscchanges newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version push-buildproductsdir push-newpackage push-nextdgit quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains rpush tag-updates test-list-uptodate trustingpolicy-replay unrepresentable version-opt Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8) diff --git a/tests/tests/gbp-orig b/tests/tests/gbp-orig new file mode 100755 index 00000000..ffc145f3 --- /dev/null +++ b/tests/tests/gbp-orig @@ -0,0 +1,75 @@ +#!/bin/bash +set -e +. tests/lib + +t-tstunt-parsechangelog + +t-archive-none example +t-git-none +t-worktree 1.0 + +cd $p + +: '----- construct an unpatched branch with patches -----' + +git checkout patch-queue/quilt-tip +gbp pq export +: 'now on quilt-tip' +git add debian/patches +git commit -m 'Commit patch queue' + +: '----- construct an upstream branch -----' + +git checkout --orphan upstream +git reset --hard +git clean -xdf + +tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig.tar.gz + +mkdir docs +cd docs +tar --strip-components=1 -xf $troot/pkg-srcs/${p}_1.0.orig-docs.tar.gz +cd .. + +git add -Af . +git commit -m 'Import 1.0' +git tag upstream/1.0 + +git checkout quilt-tip +t-git-pseudo-merge upstream + +v=1.0-1 + +: '----- let gbp build a .orig for comparison -----' + +gbp buildpackage --git-ignore-branch --git-no-sign-tags -us -uc + +mkdir ../gbp-output +mv ../*1.0* ../gbp-output/. +rm -f ../*.changes + +: '----- now do it ourselves -----' + +t-dgit -wgf --dgit-view-save=split.b gbp-build --git-ignore-branch + +t-dgit -wgf --quilt=gbp clean # gbp leaves dirty trees :-/ + +t-dgit -wgf --dgit-view-save=split.p --quilt=gbp push --new + +t-gbp-pushed-good + +: '----- check .origs are the same -----' + +# if gbp weren't weird about .gitignore we could just debdiff the .dscs + +for d in . gbp-output; do + cd $tmp/$d + mkdir tar-x + cd tar-x + tar zxf ../${p}_${v%-*}.orig.tar.gz +done + +cd $tmp +diff -ruN gbp-output/tar-x tar-x + +echo done. -- 2.30.2