From 89ddee481cef0bbe0e8f094be134625a8dccf3d2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 13 Jan 2019 18:36:18 +0000 Subject: [PATCH] dgit: import-dsc: New test for abs/rel dsc component links Signed-off-by: Ian Jackson --- debian/tests/control | 2 +- tests/tests/import-linkorigs | 60 ++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100755 tests/tests/import-linkorigs diff --git a/debian/tests/control b/debian/tests/control index 6559071e..7f0a9082 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -68,7 +68,7 @@ Tests: trustingpolicy-replay Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, dput-ng -Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-long build-modes-source checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version pbuilder protocol-compat push-buildproductsdir push-newpackage push-newrepeat push-nextdgit push-source push-source-with-changes quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush sourceonlypolicy tag-updates unrepresentable version-opt +Tests: absurd-gitapply badcommit-rewrite build-modes build-modes-long build-modes-source checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-linkorigs import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version pbuilder protocol-compat push-buildproductsdir push-newpackage push-newrepeat push-nextdgit push-source push-source-with-changes quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush sourceonlypolicy tag-updates unrepresentable version-opt Tests-Directory: tests/tests Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime diff --git a/tests/tests/import-linkorigs b/tests/tests/import-linkorigs new file mode 100755 index 00000000..815f960b --- /dev/null +++ b/tests/tests/import-linkorigs @@ -0,0 +1,60 @@ +#!/bin/bash +set -e +. tests/lib +. $troot/lib-import-chk + +t-tstunt-parsechangelog + +t-archive-none example +v=1.0-1 + +link_src_files () { + mkdir $1 + cp $troot/pkg-srcs/${p}_* $1 + dscfn=$1/$dscleaf +} + +combo () { + case $bpdhow in + none) bpd=.. ;; + abs) bpd=$tmp/$subdir/bpd ;; + rel) bpd=../bpd ;; + *) x-unknown-bpdhow $bpdhow ;; + esac + + mkdir -p $bpd + git config --local dgit.default.build-products-dir $bpd + + dscleaf=${p}_${v}.dsc + dscfn=$troot/pkg-srcs/$dscleaf + + case $dschow in + abs) ;; + rel) link_src_files ../copies ;; + bpd) link_src_files $bpd ;; + *) x-unknown-dschow $dschow ;; + esac + + t-dgit import-dsc $dscfn +import + git reset --hard import + + t-dch-commit -v$v.1 -m 'New version' + t-dch-commit-r + t-dgit build-source +} + +for bpdhow in none rel abs; do + for dschow in rel abs; do + + subdir=$bpdhow-$dschow + mkdir $subdir + cd $subdir + + mkdir $p + cd $p + + git init + combo + cd ../.. + done +done -- 2.30.2