From 7adb1a2ff884501c97fbb92b4b91337929c047fd Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 13 Jan 2019 18:35:53 +0000 Subject: dgit: import-dsc: Handle relative symlinks correctly The logic here was correct only with bpd = `..'. Closes: #913259 Signed-off-by: Ian Jackson squash!! dgit: import-dsc: Handle relative symlinks correctly --- tests/tests/import-dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/tests/import-dsc b/tests/tests/import-dsc index bdd849c..4a8d876 100755 --- a/tests/tests/import-dsc +++ b/tests/tests/import-dsc @@ -79,7 +79,7 @@ dsc=$troot/pkg-srcs/${p}_${v}.dsc cd $p.2 cp $dsc .. -t-expect-fail 'it does not exist' \ +t-expect-fail 'No such file or directory' \ check-import .. $v mkdir ../enoents -- cgit v1.2.3 From 89ddee481cef0bbe0e8f094be134625a8dccf3d2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 13 Jan 2019 18:36:18 +0000 Subject: dgit: import-dsc: New test for abs/rel dsc component links Signed-off-by: Ian Jackson --- tests/tests/import-linkorigs | 60 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 tests/tests/import-linkorigs (limited to 'tests') diff --git a/tests/tests/import-linkorigs b/tests/tests/import-linkorigs new file mode 100755 index 0000000..815f960 --- /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 -- cgit v1.2.3