chiark / gitweb /
test suite: Work if $tmp is on a different filesystem.
[dgit.git] / tests / lib
index 42e1344ded97e3a0300f5df1ca3950e866b4dd78..7220de51534f1e4a9a513cd983539c62e9dd6287 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -62,7 +62,7 @@ t-set-using-tmp
 test -f $tmp/.save-env || \
 env -0 >$tmp/.save-env
 
-ln -f $troot/ssh ssh
+ln -sf $troot/ssh ssh
 
 export DEBCHANGE_VENDOR=dpkg
 unset VISUAL
@@ -342,7 +342,7 @@ t-archive () {
        v=$2
        local dscf=${p}_$2.dsc
        rm -f $tmp/mirror/pool/main/${p}_*
-       ln $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
+       ln -s $troot/pkg-srcs/${p}_${2%-*}* $tmp/mirror/pool/main/
        t-archive-query $suite
        rm -rf $tmp/extract
        mkdir $tmp/extract
@@ -1026,6 +1026,15 @@ t-make-badcommit () {
        t-expect-fsck-fail $badcommit
 }
 
+t-make-orig () {
+       # leaves ust set to filename of orig tarball
+       local p=$1
+       local v=$2
+       local tag=${3-v$2}
+       ust=${p}_${v}.orig.tar.gz
+       GZIP=-1 git archive -o ../$ust --prefix=${p}-${v}/ $tag
+}
+
 t-merge-conflicted-stripping-conflict-markers () {
        local otherbranch=$1
        local file=$2