summaryrefslogtreecommitdiffstats
path: root/__root__/run-sdist
blob: f818b2f963df4695990ada193e48f8299bd7405c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#/bin/sh
# for locally-commited-only round-trip,
# for pushed-code round-trip, see REPO/misc/run-sdist-per-commit
pushd "$(git rev-parse --show-toplevel)"
git archive --format=tar HEAD \
  | (
    cd $(mktemp -d '/var/tmp/pkg-XXXXX') \
      && tar xf - \
      && python2 setup.py sdist -d "${OLDPWD}/__root__/dist" \
      && T=$(ls -1t "${OLDPWD}/__root__/dist" | sed -n '1s|\.tar\.gz||p') \
      && tar cJpf "${OLDPWD}/__root__/dist/${T}-tests.tar.xz" \
         --exclude "*.vim" --transform \
         "s|^\(__root__/\)\?\(\([^.r]\|r\([^u]\|u\([^n]\|n\([^-]\|-t\)\)\)\).*\)\$|${T}/\2|" \
         -- tests/ _go _gone __root__/run-tests
      # transformation above distinguishes run-t.* (run-tests)
      # and run-[^t].* (run-dev)
  )
echo "New source tarballs created:"
ls -1t __root__/dist | head -n2
popd