]> pd.if.org Git - zpackage/commitdiff
cleanups v0.6.1
authorNathan Wagner <nw@hydaspes.if.org>
Tue, 19 Feb 2019 17:20:51 +0000 (17:20 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Tue, 19 Feb 2019 17:20:51 +0000 (17:20 +0000)
src/fetchurl.c
src/syncfs.c
zpm-update
zpm.h

index 2f144d6dba72b72638a5aca6573fd13836845d68..ace6849be2dacdd7be03b73e1655a671319ac46f 100644 (file)
@@ -15,7 +15,6 @@
 #include <fcntl.h>
 
 #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;
                        }
index 220ee039c38ab0428266f29e8c2e8d5580bc16c4..e88c09e7f6b17e2a8d0c4a08eb1a67ca7c45d1c8 100644 (file)
@@ -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;
index 5786aa5c0bf70901d2927b7becbff67dccf0cdce..5ee5008c55430d80d9cdc7c28f04b947d7f5e5ff 100755 (executable)
@@ -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 2858ff45d034e57416d465c34e60ad0fe7e8a2e4..b090b3ad50ce5bed6fbd071926c238c744942975 100644 (file)
--- a/zpm.h
+++ b/zpm.h
@@ -7,6 +7,8 @@
 #include <limits.h>
 #include <stdarg.h>
 #include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #include "sqlite3.h"
 #include "lib/jsw/jsw_atree.h"