From 76c9a29b9f9fcdfc1b6ae11500badbfaa7d508e9 Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Tue, 19 Feb 2019 17:20:51 +0000 Subject: [PATCH] cleanups --- src/fetchurl.c | 9 +++------ src/syncfs.c | 13 +++++++++---- zpm-update | 7 ++++--- zpm.h | 2 ++ 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/fetchurl.c b/src/fetchurl.c index 2f144d6..ace6849 100644 --- a/src/fetchurl.c +++ b/src/fetchurl.c @@ -15,7 +15,6 @@ #include #include "tlse.h" -#define MARK fprintf(stderr, "%s %s:%d\n", __FILE__, __func__, __LINE__) struct tls_uri { char *scheme; @@ -778,6 +777,7 @@ int main(int ac, char *av[]) { switch (io.status_code) { case 304: + progressbar = 0; break; case 301: case 302: @@ -826,11 +826,8 @@ int main(int ac, char *av[]) { pdots(50, '.', total, total+ret, io.content_length); } else { - int old = total / 1000000; - int new = (total+ret)/1000000; - while (old < new) { - putc('.',stderr); - } + putc('\r', stderr); + fprintf(stderr, "%zu", total+ret); } total += ret; } diff --git a/src/syncfs.c b/src/syncfs.c index 220ee03..e88c09e 100644 --- a/src/syncfs.c +++ b/src/syncfs.c @@ -1085,8 +1085,13 @@ static int config_handler(void *f, int ncols, char **vals, char **cols) { save_config_file(conf, &nitem, save); } if (note) { - zpm_note_add(conf->log, nitem.pkglist, nitem.path, nitem.hash, - note, nitem.hash); + fprintf(stderr, "%s (%s) '%s' ", nitem.pkglist, + nitem.hash, nitem.path); + fprintf(stderr, note, nitem.hash); + fprintf(stderr, "\n"); + + zpm_note_add(conf->log, nitem.pkglist, nitem.path, + nitem.hash, note, nitem.hash); } } else { if (save) { @@ -1648,9 +1653,9 @@ int main(int ac, char **av) { /* TODO set conf var to finalize error reporting */ if (conf.verbose) { - fprintf(stderr, "syncing filesystem %s (ldb %s) from %s\n", + fprintf(stderr, "syncing filesystem %s (ldb %s)\n", conf.rootdir ? conf.rootdir : "/", - localdbfile, pkgdbfile); + localdbfile); } conf.errors = 0; diff --git a/zpm-update b/zpm-update index 5786aa5..5ee5008 100755 --- a/zpm-update +++ b/zpm-update @@ -341,10 +341,11 @@ fi if [ $verbose -gt 0 ]; then syncopts="${syncopts} -v" -else - # force -v during development - syncopts="${syncopts} -v" fi +#else + # force -v during development + #syncopts="${syncopts} -v" +#fi if [ $dryrun -eq 0 ] && [ $backup -eq 1 ]; then true diff --git a/zpm.h b/zpm.h index 2858ff4..b090b3a 100644 --- a/zpm.h +++ b/zpm.h @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include "sqlite3.h" #include "lib/jsw/jsw_atree.h" -- 2.40.0