]> pd.if.org Git - zpackage/commitdiff
Allow accepting modified config files
authorNathan Wagner <nw@hydaspes.if.org>
Sun, 4 Nov 2018 14:51:32 +0000 (14:51 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Sun, 4 Nov 2018 14:54:52 +0000 (14:54 +0000)
zpm-syncfs.c

index 8ed7c8341ea6ee595b84fc970fd762371ead4ddd..f603fa78bca65a9744a709737f6c7dfaa3c93626 100644 (file)
@@ -1001,14 +1001,26 @@ static int install_files(void *f, int ncols, char **vals, char **cols) {
                                }
                                return 0;
                        }
+
                        if (mdsame && hashsame && !(accept || overwrite)) {
                                /* error */
                                return seterror(conf, "file exists: %s", nitem.dest);
                        }
+
                        if (mdsame && !hashsame && overwrite) {
                                /* install */
                                return install(conf, &nitem, eisdir ? 11 : 7);
                        }
+
+                       if (nitem.configuration && accept) {
+                               /* accept a changed config file */
+                               if (conf->dryrun || conf->verbose) {
+                                       fprintf(stderr, "accept %smodified config %s: %s\n", (!mdsame || !hashsame) ? "" : "un", 
+                                                       eisdir ? "directory" : "file", nitem.dest);
+                               }
+                               return 0;
+                       }
+
                        if (mdsame && !hashsame && !overwrite) {
                                /* accept doesn't matter, since it's
                                 * not an acceptable file */