diff options
Diffstat (limited to 'aux/workflow')
-rwxr-xr-x | aux/workflow/assert-changelog.sh | 5 | ||||
-rwxr-xr-x | aux/workflow/assert-manpages.sh | 3 | ||||
-rwxr-xr-x | aux/workflow/assert-readme.sh | 7 | ||||
-rwxr-xr-x | aux/workflow/assert-spelling.sh | 25 | ||||
-rwxr-xr-x | aux/workflow/assert-todos.sh | 3 | ||||
-rwxr-xr-x | aux/workflow/installcheck.sh | 3 | ||||
-rwxr-xr-x | aux/workflow/l10n.sh | 17 | ||||
-rwxr-xr-x | aux/workflow/manpages.sh | 6 | ||||
-rwxr-xr-x | aux/workflow/public.sh | 9 | ||||
-rwxr-xr-x | aux/workflow/sign-tarballs.sh | 15 |
10 files changed, 58 insertions, 35 deletions
diff --git a/aux/workflow/assert-changelog.sh b/aux/workflow/assert-changelog.sh index 7f9117f..ca86407 100755 --- a/aux/workflow/assert-changelog.sh +++ b/aux/workflow/assert-changelog.sh @@ -43,8 +43,9 @@ assert() { DATE="$1" VVERSION="$2" VERSION="${2#v}" - CHANGELOG_ENTRY="# [$VERSION](https://git.euandreh.xyz/$PROJECT/commit/?id=$VVERSION) - $DATE" - + CHANGELOG_ENTRY="$(printf \ + '# [%s](https://git.euandreh.xyz/%s/commit/?id=%s) - %s' \ + "$VERSION" "$PROJECT" "$VVERSION" "$DATE")" if ! grep -qF "$CHANGELOG_ENTRY" CHANGELOG.md; then echo "Missing '$CHANGELOG_ENTRY' entry from CHANGELOG.md" >&2 exit 1 diff --git a/aux/workflow/assert-manpages.sh b/aux/workflow/assert-manpages.sh index b26c7a4..f9a6807 100755 --- a/aux/workflow/assert-manpages.sh +++ b/aux/workflow/assert-manpages.sh @@ -207,7 +207,8 @@ for from_f in "$@"; do esac f="$(echo "$from_f" | sed "s/\.en\./.$lang./")" - if ! tail -n "$(wc -l < "$EXPECTED")" "$f" | diff - "$EXPECTED"; then + if ! tail -n "$(wc -l < "$EXPECTED")" "$f" | + diff - "$EXPECTED"; then echo "Missing metadata at the end of \"$f\" file" if [ "$IN_PLACE" = true ]; then cat "$EXPECTED" >> "$f" diff --git a/aux/workflow/assert-readme.sh b/aux/workflow/assert-readme.sh index 333a753..6635832 100755 --- a/aux/workflow/assert-readme.sh +++ b/aux/workflow/assert-readme.sh @@ -44,7 +44,8 @@ and for generating the documentation HTML and website, run: $ make public \`\`\` -Send contributions to the [mailing list] via [\`git send-email\`](https://git-send-email.io/). +Send contributions to the [mailing list] via +[\`git send-email\`](https://git-send-email.io/). ## Links @@ -89,7 +90,9 @@ cat <<EOF >> "$EXPECTED" ## License -The code is licensed under [GNU Affero General Public License v3.0 or later][AGPL-3.0-or-later] (AGPL-3.0-or-later). +The code is licensed under +[GNU Affero General Public License v3.0 or later][AGPL-3.0-or-later] +(AGPL-3.0-or-later). [AGPL-3.0-or-later]: https://git.euandreh.xyz/$PROJECT/tree/COPYING EOF diff --git a/aux/workflow/assert-spelling.sh b/aux/workflow/assert-spelling.sh index f1eef6f..9418dc2 100755 --- a/aux/workflow/assert-spelling.sh +++ b/aux/workflow/assert-spelling.sh @@ -5,16 +5,18 @@ set -eu sort_dicts() { for f in po/spelling/*.txt; do - if ! LANG=POSIX sort "$f" | diff - "$f"; then - if [ "$IN_PLACE" = true ]; then - OUT="$(mkstemp)" - LANG=POSIX sort "$f" | uniq > "$OUT" - mv "$OUT" "$f" - else - echo "The $f dictionary is unsorted. To fix it, run:" >&2 - echo " sh aux/workflow/assert-spelling.sh -i" >&2 - exit 1 - fi + if LANG=POSIX sort "$f" | diff - "$f"; then + echo continue + fi + if [ "$IN_PLACE" = true ]; then + OUT="$(mkstemp)" + LANG=POSIX sort "$f" | uniq > "$OUT" + mv "$OUT" "$f" + else + printf 'The %s dictionary is unsorted.' "$f" >&2 + printf " To fix it, run:\n" >&2 + printf " sh aux/workflow/assert-spelling.sh -i" >&2 + exit 1 fi done } @@ -63,7 +65,8 @@ ACC="$(mkstemp)" for f in "$@"; do l="$(get_lang "$f")" CURR_DICT="$(mkstemp)" - cat po/spelling/international.txt "po/spelling/$l.txt" | sort | uniq > "$CURR_DICT" + cat po/spelling/international.txt "po/spelling/$l.txt" | + sort | uniq > "$CURR_DICT" hunspell -u3 -H -d "$l" -p "$CURR_DICT" "$f" | tee -a "$ACC" >&2 done diff --git a/aux/workflow/assert-todos.sh b/aux/workflow/assert-todos.sh index dfa1ab7..c21ebb9 100755 --- a/aux/workflow/assert-todos.sh +++ b/aux/workflow/assert-todos.sh @@ -1,7 +1,8 @@ #!/bin/sh set -eu -if git grep FIXME | grep -v '^TODOs.md' | grep -v '^aux/workflow/assert-todos.sh'; then +if git grep FIXME | grep -v '^TODOs.md' | + grep -v '^aux/workflow/assert-todos.sh'; then echo "Found dangling FIXME markers on the project." echo "You should write them down properly on TODOs.md." exit 1 diff --git a/aux/workflow/installcheck.sh b/aux/workflow/installcheck.sh index e28f5d1..0aae391 100755 --- a/aux/workflow/installcheck.sh +++ b/aux/workflow/installcheck.sh @@ -28,7 +28,8 @@ shift $((OPTIND - 1)) if [ -n "${UNINSTALL:-}" ]; then if [ "$(find "$PREFIX" -type f | wc -l)" != 0 ]; then - printf 'When uninstalling, left over files in the PREFIX directory:\n' + printf 'When uninstalling, left over files in the' + printf 'PREFIX directory:\n' find "$PREFIX" -type f exit 1 fi diff --git a/aux/workflow/l10n.sh b/aux/workflow/l10n.sh index 66e452a..683758f 100755 --- a/aux/workflow/l10n.sh +++ b/aux/workflow/l10n.sh @@ -36,12 +36,15 @@ for from_f in "$@"; do case "$from_f" in *.en.[1-9].in) po4a-updatepo -f man -m "$from_f" -p "$pofile" - po4a-translate -f man -m "$from_f" -p "$pofile" -l "$to_f" -k 0 -v >&2 + po4a-translate -f man -m "$from_f" \ + -p "$pofile" -l "$to_f" -k 0 -v >&2 ;; *.en.md) touch "$pofile" - md2po --include-codeblocks --quiet --save --po-filepath "$pofile" < "$from_f" - po2md --pofiles "$pofile" --quiet --save "$to_f" --wrapwidth 999 < "$from_f" + md2po --include-codeblocks --quiet --save \ + --po-filepath "$pofile" < "$from_f" + po2md --pofiles "$pofile" --save "$to_f" \ + --quiet --wrapwidth 999 < "$from_f" ;; *) echo "Unsupported file format: $from_f" >&2 @@ -56,8 +59,12 @@ yellowb="\033[1;33m" for lang in $LANGS; do # shellcheck disable=2044 for pofile in $(find po/ -type f -name "$lang.po"); do - if LANG=POSIX msgfmt --statistics "$pofile" 2>&1 | grep untranslated; then - printf "\n\t${yellowb}WARNING${end}!\n Missing translations for %s\n\n" "$pofile" >&2 + if ! LANG=POSIX msgfmt --statistics "$pofile" 2>&1 | + grep untranslated; then + continue fi + # shellcheck disable=2059 + printf "\n ${yellowb}WARNING${end}!" >&2 + printf "\n Missing translations for %s\n\n" "$pofile" >&2 done done diff --git a/aux/workflow/manpages.sh b/aux/workflow/manpages.sh index d0d19ae..5c83a37 100755 --- a/aux/workflow/manpages.sh +++ b/aux/workflow/manpages.sh @@ -42,14 +42,16 @@ for f in "$@"; do assert_arg "${OUTDIR:-}" '-o OUTDIR' to_name="$(basename "${f%.$l.$n}.$n.html")" mkdir -p "$OUTDIR/$l" - pandoc -s -r man -w html --metadata "lang=$l" < "$f" > "$OUTDIR/$l/$to_name" + pandoc -s -r man -w html --metadata "lang=$l" \ + < "$f" > "$OUTDIR/$l/$to_name" ;; install) assert_arg "${MANPREFIX:-}" '-p MANPREFIX' to_name="$(basename "${f%.$l.$n}.$n")" mkdir -p "$MANPREFIX/$l/man$n" "$MANPREFIX/man$n" cp "$f" "$MANPREFIX/$l/man$n/$to_name" - ln -fs "../en/man$n/$to_name" "$MANPREFIX/man$n/$to_name" + ln -fs "../en/man$n/$to_name" \ + "$MANPREFIX/man$n/$to_name" ;; uninstall) assert_arg "${MANPREFIX:-}" '-p MANPREFIX' diff --git a/aux/workflow/public.sh b/aux/workflow/public.sh index f9f3b3d..2276ed3 100755 --- a/aux/workflow/public.sh +++ b/aux/workflow/public.sh @@ -41,12 +41,15 @@ PROJECT_UC="${PROJECT_UC:-$PROJECT}" mkdir -p "$OUTDIR" -sh aux/workflow/TODOs.sh -N "$PROJECT_UC" -n "$PROJECT" -m "$MAILING_LIST" -o "$OUTDIR" +sh aux/workflow/TODOs.sh \ + -N "$PROJECT_UC" -n "$PROJECT" -m "$MAILING_LIST" -o "$OUTDIR" for lang in $LANGS; do mkdir -p "$OUTDIR/$lang/" - sh aux/workflow/commonmark.sh -N "$PROJECT" -t README -l "$lang" < "README.$lang.md" > "$OUTDIR/$lang/index.html" - sh aux/workflow/commonmark.sh -N "$PROJECT" -t CHANGELOG -l "$lang" < "CHANGELOG.$lang.md" > "$OUTDIR/$lang/CHANGELOG.html" + sh aux/workflow/commonmark.sh -N "$PROJECT" -t README -l "$lang" \ + < "README.$lang.md" > "$OUTDIR/$lang/index.html" + sh aux/workflow/commonmark.sh -N "$PROJECT" -t CHANGELOG -l "$lang" \ + < "CHANGELOG.$lang.md" > "$OUTDIR/$lang/CHANGELOG.html" cp aux/workflow/favicon.svg aux/workflow/favicon.png "$OUTDIR/$lang" done diff --git a/aux/workflow/sign-tarballs.sh b/aux/workflow/sign-tarballs.sh index 3775e28..295619c 100755 --- a/aux/workflow/sign-tarballs.sh +++ b/aux/workflow/sign-tarballs.sh @@ -26,12 +26,13 @@ assert_arg "${PROJECT:-}" '-n PROJECT' SIGNATURES="$(git notes --ref=refs/notes/signatures/tar.xz list | cut -d\ -f2)" for tag in $(git tag); do COMMIT="$(git rev-list -n1 "$tag")" - if ! echo "$SIGNATURES" | grep -qF "$COMMIT"; then - echo "Adding missing signature to $tag" >&2 - git notes --ref=refs/notes/signatures/tar.xz add -C "$( - git archive --format tar.xz --prefix "$PROJECT-$tag/" "$tag" | - gpg --output - --armor --detach-sign | - git hash-object -w --stdin - )" "$tag" + if echo "$SIGNATURES" | grep -qF "$COMMIT"; then + continue fi + echo "Adding missing signature to $tag" >&2 + git notes --ref=refs/notes/signatures/tar.xz add -C "$( + git archive --format tar.xz --prefix "$PROJECT-$tag/" "$tag" | + gpg --output - --armor --detach-sign | + git hash-object -w --stdin + )" "$tag" done |