]> pd.if.org Git - zpackage/commitdiff
fix zpm-add db constraints
authorNathan Wagner <nw@hydaspes.if.org>
Wed, 12 Dec 2018 22:28:09 +0000 (22:28 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Wed, 12 Dec 2018 22:28:09 +0000 (22:28 +0000)
zpm-add.c

index 82a92faf716328e9c1a759207b481f611f136233..d80ac08e6faf1309d9911ba958e59ae530b5a219 100644 (file)
--- a/zpm-add.c
+++ b/zpm-add.c
@@ -298,7 +298,9 @@ int add_file(struct zpm *zpm, struct zpm_file *file, struct opts *opt) {
                        opt->package, opt->version, opt->release, file->path,
                        file->mode, (int)file->mtime, file->owner, file->group,
                        file->type,
-                       file->hash, file->configuration, file->target
+                       file->type == 'r' ? file->hash : NULL,
+                       file->configuration,
+                       file->type == 'l' ? file->target : NULL
                  );
 
        if (zpm->error) {
@@ -310,7 +312,7 @@ int add_file(struct zpm *zpm, struct zpm_file *file, struct opts *opt) {
        } else if (opt->verbose > 0) {
 
                printf("%s\n", file->path);
-
+               fflush(stdout);
        }
 
        if (opt->recursive && file->type == 'd') {