]> pd.if.org Git - zpackage/blobdiff - zpm-add.c
fix zpm-add db constraints
[zpackage] / 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') {