CI e installatore: commenti degli script in inglese (#43)
La regola del progetto è «codice e commenti in inglese; interfaccia, documenti e messaggi in italiano», e gli script di .gitea/ (script e flussi), di installer/ e docker/entrypoint.sh avevano ancora i commenti in italiano (decisione di Alberto del 29 novembre 2026). Cambiano solo i commenti: i messaggi che una persona legge (echo, ::warning::, ::error::, nomi dei passi, note della release) restano in italiano e nessun comando cambia. I programmi awk e gli script finti delle prove erano già in inglese. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f48384b7d4
commit
009e7d6710
18 files changed
+496
-495
No files matched your search
@@ -1,23 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
# Sceglie le versioni da togliere dal registro dei pacchetti di Gitea (pulizia-docker.sh, modo «completa»). Legge solo
|
||||
# i file che riceve, con json.awk e versioni-registro.awk (awk POSIX: niente jq, niente Node): niente rete, niente
|
||||
# scritture, quindi si prova con un file JSON (PipelineTests).
|
||||
# Chooses the versions to remove from Gitea's package registry (pulizia-docker.sh, «completa» mode). It reads only the
|
||||
# files it is given, with json.awk and versioni-registro.awk (POSIX awk: no jq, no Node): no network, no writes, so it
|
||||
# is tested with a JSON file (PipelineTests).
|
||||
#
|
||||
# versioni-registro.sh <quante tenere> <pagina.json>... le etichette sha-<da 7 a 40 cifre esadecimali>
|
||||
# del contenitore febe oltre le N più recenti
|
||||
# versioni-registro.sh senza-etichetta <pagina.json>... le versioni sha256:<64 cifre> del contenitore
|
||||
# febe (i manifest di un indice: solo da contare)
|
||||
# versioni-registro.sh scadute <giorni> <adesso> <pagina.json>... le versioni <x.y.z>-ci.<n> e
|
||||
# <x.y.z>-rilascio.<n> del pacchetto generico
|
||||
# febe-ci (gli artefatti della CI, artefatti.sh)
|
||||
# create più di <giorni> giorni prima di <adesso>,
|
||||
# in secondi dal 1970
|
||||
# versioni-registro.sh <quante tenere> <pagina.json>... the sha-<7 to 40 hexadecimal digits> tags of
|
||||
# the febe container beyond the N most recent
|
||||
# versioni-registro.sh senza-etichetta <pagina.json>... the sha256:<64 digits> versions of the febe
|
||||
# container (the manifests of an index: only to
|
||||
# be counted)
|
||||
# versioni-registro.sh scadute <giorni> <adesso> <pagina.json>... the <x.y.z>-ci.<n> and <x.y.z>-rilascio.<n>
|
||||
# versions of the generic febe-ci package (the CI
|
||||
# artifacts, artefatti.sh) created more than
|
||||
# <giorni> days before <adesso>, in seconds since
|
||||
# 1970
|
||||
#
|
||||
# Ogni pagina è una risposta di GET /api/v1/packages/{proprietario}/{tipo}/{nome} di Gitea 28. Stampa, dalla più
|
||||
# vecchia e una per riga, «versione<TAB>creata». Tutto il resto resta sempre: main, latest, le versioni X.Y.Z (anche
|
||||
# X.Y.Z-rc.N), i digest, ogni altra etichetta, una sha- o un artefatto senza una data che si legga. Fra le sha- contano
|
||||
# le date, non il testo; a parità di data l'identificativo. Se un file non è un elenco JSON esce con 2 e non stampa
|
||||
# nulla: nel dubbio non si toglie niente.
|
||||
# Each page is a response of GET /api/v1/packages/{owner}/{type}/{name} of Gitea 28. Prints, oldest first and one per
|
||||
# line, «version<TAB>created». Everything else always stays: main, latest, the X.Y.Z versions (also X.Y.Z-rc.N), the
|
||||
# digests, every other tag, a sha- tag or an artifact without a readable date. Among the sha- tags the dates count,
|
||||
# not the text; with equal dates the identifier. If a file is not a JSON list it exits with 2 and prints nothing: when
|
||||
# in doubt nothing is removed.
|
||||
set -euo pipefail
|
||||
|
||||
qui="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
@@ -48,7 +49,7 @@ export LC_ALL=C
|
||||
tab=$'\t'
|
||||
versioni=$(awk -v tipo="$tipo" -v nome="$nome" -f "$qui/json.awk" -f "$qui/versioni-registro.awk" "$@") || exit 2
|
||||
|
||||
# Righe: millisecondi (o «-»), identificativo, ordine, versione, data come scritta.
|
||||
# Lines: milliseconds (or «-»), identifier, order, version, date as written.
|
||||
case "$modo" in
|
||||
senza-etichetta)
|
||||
awk -F "$tab" -v OFS="$tab" '$4 ~ /^sha256:[0-9a-f]+$/ && length($4) == 71 { if ($1 == "-") $1 = 0; print }' <<< "$versioni" \
|
||||
@@ -60,7 +61,7 @@ case "$modo" in
|
||||
| sort -t "$tab" -k1,1n -k2,2n -k3,3n | cut -f4,5
|
||||
;;
|
||||
*)
|
||||
# Le più recenti prima (data, poi identificativo), si saltano le prime N, il resto dalla più vecchia.
|
||||
# The most recent first (date, then identifier), the first N are skipped, the rest from the oldest.
|
||||
awk -F "$tab" '$1 != "-" && $4 ~ /^sha-[0-9a-f]+$/ && length($4) >= 11 && length($4) <= 44' <<< "$versioni" \
|
||||
| sort -t "$tab" -k1,1nr -k2,2nr -k3,3n | tail -n "+$((modo + 1))" \
|
||||
| awk '{ righe[NR] = $0 } END { for (i = NR; i > 0; i--) print righe[i] }' | cut -f4,5
|
||||
|
||||
Reference in new issue
Block a user