| 1 |
#!/bin/bash -e |
| 2 |
ver="9.11" |
| 3 |
repo=https://github.com/coreutils/coreutils |
| 4 |
curl -L "${repo}/releases/download/v${ver}/coreutils-${ver}.tar.xz" | tar --strip-components=1 -xJf - |
| 5 |
|
| 6 |
# TODO stop backporting tests from master at GNU coreutils > $ver |
| 7 |
backport=( |
| 8 |
cat/splice.sh # split tests |
| 9 |
dd/fail-ftruncate-fstat.sh # remove LD_PRELOAD |
| 10 |
dd/stderr.sh # replace GNU/test binary by uutils/test |
| 11 |
misc/close-stdout.sh # fix hardcoded pathes to GNU executables |
| 12 |
misc/uname-labeled.sh # uname -A/--all-labeled, added after $ver |
| 13 |
nproc/nproc-quota.sh # remove LD_PRELOAD |
| 14 |
misc/empty-backup-suffix.sh |
| 15 |
) |
| 16 |
for f in "${backport[@]}" |
| 17 |
do curl -L ${repo}/raw/refs/heads/master/tests/$f > tests/$f |
| 18 |
done |
| 19 |
|
| 20 |
# A test that does not exist in $ver at all is absent from its test list, so |
| 21 |
# `make check` would silently never run it. Register those in both the automake |
| 22 |
# input and the generated Makefile.in: configure derives Makefile from the |
| 23 |
# latter, and build-gnu.sh deliberately keeps automake from re-running. |
| 24 |
for f in "${backport[@]}"; do |
| 25 |
grep -qF "tests/$f" tests/local.mk || |
| 26 |
sed -i "s|^all_tests =.*|&\n tests/$f\t\t\t\t\\\\|" tests/local.mk |
| 27 |
grep -qF "tests/$f" Makefile.in || |
| 28 |
sed -i "s|^all_tests =.*|&\n tests/$f\t\t\t\t\\\\|" Makefile.in |
| 29 |
done |