diff options
| author | EuAndreh <eu@euandre.org> | 2026-06-12 09:19:28 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2026-06-12 09:19:28 -0300 |
| commit | 46fd0362bce11d709e5efe6d540358533985d363 (patch) | |
| tree | f77d2ed33c4f3fb6e85353e436efca4e19028f73 /aux | |
| parent | rm .tdrc COPYING (diff) | |
| download | remembering-46fd0362bce11d709e5efe6d540358533985d363.tar.gz remembering-46fd0362bce11d709e5efe6d540358533985d363.tar.xz | |
Rewrite remembering in Go
The shell pipeline (sed | sort | tee | awk | sort | cut | "$@"
plus the cut | uniq | awk profile rewrite) becomes a single static
binary with the same observable behaviour, pinned by the original
ranking.sh, signals.sh and cli-opts.sh suites, now aimed at
remembering.bin:
- the profile keeps the exact on-disk format, COUNT profile TEXT,
byte-sorted with new picks appended at 1 and offered-but-never-
picked entries persisted at 0;
- the menu stays count-descending with byte-order ties, stdin
alone defines what is offered, and duplicate profile lines sum
for ranking but collapse to the highest count on rewrite, as
sort | uniq -f1 did;
- the wrapped command's exit status is forwarded as-is (128+sig
for signal deaths), its stderr passes through, and an empty pick
learns nothing;
- the profile rewrite stays atomic via .tmp plus rename.
Per the house CLI conventions, -h/-V/--help/--version are gone
(the manpage is the documentation; bad options print the usage on
stderr and exit 2), and getopts-style attached option arguments
(-pNAME) are not accepted any more --- no script in the wild used
them.
The project layout follows rot: raw go tool compile/link Makefile,
mkdeps.sh-generated deps.mk, white-box unit suite, fuzz target
over the profile parse/serialize roundtrip, functional pick
roundtrip, a 1M-line ranking benchmark, and a single English
asciidoc manpage absorbing the old .5 page; the po4a/aux release
machinery goes away.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'aux')
| -rw-r--r-- | aux/.gitignore | 3 | ||||
| -rwxr-xr-x | aux/80-columns.sh | 12 | ||||
| -rwxr-xr-x | aux/checks/changelog.sh | 54 | ||||
| -rwxr-xr-x | aux/checks/manpages.sh | 21 | ||||
| -rw-r--r-- | aux/checks/manpages/footer.en.0.in | 30 | ||||
| -rw-r--r-- | aux/checks/manpages/footer.eo.0.in | 13 | ||||
| -rw-r--r-- | aux/checks/manpages/footer.es.0.in | 13 | ||||
| -rw-r--r-- | aux/checks/manpages/footer.fr.0.in | 13 | ||||
| -rw-r--r-- | aux/checks/manpages/footer.pt.0.in | 13 | ||||
| -rwxr-xr-x | aux/checks/readme.sh | 82 | ||||
| -rw-r--r-- | aux/checks/repo.env | 5 | ||||
| -rwxr-xr-x | aux/checks/repo.sh | 188 | ||||
| -rwxr-xr-x | aux/checks/shellcheck.sh | 6 | ||||
| -rwxr-xr-x | aux/checks/spelling.sh | 5 | ||||
| -rwxr-xr-x | aux/checks/todos.sh | 62 | ||||
| -rw-r--r-- | aux/dev.mk | 113 | ||||
| -rwxr-xr-x | aux/dist.sh | 88 | ||||
| -rw-r--r-- | aux/domain.txt | 1 | ||||
| -rwxr-xr-x | aux/ext2subdir.sh | 60 | ||||
| -rw-r--r-- | aux/favicon.svg | 62 | ||||
| -rw-r--r-- | aux/headers.html | 2 | ||||
| -rw-r--r-- | aux/lib.sh | 37 | ||||
| -rwxr-xr-x | aux/po4a-cfg.sh | 85 | ||||
| -rw-r--r-- | aux/preamble-md.in | 14 | ||||
| -rwxr-xr-x | aux/sign-tarballs.sh | 38 |
25 files changed, 0 insertions, 1020 deletions
diff --git a/aux/.gitignore b/aux/.gitignore deleted file mode 100644 index 5588aca..0000000 --- a/aux/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/generated.mk -/preamble-md -/checks/manpages/*.0 diff --git a/aux/80-columns.sh b/aux/80-columns.sh deleted file mode 100755 index ae4660e..0000000 --- a/aux/80-columns.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -set -eu - -# shellcheck disable=2068 -for f in ${@:-$(cat -)}; do - if [ "$(file -i "$f" | cut -d' ' -f2 | cut -d/ -f1)" = 'text' ]; then - sed 's/\t/ /g' "$f" | - awk -v FNAME="$f" 'length > 80 { - printf "%s:%s:%s\n", FNAME, NR, $0 - }' - fi -done diff --git a/aux/checks/changelog.sh b/aux/checks/changelog.sh deleted file mode 100755 index a73baec..0000000 --- a/aux/checks/changelog.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -set -eu - - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - - -HOMEPAGE_LINK="Changelog for [$NAME](https://$DOMAIN/$NAME/en/)." - -if ! grep -qF "$HOMEPAGE_LINK" CHANGELOG.md; then - echo "Missing link to homepage in CHANGELOG.md:" >&2 - echo "$HOMEPAGE_LINK" - exit 1 -fi - -assert() { - DATE="$1" - VVERSION="$2" - VERSION="${2#v}" - CHANGELOG_ENTRY="$(printf \ - '# [%s](https://%s/git/%s/commit/?id=%s) - %s' \ - "$VERSION" "$DOMAIN" "$NAME" "$VVERSION" "$DATE")" - if ! grep -qF "$CHANGELOG_ENTRY" CHANGELOG.md; then - echo "Missing '$CHANGELOG_ENTRY' entry from CHANGELOG.md" >&2 - exit 1 - fi -} - -for VVERSION in $(git tag); do - DATE="$(git log -1 --format=%ad --date=short "$VVERSION")" - assert "$DATE" "$VVERSION" -done - -# FIXME -# "$@" represents a list of tags to be also included in the verification. -for VVERSION in "$@"; do - DATE="$(date '+%Y-%m-%d')" - assert "$DATE" "$VVERSION" -done diff --git a/aux/checks/manpages.sh b/aux/checks/manpages.sh deleted file mode 100755 index 204d960..0000000 --- a/aux/checks/manpages.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -set -eu - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - - -# FIXME diff --git a/aux/checks/manpages/footer.en.0.in b/aux/checks/manpages/footer.en.0.in deleted file mode 100644 index 5b51ab5..0000000 --- a/aux/checks/manpages/footer.en.0.in +++ /dev/null @@ -1,30 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org -EuAndreh -.ME -and contributors. - - -.SH BUGS - -.IP \(bu -Report bugs to the -.MT ~euandreh/@MAILING_LIST@@lists.sr.ht -mailing list -.ME . -Use the subject "\f(CR[@NAME@] BUG or TASK: -<description>\fR". -.IP \(bu -Browse bugs -.UR https://@DOMAIN@/@NAME@/TODOs.html -online -.UE . -.IP \(bu -.UR https://@DOMAIN@/@NAME@/en/ -Homepage -.UE . -.IP \(bu -.UR https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D -Comments and discussions -.UE . diff --git a/aux/checks/manpages/footer.eo.0.in b/aux/checks/manpages/footer.eo.0.in deleted file mode 100644 index fc9fe56..0000000 --- a/aux/checks/manpages/footer.eo.0.in +++ /dev/null @@ -1,13 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org EuAndreh .ME and contributors. - - -.SH BUGS - -.IP \(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht mailing -list .ME . Use the subject "\f(CR[@NAME@] BUG or TASK: <description>\fR". -.IP \(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs.html online .UE . .IP -\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . .IP \(bu .UR -https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D Comments -and discussions .UE . diff --git a/aux/checks/manpages/footer.es.0.in b/aux/checks/manpages/footer.es.0.in deleted file mode 100644 index fc9fe56..0000000 --- a/aux/checks/manpages/footer.es.0.in +++ /dev/null @@ -1,13 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org EuAndreh .ME and contributors. - - -.SH BUGS - -.IP \(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht mailing -list .ME . Use the subject "\f(CR[@NAME@] BUG or TASK: <description>\fR". -.IP \(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs.html online .UE . .IP -\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . .IP \(bu .UR -https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D Comments -and discussions .UE . diff --git a/aux/checks/manpages/footer.fr.0.in b/aux/checks/manpages/footer.fr.0.in deleted file mode 100644 index fc9fe56..0000000 --- a/aux/checks/manpages/footer.fr.0.in +++ /dev/null @@ -1,13 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org EuAndreh .ME and contributors. - - -.SH BUGS - -.IP \(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht mailing -list .ME . Use the subject "\f(CR[@NAME@] BUG or TASK: <description>\fR". -.IP \(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs.html online .UE . .IP -\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . .IP \(bu .UR -https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D Comments -and discussions .UE . diff --git a/aux/checks/manpages/footer.pt.0.in b/aux/checks/manpages/footer.pt.0.in deleted file mode 100644 index fc9fe56..0000000 --- a/aux/checks/manpages/footer.pt.0.in +++ /dev/null @@ -1,13 +0,0 @@ -.SH AUTHORS - -.MT eu@euandre.org EuAndreh .ME and contributors. - - -.SH BUGS - -.IP \(bu Report bugs to the .MT ~euandreh/@MAILING_LIST@@lists.sr.ht mailing -list .ME . Use the subject "\f(CR[@NAME@] BUG or TASK: <description>\fR". -.IP \(bu Browse bugs .UR https://@DOMAIN@/@NAME@/TODOs.html online .UE . .IP -\(bu .UR https://@DOMAIN@/@NAME@/en/ Homepage .UE . .IP \(bu .UR -https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D Comments -and discussions .UE . diff --git a/aux/checks/readme.sh b/aux/checks/readme.sh deleted file mode 100755 index f97b2d3..0000000 --- a/aux/checks/readme.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -set -eu - -while getopts 'h' flag; do - case "$flag" in - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - - -EXPECTED="$(mkstemp)" -cat <<-EOF >> "$EXPECTED" - - Send contributions to the [mailing list] via - [\`git send-email\`](https://git-send-email.io/). - - - ## Links - - - [homepage](https://$DOMAIN/s/$NAME/en/) - - [source code](https://$DOMAIN/git/$NAME/) - - [bug tracking](https://$DOMAIN/s/$NAME/TODOs.html) - - [mailing list] - - [CI logs](https://$DOMAIN/s/$NAME/ci/) - - [CHANGELOG](https://$DOMAIN/s/$NAME/en/CHANGELOG.html) - - [mailing list]: https://lists.sr.ht/~euandreh/$MAILING_LIST?search=%5B$NAME%5D -EOF - -RELEASES_LIST="$(mkstemp)" -add_release() { - DATE="$1" - VVERSION="$2" - echo "- [$VVERSION](https://$DOMAIN/git/$NAME/commit/?id=$VVERSION) [$NAME-$VVERSION.tar.gz](https://$DOMAIN/git/$NAME/snapshot/$NAME-$VVERSION.tar.gz) ([sig](https://$DOMAIN/git/$NAME/snapshot/$NAME-$VVERSION.tar.gz.asc)) - $DATE" >> "$RELEASES_LIST" -} - -for VVERSION in $(git tag); do - DATE="$(git log -1 --format=%ad --date=short "$VVERSION")" - add_release "$DATE" "$VVERSION" -done - -# "$@" represents a list of tags to be also included in the verification. -for VVERSION in "$@"; do - if ! git tag | grep -qF "$VVERSION"; then - DATE="$(date '+%Y-%m-%d')" - add_release "$DATE" "$VVERSION" - fi -done - -if [ -s "$RELEASES_LIST" ]; then - printf '\n\n## Releases\n\n' >> "$EXPECTED" - sort -r "$RELEASES_LIST" >> "$EXPECTED" -fi - -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). - - [AGPL-3.0-or-later]: https://$DOMAIN/git/$NAME/tree/COPYING -EOF - -if ! tail -n "$(wc -l < "$EXPECTED")" README.md | diff - "$EXPECTED"; then - echo 'Wrong metadata at the end of README.md file' - echo "See expected content at: $EXPECTED" - exit 1 -fi diff --git a/aux/checks/repo.env b/aux/checks/repo.env deleted file mode 100644 index 79b46d9..0000000 --- a/aux/checks/repo.env +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -export EXECUTABLES=1 -export SYMLINKS=2 -export FILES=9 diff --git a/aux/checks/repo.sh b/aux/checks/repo.sh deleted file mode 100755 index 323f68e..0000000 --- a/aux/checks/repo.sh +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/sh -set -eu - - -if [ -n "${RECURSIVE_CHECK:-}" ]; then - exit -fi -export RECURSIVE_CHECK=true - -. aux/lib.sh -. aux/checks/repo.env -set -eu - -usage() { - cat <<-'EOF' - FIXME - EOF -} - -assert_no_diffs() { - if [ -n "$(git status -s)" ]; then - echo 'Repository left dirty.' >&2 - git status >&2 - exit 1 - fi -} - -assert_installed_files() { - ACTUAL="$(find "$1" -type f -perm -u=x | wc -l)" - if [ "$EXECUTABLES" != "$ACTUAL" ]; then - printf 'Expected %s executables, found %s:\n' \ - "$EXECUTABLES" "$ACTUAL" >&2 - echo "find $1 -type f -perm -u=x:" >&2 - find "$1" -type f -perm -u=x >&2 - exit 1 - fi - - ACTUAL="$(find "$1" -type l | wc -l)" - if [ "$SYMLINKS" != "$ACTUAL" ]; then - printf 'Expected %s symlinks, found %s:\n' \ - "$SYMLINKS" "$ACTUAL" >&2 - echo "find $1 -type l:" >&2 - find "$1" -type l >&2 - exit 1 - fi - - ACTUAL="$(find "$1" -type f | wc -l)" - if [ "$FILES" != "$ACTUAL" ]; then - printf 'Expected %s files, found %s:\n' \ - "$FILES" "$ACTUAL" >&2 - echo "find $1 -type f:" >&2 - find "$1" -type f >&2 - exit 1 - fi -} - -assert_uninstalled_files() { - if [ "$(find "$1" \( -type f -o -type l \) | wc -l)" != 0 ]; then - echo 'Left-over files after uninstall' >&2 - echo "find $1 \( -type f -o -type l \):" - find "$1" \( -type f -o -type l \) - exit 1 - fi -} - -assert_install() { - make clean - - echo 'Asserting "canonical" install path' >&2 - INSTALL1="$(tmpname)" - make PREFIX="$INSTALL1" - make check PREFIX="$INSTALL1" - make install PREFIX="$INSTALL1" - assert_installed_files "$INSTALL1" - make uninstall PREFIX="$INSTALL1" - assert_uninstalled_files "$INSTALL1" - - make clean - - echo 'Asserting "straigh-forward" install path' >&2 - INSTALL2="$(tmpname)" - make install PREFIX="$INSTALL2" - assert_installed_files "$INSTALL2" - make uninstall PREFIX="$INSTALL2" - assert_uninstalled_files "$INSTALL2" - - make clean - - echo 'Asserting "idempotent" install path' >&2 - INSTALL3="$(tmpname)" - make install PREFIX="$INSTALL3" - make install PREFIX="$INSTALL3" - assert_installed_files "$INSTALL3" - make uninstall PREFIX="$INSTALL3" - make uninstall PREFIX="$INSTALL3" - assert_uninstalled_files "$INSTALL3" - - make clean - - echo 'Asserting "destdir" install path' >&2 - DESTDIR="$(tmpname)" - INSTALL4="$(tmpname)" - make install DESTDIR="$DESTDIR" PREFIX="$INSTALL4" - assert_installed_files "$DESTDIR/$INSTALL4" - make uninstall DESTDIR="$DESTDIR" PREFIX="$INSTALL4" - assert_uninstalled_files "$DESTDIR/$INSTALL4" -} - -check_clean_clone() { - um - unreachable - return 12 - oijwsx - CLONEDIR="$(tmpname)/$NAME" - mkdir -p -- "$CLONEDIR" - cd "$CLONEDIR" - - git clone "$OLDPWD" . - - make dev - assert_no_diffs - make clean - assert_no_diffs - - if [ -n "$(git clean -ffdx --dry-run)" ]; then - echo '"make clean" left files:' >&2 - git clean -ffdx --dry-run >&2 - echo "Clone directory: $CLONEDIR" >&2 - exit 1 - fi - - rm -rf aux/ - make check || { - echo 'Cannot run "make check" without "aux/".' >&2 - echo "Clone directory: $CLONEDIR" >&2 - exit 1 #FIXME - } - - assert_install - oijwsx - - cd - > /dev/null -} - -check_clean_checkout() { - set -x - echo dois - dois - CHECKOUTDIR="$(tmpname)/$NAME" - mkdir -p -- "$CHECKOUTDIR" - git --work-tree="$CHECKOUTDIR" checkout HEAD -- . - cd "$CHECKOUTDIR" - - FILECOUNT="$(find . -type f | wc -l)" - : make clean public dev-check - : make clean - if [ "$FILECOUNT" != "$(find . -type f | wc -l)" ]; then - echo 'File count mismatch after "make clean".' >&2 - echo "Checkout directory: $CHECKOUTDIR" >&2 - exit 1 - fi - - assert_insta - - cd - > /dev/null -} - -set -eu -# set -eE -D="$(mkdtemp)" - -check_clean_clone && echo aaa -exit -if ! check_clean_clone; then - touch "$D"/clean-clone.err -fi -check_clean_clone -# || touch "$D"/clean-clone.err -# check_clean_checkout || touch "$D"/clean-checkout.err -# check_no_aux -wait -tree "$D" -if [ "$(find "$D" -name '*.err' | wc -l)" != 0 ]; then - find "$D" -name '*.err' | while read -r f; do - cat -- "${f%.err}" - done - exit 1 -fi diff --git a/aux/checks/shellcheck.sh b/aux/checks/shellcheck.sh deleted file mode 100755 index 585a75f..0000000 --- a/aux/checks/shellcheck.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -set -eu - -git ls-files | - xargs awk '/^#!\/bin\/sh$/ { print FILENAME } { nextfile }' | - xargs shellcheck -x diff --git a/aux/checks/spelling.sh b/aux/checks/spelling.sh deleted file mode 100755 index 02f9051..0000000 --- a/aux/checks/spelling.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -set -eu - -# echo FIXME -exit diff --git a/aux/checks/todos.sh b/aux/checks/todos.sh deleted file mode 100755 index 2b9a570..0000000 --- a/aux/checks/todos.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh -set -eu - -if true; then - exit -fi - -if [ -e .git ] && 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 -fi - -awk -F'{#' ' -BEGIN { - exitstatus = 0 - h2flag = 0 - h2status = "" - prevline = "" - idx = 0 - delete ids[0] -} -h2flag == 1 { - split($0, l, " ") - timelinestatus = l[2] - if (h2status != timelinestatus) { - print "h2/timeline status mismatch for line " NR-1 - print prevline - print $0 - exitstatus = 1 - } - h2status = "" - h2flag = 0 -} - -/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE|WONTFIX)/ { - if (match($0, / \{#.*?\}.*$/) == 0) { - print "Missing ID for line " NR ":\n" $0 - exitstatus = 1 - } - id_with_prefix = substr($2, 0, length($2) - 1) - match(id_with_prefix, /^\w+-/) - id = substr(id_with_prefix, RLENGTH + 1) - if (id in arr) { - print "Duplicate ID: " id - exitstatus = 1 - } else { - arr[id] = 1 - } - - split($0, l, " ") - h2status = l[2] - h2flag = 1 - prevline = $0 -} - - -/^# Scratch$/ { - exit exitstatus -} -' TODOs.md diff --git a/aux/dev.mk b/aux/dev.mk deleted file mode 100644 index 5f62802..0000000 --- a/aux/dev.mk +++ /dev/null @@ -1,113 +0,0 @@ -.POSIX: - -.SUFFIXES: -.SUFFIXES: .in .md .html - -.in: - sed \ - -e "s:@DOMAIN@:`cat aux/domain.txt`:g" \ - -e "s:@NAME@:`basename "$$PWD"`:g" \ - -e 's:@MAILING_LIST@:$(MAILING_LIST):g' \ - < $< > $@ - -.in.html: - pandoc -s -r man -w html \ - -H aux/headers.html \ - --metadata lang="`echo $< | awk -F. '{ print $$(NF-2) }'`" \ - < $(<D)/`basename "$(<F)" .in` > $@ - -.md.html: - pandoc -s -r commonmark -w html \ - -H aux/headers.html \ - --metadata lang="`echo $(<F) | cut -d. -f2`" \ - --metadata title="`basename "$$PWD"` - `echo $(<F) | cut -d. -f1`" \ - --toc --toc-depth=2 \ - --highlight-style pygments \ - < $< > $@ - -manpages.html = $(manpages.in:.in=.html) - -md_files.html = $(md_files:.md=.html) - -public: manpages.sentinel public/makefile.svg md.sentinel public/index.html \ - public/ci public/TODOs.html public/style.css public/favicon.svg - touch $@ - -public/index.html: - mkdir -p $(@D) - ln -rs public/en/index.html $@ - -public/ci: - sh aux/ci/report.sh -n "`basename "$$PWD"`" -o $@ - -public/TODOs.html: TODOs.md aux/preamble-md - mkdir -p $(@D) - td -H | cat aux/preamble-md - | pandoc -s -r commonmark -w html \ - -H aux/headers.html \ - --metadata lang=en \ - --metadata title="`basename "$$PWD"` - TODOs" \ - --toc --toc-depth=2 \ - --highlight-style pygments \ - > $@ - -public/favicon.svg: aux/favicon.svg - mkdir -p $(@D) - cp aux/favicon.svg $@ - -public/style.css: - mkdir -p $(@D) - td -S > $@ - -md.sentinel: $(md_files.html) - mkdir -p public - sh aux/ext2subdir.sh -o public $? - for d in public/*/; do ln -rfs public/style.css $$d/style.css; done - touch $@ - -manpages.sentinel: $(manpages.html) - mkdir -p public - sh aux/ext2subdir.sh -o public $? - touch $@ - -public/makefile.svg: Makefile - mkdir -p $(@D) - LANG=en.UTF-8 make -Bnd dev | make2graph | dot -Tsvg >$@ - - -index.en.md: - ln -s README.md $@ - -CHANGELOG.en.md: - ln -s CHANGELOG.md $@ - -all_en_files = \ - $(en_files) \ - index.en.md \ - CHANGELOG.en.md - -po/po4a.cfg: $(all_en_files) po - sh aux/po4a-cfg.sh -f '$(all_en_files) aux/checks/manpages/footer.en.0.in' > $@ - po4a $@ - - -test-files = \ - aux/checks/changelog.sh \ - aux/checks/manpages.sh \ - aux/checks/readme.sh \ - aux/checks/shellcheck.sh \ - aux/checks/spelling.sh \ - aux/checks/todos.sh \ - aux/checks/repo.sh \ - -$(test-files): ALWAYS manfooter.sentinel - env MAILING_LIST='$(MAILING_LIST)' sh $@ - -aux/checks/assert-manpages.sh: manfooter.sentinel - -manfooter.sentinel: - $(MAKE) -f aux/dev.mk `echo aux/checks/manpages/*.in | sed 's|\.in||g'` - touch $@ - -dev-check: $(test-files) - -ALWAYS: diff --git a/aux/dist.sh b/aux/dist.sh deleted file mode 100755 index def68e6..0000000 --- a/aux/dist.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - EOF -} - -while getopts 'd:V:n:' flag; do - case "$flag" in - d) - DATE="$OPTARG" - ;; - V) - VVERSION="v$OPTARG" - ;; - n) - NAME="$OPTARG" - ;; - *) - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - -eval "$(assert_arg "${DATE:-}" '-d DATE')" -eval "$(assert_arg "${VVERSION:-}" '-V VERSION')" -eval "$(assert_arg "${NAME:-}" '-n NAME')" - - -if [ "$(git rev-parse --abbrev-ref HEAD)" != 'main' ]; then - echo 'Not on branch "main".' >&2 - exit 1 -fi - -if git show "$VVERSION" 1>/dev/null 2>/dev/null; then - echo "Version '$VVERSION' already exists." >&2 - exit 1 -fi - -if ! printf '%s\n%s\n' "$(git tag)" "$VVERSION" | sort -nct. -k1 -k2 -k3; then - echo 'New tag is not bigger than existing ones.' >&2 - exit 1 -fi - -if [ "$DATE" != "$(git log -1 --format=%ad --date=short HEAD)" ]; then - echo "Date '$DATE' is not up-to-date." >&2 - exit 1 -fi - -if [ "Release $VVERSION" != "$(git log --format=%B -1 HEAD | head -n1)" ]; then - echo "Commit message isn't 'Release $VVERSION'." >&2 - exit 1 -fi - -# FIXME -: make clean check EXTRA_VERSION="$VVERSION" - -if ! (git diff --quiet && git diff --quiet --staged); then - echo 'Dirty repository.' - exit 1 -fi - - -git tag "$VVERSION" -sh aux/workflow/sign-tarballs.sh -n "$NAME" - - -printf 'Publish version? [Y/n]: ' >&2 -read -r publish - -if [ "$publish" = 'n' ]; then - cat <<EOF >&2 -Now push the tag and the signature before pushing the commit: - -git push origin refs/notes/signatures/tar.gz -o ci.skip --no-verify -git push --tags -o ci.skip --no-verify -git push - -EOF -else - git push origin refs/notes/signatures/tar.gz -o ci.skip --no-verify - git push --tags -o ci.skip --no-verify - git push -fi diff --git a/aux/domain.txt b/aux/domain.txt deleted file mode 100644 index fd7ea0f..0000000 --- a/aux/domain.txt +++ /dev/null @@ -1 +0,0 @@ -euandre.org diff --git a/aux/ext2subdir.sh b/aux/ext2subdir.sh deleted file mode 100755 index 4770d1b..0000000 --- a/aux/ext2subdir.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - FIXME - EOF -} - -help() { - cat <<-'EOF' - FIXME - EOF -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'o:h' flag; do - case "$flag" in - o) - OUTDIR="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - -eval "$(assert_arg "${OUTDIR:-}" '-o OUTDIR')" - - -for f in "$@"; do - lang="$(printf '%s' "$(basename "$f")" | sed 's|^.*\.\([a-z][a-z]\)\..*$|\1|')" - f_nolang="$(printf '%s' "$(basename "$f")" | sed "s|\.$lang\.|.|")" - mkdir -p -- "$OUTDIR/$lang" - cp -- "$f" "$OUTDIR/$lang/$f_nolang" -done diff --git a/aux/favicon.svg b/aux/favicon.svg deleted file mode 100644 index ce566b2..0000000 --- a/aux/favicon.svg +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"> - <path d="M 0 8 L 1 8 L 1 9 L 0 9 L 0 8 Z" /> - <path d="M 0 13 L 1 13 L 1 14 L 0 14 L 0 13 Z" /> - <path d="M 1 8 L 2 8 L 2 9 L 1 9 L 1 8 Z" /> - <path d="M 1 13 L 2 13 L 2 14 L 1 14 L 1 13 Z" /> - <path d="M 2 8 L 3 8 L 3 9 L 2 9 L 2 8 Z" /> - <path d="M 2 13 L 3 13 L 3 14 L 2 14 L 2 13 Z" /> - <path d="M 3 8 L 4 8 L 4 9 L 3 9 L 3 8 Z" /> - <path d="M 3 13 L 4 13 L 4 14 L 3 14 L 3 13 Z" /> - <path d="M 4 7 L 5 7 L 5 8 L 4 8 L 4 7 Z" /> - <path d="M 4 8 L 5 8 L 5 9 L 4 9 L 4 8 Z" /> - <path d="M 4 13 L 5 13 L 5 14 L 4 14 L 4 13 Z" /> - <path d="M 5 6 L 6 6 L 6 7 L 5 7 L 5 6 Z" /> - <path d="M 5 7 L 6 7 L 6 8 L 5 8 L 5 7 Z" /> - <path d="M 5 13 L 6 13 L 6 14 L 5 14 L 5 13 Z" /> - <path d="M 6 5 L 7 5 L 7 6 L 6 6 L 6 5 Z" /> - <path d="M 6 6 L 7 6 L 7 7 L 6 7 L 6 6 Z" /> - <path d="M 6 14 L 7 14 L 7 15 L 6 15 L 6 14 Z" /> - <path d="M 7 1 L 8 1 L 8 2 L 7 2 L 7 1 Z" /> - <path d="M 7 14 L 8 14 L 8 15 L 7 15 L 7 14 Z" /> - <path d="M 7 15 L 8 15 L 8 16 L 7 16 L 7 15 Z" /> - <path d="M 7 2 L 8 2 L 8 3 L 7 3 L 7 2 Z" /> - <path d="M 7 3 L 8 3 L 8 4 L 7 4 L 7 3 Z" /> - <path d="M 7 4 L 8 4 L 8 5 L 7 5 L 7 4 Z" /> - <path d="M 7 5 L 8 5 L 8 6 L 7 6 L 7 5 Z" /> - <path d="M 8 1 L 9 1 L 9 2 L 8 2 L 8 1 Z" /> - <path d="M 8 15 L 9 15 L 9 16 L 8 16 L 8 15 Z" /> - <path d="M 9 1 L 10 1 L 10 2 L 9 2 L 9 1 Z" /> - <path d="M 9 2 L 10 2 L 10 3 L 9 3 L 9 2 Z" /> - <path d="M 9 6 L 10 6 L 10 7 L 9 7 L 9 6 Z" /> - <path d="M 9 15 L 10 15 L 10 16 L 9 16 L 9 15 Z" /> - <path d="M 10 2 L 11 2 L 11 3 L 10 3 L 10 2 Z" /> - <path d="M 10 3 L 11 3 L 11 4 L 10 4 L 10 3 Z" /> - <path d="M 10 4 L 11 4 L 11 5 L 10 5 L 10 4 Z" /> - <path d="M 10 5 L 11 5 L 11 6 L 10 6 L 10 5 Z" /> - <path d="M 10 6 L 11 6 L 11 7 L 10 7 L 10 6 Z" /> - <path d="M 11 6 L 12 6 L 12 7 L 11 7 L 11 6 Z" /> - <path d="M 11 8 L 12 8 L 12 9 L 11 9 L 11 8 Z" /> - <path d="M 10 15 L 11 15 L 11 16 L 10 16 L 10 15 Z" /> - <path d="M 11 10 L 12 10 L 12 11 L 11 11 L 11 10 Z" /> - <path d="M 11 12 L 12 12 L 12 13 L 11 13 L 11 12 Z" /> - <path d="M 11 14 L 12 14 L 12 15 L 11 15 L 11 14 Z" /> - <path d="M 11 15 L 12 15 L 12 16 L 11 16 L 11 15 Z" /> - <path d="M 12 6 L 13 6 L 13 7 L 12 7 L 12 6 Z" /> - <path d="M 12 8 L 13 8 L 13 9 L 12 9 L 12 8 Z" /> - <path d="M 12 10 L 13 10 L 13 11 L 12 11 L 12 10 Z" /> - <path d="M 12 12 L 13 12 L 13 13 L 12 13 L 12 12 Z" /> - <path d="M 12 14 L 13 14 L 13 15 L 12 15 L 12 14 Z" /> - <path d="M 13 6 L 14 6 L 14 7 L 13 7 L 13 6 Z" /> - <path d="M 13 8 L 14 8 L 14 9 L 13 9 L 13 8 Z" /> - <path d="M 13 10 L 14 10 L 14 11 L 13 11 L 13 10 Z" /> - <path d="M 13 12 L 14 12 L 14 13 L 13 13 L 13 12 Z" /> - <path d="M 13 13 L 14 13 L 14 14 L 13 14 L 13 13 Z" /> - <path d="M 13 14 L 14 14 L 14 15 L 13 15 L 13 14 Z" /> - <path d="M 14 7 L 15 7 L 15 8 L 14 8 L 14 7 Z" /> - <path d="M 14 8 L 15 8 L 15 9 L 14 9 L 14 8 Z" /> - <path d="M 14 9 L 15 9 L 15 10 L 14 10 L 14 9 Z" /> - <path d="M 14 10 L 15 10 L 15 11 L 14 11 L 14 10 Z" /> - <path d="M 14 11 L 15 11 L 15 12 L 14 12 L 14 11 Z" /> - <path d="M 14 12 L 15 12 L 15 13 L 14 13 L 14 12 Z" /> -</svg> diff --git a/aux/headers.html b/aux/headers.html deleted file mode 100644 index 1686e45..0000000 --- a/aux/headers.html +++ /dev/null @@ -1,2 +0,0 @@ -<link rel="icon" type="image/svg+xml" href="favicon.svg" /> -<link rel="stylesheet" type="text/css" href="style.css" /> diff --git a/aux/lib.sh b/aux/lib.sh deleted file mode 100644 index 93a37eb..0000000 --- a/aux/lib.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -DOMAIN="$(cat aux/domain.txt)" -NAME="$(basename "$PWD")" -export DOMAIN NAME - -assert_arg() { - if [ -z "$1" ]; then - printf 'Missing %s.\n\n' "$2" >&2 - cat <<-'EOF' - usage >&2 - exit 2 - EOF - fi -} - -uuid() { - od -xN20 /dev/urandom | - head -n1 | - awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}' -} - -tmpname() { - printf '%s/uuid-tmpname-without-spaces.%s' "${TMPDIR:-/tmp}" "$(uuid)" -} - -mkstemp() { - name="$(tmpname)" - touch -- "$name" - printf '%s' "$name" -} - -mkdtemp() { - name="$(tmpname)" - mkdir -p -- "$name" - printf '%s' "$name" -} diff --git a/aux/po4a-cfg.sh b/aux/po4a-cfg.sh deleted file mode 100755 index 11e51aa..0000000 --- a/aux/po4a-cfg.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/bin/sh -set -eu - -usage() { - cat <<-'EOF' - FIXME - EOF -} - -help() { - cat <<-'EOF' - FIXME - EOF -} - - -for flag in "$@"; do - case "$flag" in - --) - break - ;; - --help) - usage - help - exit - ;; - *) - ;; - esac -done - -while getopts 'f:L:h' flag; do - case "$flag" in - f) - FILES="$OPTARG" - ;; - h) - usage - help - exit - ;; - *) - usage >&2 - exit 2 - ;; - esac -done -shift $((OPTIND - 1)) - -. aux/lib.sh - - -files() { - printf '%s' "${FILES:-}" | tr ' ' '\n' | grep . -} - -guess_type() { - case "$1" in - *.md) - echo text - ;; - *.[1-9]*.in) - echo man - ;; - *) - echo text - ;; - esac -} - - -cat <<-'EOF' - [options] --keep 0 --master-charset UTF-8 --localized-charset UTF-8 - - [po_directory] po - -EOF - -files | while read -r file; do - TYPE="$(guess_type "$file")" - # shellcheck disable=2016 - VAR_FILE="$(printf '%s' "$file" | sed 's|\.en\.|.$lang.|')" - # shellcheck disable=2016 - printf '[type: %s] %s $lang:%s\n' "$TYPE" "$file" "$VAR_FILE" -done diff --git a/aux/preamble-md.in b/aux/preamble-md.in deleted file mode 100644 index 2bdf0c2..0000000 --- a/aux/preamble-md.in +++ /dev/null @@ -1,14 +0,0 @@ -# About - -TODOs for [@NAME@](https://@DOMAIN@/@NAME@/en/). - -Register a new one at -<span id="new">[~euandreh/@MAILING_LIST@@lists.sr.ht](mailto:~euandreh/@MAILING_LIST@@lists.sr.ht?subject=%5B@NAME@%5D%20BUG%20or%20TASK%3A%20%3Cdescription%3E)</span> -and see [existing discussions](https://lists.sr.ht/~euandreh/@MAILING_LIST@?search=%5B@NAME@%5D). - -*Você também pode escrever em português*. - -*Vous pouvez aussi écrire en français*. - -*Vi povas ankaŭ skribi esperante*. - diff --git a/aux/sign-tarballs.sh b/aux/sign-tarballs.sh deleted file mode 100755 index 3ab2bb8..0000000 --- a/aux/sign-tarballs.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -set -eu - -while getopts 'n:' flag; do - case "$flag" in - n) - PROJECT="$OPTARG" - ;; - *) - exit 2 - ;; - esac -done -shift $((OPTIND -1)) - -assert_arg() { - if [ -z "$1" ]; then - echo "Missing $2" >&2 - exit 2 - fi -} - -assert_arg "${PROJECT:-}" '-n PROJECT' - - -SIGNATURES="$(git notes --ref=refs/notes/signatures/tar.gz list | cut -d\ -f2)" -for tag in $(git tag); do - COMMIT="$(git rev-list -n1 "$tag")" - if echo "$SIGNATURES" | grep -qF "$COMMIT"; then - continue - fi - echo "Adding missing signature to $tag" >&2 - git notes --ref=refs/notes/signatures/tar.gz add -C "$( - git archive --format tar.gz --prefix "$PROJECT-$tag/" "$tag" | - gpg --output - --armor --detach-sign | - git hash-object -w --stdin - )" "$tag" -done |
