progress: barra di avanzamento per download ed estrazione
Aggiunge src/progress.{c,h}: barra a una riga attiva solo quando stdout e' un
terminale (con output rediretto/pipeline non stampa nulla, quindi l'output resta
identico al client Python: parita' 30/30 invariata).
- due fasi: "Scaricamento" (byte da Content-Length) ed "Estrazione" (byte
compressi consumati + membri processati: nuovo contatore in gz_reader e
callback tar_progress_fn/tar_extract_cb)
- controllo con CELLAR_PROGRESS=auto|bar|plain|off (default auto)
- nessun codice ANSI, solo '\r' e riempimento con spazi; glifi ASCII se la
locale non e' UTF-8, larghezza da TIOCGWINSZ e misurata in colonne (i glifi
UTF-8 sono multi-byte), ridisegno throttled, velocita' a media mobile, ETA
- percorsi d'errore: progress_abort() chiude la riga senza riepilogo; il file
parziale resta come nel client Python
- tests/progress_test.sh: pipe silenziosa, PTY via script (barra, ETA, riepilogo,
nessun ANSI, righe entro la larghezza), modalita' plain e off, integrita' del
file scaricato e della bottiglia installata (13/13 verdi)
- tests/parity_test.sh resta 30/30; mock_server.py con --throttle per i test
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
Name: 'Fake Bottle'
|
||||
Runner: soda-9.0-1
|
||||
Arch: win32
|
||||
Windows: win10
|
||||
Environment: Gaming
|
||||
@@ -0,0 +1 @@
|
||||
../drive_c/config.ini
|
||||
@@ -0,0 +1 @@
|
||||
hello world
|
||||
+1
@@ -0,0 +1 @@
|
||||
long path
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
/nonexistent/target
|
||||
@@ -0,0 +1 @@
|
||||
config
|
||||
@@ -0,0 +1 @@
|
||||
config.ini
|
||||
@@ -0,0 +1 @@
|
||||
unicode
|
||||
@@ -0,0 +1 @@
|
||||
binario
|
||||
@@ -0,0 +1 @@
|
||||
deep
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
[cellar]
|
||||
server = http://127.0.0.1:8080
|
||||
bottles_dir = /home/enne2/Dev/cellar-cli-c/tests/tmp-progress/home/.var/app/com.usebottles.bottles/data/bottles/bottles
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
Name: 'Fake Bottle'
|
||||
Runner: soda-9.0-1
|
||||
Arch: win32
|
||||
Windows: win10
|
||||
Environment: Gaming
|
||||
@@ -0,0 +1 @@
|
||||
../drive_c/config.ini
|
||||
@@ -0,0 +1 @@
|
||||
hello world
|
||||
+1
@@ -0,0 +1 @@
|
||||
long path
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
/nonexistent/target
|
||||
@@ -0,0 +1 @@
|
||||
config
|
||||
@@ -0,0 +1 @@
|
||||
config.ini
|
||||
@@ -0,0 +1 @@
|
||||
unicode
|
||||
+1
@@ -0,0 +1 @@
|
||||
binario
|
||||
@@ -0,0 +1 @@
|
||||
deep
|
||||
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"name": "BigBottle",
|
||||
"bottle_name": "Fake Bottle",
|
||||
"description": null,
|
||||
"tags": null,
|
||||
"arch": null,
|
||||
"runner": null,
|
||||
"windows_version": null,
|
||||
"id": 1,
|
||||
"file_name": "big.tar.gz",
|
||||
"stored_name": "b2b18dc0668e8b5b661c952112aeb58a.tar.gz",
|
||||
"content_type": "application/gzip",
|
||||
"size_bytes": 12009363,
|
||||
"sha256": "b2b18dc0668e8b5b661c952112aeb58a3b16a1552156b0098823e47ca89f2434",
|
||||
"created_at": "2026-09-20T15:44:25.190979+00:00"
|
||||
}
|
||||
]
|
||||
Binary file not shown.
Reference in New Issue
Block a user