build: remove unpackaged hidden files

Dotfiles build failed as it is a submodule and contains ".git" and
"LICENSES". Hidden files in the base directory are normally used to
specify configuration of tools for development, not usable in packages.

For: https://github.com/ben-grande/qusal/issues/59
This commit is contained in:
Ben Grande 2024-06-24 17:11:46 +02:00
parent d0ed3a8b82
commit c0508977c7
No known key found for this signature in database
GPG key ID: 00C64E14F51F9E56
53 changed files with 222 additions and 58 deletions

View file

@ -13,7 +13,6 @@ usage(){
## Escape multiline strings for sed.
escape_key(){
key_type="${1}"
key_indent=" "
if test "${key_type}" = "scriptlet"; then
echo "${2}" | sed ':a;N;$!ba;s/\n/\\n /g' | sed 's/\$/\\$/'
elif test "${key_type}" = "text"; then
@ -44,10 +43,6 @@ get_spec(){
gen_spec(){
project="${1}"
ignored="$(git ls-files --exclude-standard --others --ignored)"
untracked="$(git ls-files --exclude-standard --others)"
unwanted="$(printf %s"${ignored}\n${untracked}\n" \
| grep "^salt/\S\+/README.md" | cut -d "/" -f2 | sort -u)"
if echo "${unwanted}" | grep -q "^${project}$"; then
echo "warn: skipping spec generation of untracked formula: ${project}" >&2
@ -139,10 +134,14 @@ esac
command -v git >/dev/null || { echo "Missing program: git" >&2; exit 1; }
cd "$(git rev-parse --show-toplevel)"
./scripts/requires-program.sh vim
spec_get="./scripts/spec-get.sh"
ignored="$(git ls-files --exclude-standard --others --ignored salt/)"
untracked="$(git ls-files --exclude-standard --others salt/)"
unwanted="$(printf %s"${ignored}\n${untracked}\n" \
| grep "^salt/\S\+/README.md" | cut -d "/" -f2 | sort -u)"
if test "${2-}" = "test"; then
gen_spec "${1}" test
exit