mirror of
https://github.com/curl/curl.git
synced 2026-07-25 03:07:17 +03:00
dist: add CI job to detect files missing from distro
Also:
- delete previous, cmake-specific solution.
- move a CI script under `.github`.
Follow-up to a118a6ecdd #14323
Closes #14463
This commit is contained in:
parent
515440a2f2
commit
2edbc229cb
6 changed files with 70 additions and 35 deletions
58
.github/scripts/distfiles.sh
vendored
Executable file
58
.github/scripts/distfiles.sh
vendored
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (C) Viktor Szakats
|
||||
#
|
||||
# SPDX-License-Identifier: curl
|
||||
|
||||
# Compare git repo files with tarball files and report a mismatch
|
||||
# after excluding exceptions.
|
||||
|
||||
set -eu
|
||||
|
||||
gitonly=".git*
|
||||
^.*
|
||||
^appveyor.*
|
||||
^buildconf
|
||||
^GIT-INFO.md
|
||||
^README.md
|
||||
^renovate.json
|
||||
^REUSE.toml
|
||||
^SECURITY.md
|
||||
^LICENSES/*
|
||||
^docs/examples/adddocsref.pl
|
||||
^docs/THANKS-filter
|
||||
^projects/Windows/*
|
||||
^scripts/ciconfig.pl
|
||||
^scripts/cijobs.pl
|
||||
^scripts/contributors.sh
|
||||
^scripts/contrithanks.sh
|
||||
^scripts/delta
|
||||
^scripts/installcheck.sh
|
||||
^scripts/release-notes.pl
|
||||
^scripts/singleuse.pl
|
||||
^src/tool_hugehelp.c.cvs
|
||||
^tests/CI.md"
|
||||
|
||||
tarfiles="$(mktemp)"
|
||||
gitfiles="$(mktemp)"
|
||||
|
||||
tar -tf "$1" \
|
||||
| sed -E 's|^[^/]+/||g' \
|
||||
| grep -v -E '(/|^)$' \
|
||||
| sort > "${tarfiles}"
|
||||
|
||||
git -C "${2:-.}" ls-files \
|
||||
| grep -v -E "($(printf '%s' "${gitonly}" | tr $'\n' '|' | sed -e 's|\.|\\.|g' -e 's|\*|.+|g'))$" \
|
||||
| sort > "${gitfiles}"
|
||||
|
||||
dif="$(diff -u "${tarfiles}" "${gitfiles}" | tail -n +3 || true)"
|
||||
|
||||
rm -rf "${tarfiles:?}" "${gitfiles:?}"
|
||||
|
||||
echo 'Only in tarball:'
|
||||
echo "${dif}" | grep '^-' || true
|
||||
echo
|
||||
|
||||
echo 'Missing from tarball:'
|
||||
if echo "${dif}" | grep '^+'; then
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue