Files
Febe/.gitea/scripts/json-campi.awk
T
Alby96andClaude Opus 5.5 be662f2d28 Correzioni della revisione di C6: installatore, CI senza jq, caratteri e schermate senza Node
Le 14 osservazioni della revisione di funzione/senza-terzi, ciascuna con la prova che l'avrebbe trovata.

Installatore: un aggiornamento senza /D= va nella cartella già installata (InstallLocation)
invece che in quella predefinita, che lasciava la vecchia copia. Una cartella senza permessi
non sembra più «Febe aperto». La dimensione in «App installate» conta solo i due file
dell'installatore. I file in sola lettura si sostituiscono e si tolgono. «Febe» in Esegui
all'avvio si toglie solo se avvia quella copia, non un Febe portatile. Febe parte alla fine
solo con «Fine» e la casella spuntata. /PROVA= rifiuta la radice di un disco.

CI: jq non c'era ed era un componente esterno. JSON letto e scritto con .gitea/scripts/json.sh
(json-campi.awk e json-stringa.awk sul lettore json.awk) per gitleaks, Trivy e la release.
Le credenziali del registro stanno solo in un DOCKER_CONFIG temporaneo della pubblicazione,
con plugin, contesti e contesto corrente del runner, tolto alla fine. Le prove del rilascio
girano in debian:trixie con Chromium, come la verifica, senza prove saltate. Ogni flusso usa
shell: bash.

Caratteri: tolti fonts-liberation e fonts-noto-color-emoji dall'immagine e dalle prove della
CI, perché Chromium non li chiede. Resta fonts-dejavu-core.

Icone: la prova della griglia legge davvero i percorsi SVG (tutti i comandi, archi e curve) e
i punti. La lettura dei nomi delle icone vede ogni forma con cui l'interfaccia li chiede.

Schermate: tools/schermate (Node) diventa tools/Febe.Schermate, in C# con ClientWebSocket e
System.Text.Json, nessun pacchetto, solo verso indirizzi di questo computer. Provato contro
una dimostrazione con Edge su Windows.

Documenti: CLAUDE.md, processo, guida, LEGGIMI e docker.md aggiornati. Righe nuove in
decisioni.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 16:04:39 +01:00

61 lines
2.1 KiB
Awk

# For json.sh campi, with json.awk: the plain fields of the objects found at one place of a JSON text.
#
# LC_ALL=C awk -v percorso=<path> -v campi=<field,field...> -f json.awk -f json-campi.awk <file.json>...
#
# percorso is the way from the root to the objects: keys and indexes separated by «/», «*» for any key or index, empty
# for the root object itself. «*» is every object of a root list; «Results/*/Vulnerabilities/*» every vulnerability of
# every result of Trivy. For each object found there, in the order of the text, one line with the values of campi in
# the order asked, separated by a TAB: a string decoded (TAB, CR and LF inside become spaces, so a line stays a line), a
# number as written, true, false and null as words; a field that is missing, or holds a list or an object, is empty.
#
# A file that is not a valid JSON text prints nothing at all (not even the lines found before the error): the reason
# goes to stderr and the exit status is 2. A valid text with no object at that place prints nothing and exits with 0.
BEGIN {
steps = percorso == "" ? 0 : split(percorso, step, "/")
wanted = split(campi, field, ",")
for (i = 1; i <= wanted; i++) column[field[i]] = i
broken = 0
}
function json_begin(file) {
inside = 0
rows = ""
}
function json_open(kind, d) {
if (inside || kind != "o" || json_depth != steps + 1) return
for (d = 1; d <= steps; d++) {
if (step[d] != "*" && (json_at[d] "") != step[d]) return
}
inside = 1
split("", value)
}
function json_scalar(kind, text) {
if (!inside || json_depth != steps + 1 || !((json_at[json_depth] "") in column)) return
if (kind == "s") gsub(/[\t\r\n]/, " ", text)
value[column[json_at[json_depth] ""]] = text
}
function json_close(kind, line, i) {
if (!inside || json_depth != steps + 1) return
inside = 0
line = ""
for (i = 1; i <= wanted; i++) line = line (i > 1 ? "\t" : "") ((i in value) ? value[i] : "")
rows = rows line "\n"
}
function json_end(file, error) {
if (error != "") {
print file ": " error > "/dev/stderr"
broken = 1
} else {
printf "%s", rows
}
}
END {
exit (broken ? 2 : 0)
}