From: Petr Špaček Date: Tue, 28 Nov 2017 10:27:43 +0000 (+0100) Subject: scripts: pack all submodules with make-archive.sh X-Git-Tag: v1.5.1~12^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d550f8dba41b7aa8c8d3ca944958fbed4ed36b8;p=thirdparty%2Fknot-resolver.git scripts: pack all submodules with make-archive.sh It does not make sense to create "distribution" tarball with dirty working tree or missing submodules, so this is now forbidden. make-archive.sh requires clean working tree and all submodules. Packing all submodules prevents us from releasing incomplete tarball, especially around release time. Distributions like Fedora are gradually getting ability to run integration test suites so it does not hurt to pack everything including test. --- diff --git a/scripts/make-archive.sh b/scripts/make-archive.sh index 4a66f17f9..1f8b41ead 100755 --- a/scripts/make-archive.sh +++ b/scripts/make-archive.sh @@ -1,13 +1,15 @@ #!/bin/sh -e # Create a distribution tarball, like 'make dist' from autotools. +cd "$(git rev-parse --show-toplevel)" ver="$(git describe | sed 's/^v//')" -# 'git ls-files --recurse-submodules' fails, unfortunately -files="$( - git ls-files - cd modules/policy/lua-aho-corasick/ - git ls-files | sed 's|^|modules/policy/lua-aho-corasick/|' - )" +test 0 -ne $(git status --porcelain | wc -l) && \ + echo "Git working tree is dirty, make it clean first" && \ + exit 1 +git submodule status --recursive | grep -q '^[^ ]' && \ + echo "Git submodules are dirty, run: git submodule update --recursive --init" && \ + exit 2 + +# 'git ls-files --recurse-submodules' works only if modules are initialized name="knot-resolver-$ver" -tar caf "$name.tar.xz" --no-recursion --transform "s|^|$name/|" -- $files +tar caf "$name.tar.xz" --no-recursion --transform "s|^|$name/|" -- $(git ls-files --recurse-submodules) echo "$name.tar.xz" -