From 45fad9bad87765ce13511a0ba8f302ba9ddd1cd5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 12 Jul 2018 12:57:32 +0100 Subject: test suite: Save much stuff to $AUTOPKGTEST_ARTIFACTS. We take some care to make this of reasonable size. In particular, we delete raw tarballs (typically, IMPORT) and .git's sample hooks. And, we git gc the git trees. Signed-off-by: Ian Jackson --- tests/lib | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests/lib') diff --git a/tests/lib b/tests/lib index e06ae22..87dd376 100644 --- a/tests/lib +++ b/tests/lib @@ -17,6 +17,8 @@ funcs: ${FUNCNAME[*]} lines: ${BASH_LINENO[*]} files: ${BASH_SOURCE[*]} END + t-save-artifacts + exit 16 } @@ -409,9 +411,31 @@ t-fscks () { t-ok () { : '========================================' t-fscks + t-save-artifacts echo ok. } +t-save-artifacts () { + artifacts="$AUTOPKGTEST_ARTIFACTS" + if [ x"$artifacts" = x ]; then return; fi + if [ x"tmp" = x ]; then return; fi + : '(((((((((( t-save-artifacts ))))))))))' + cp -a "$tmp"/. "$artifacts"/. + cd "$artifacts"/. + find . \( -name \*.tar -o -name \*.sample \) -print0 | \ + xargs -0r rm -v + find . \( -name .git \ + -o -path ./salsa/\* \ + -o -path ./git/\*.git \ + \) -type d \ + \! -path '*/.git/*/.git' -exec sh -xec ' + cd "$1" + "$2"/playtree-save-refs + git gc --prune=all + ' x '{}' "$troot" \; + : ')))))))))) t-save-artifacts ))))))))))' +} + t-rm-dput-dropping () { rm -f $tmp/${p}_${v}_*.upload } -- cgit v1.2.3