From f961fc7796670b908f59b09b17284f9caf47f8af Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Sun, 4 Nov 2018 14:51:32 +0000 Subject: [PATCH] Allow accepting modified config files --- zpm-syncfs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zpm-syncfs.c b/zpm-syncfs.c index 8ed7c83..f603fa7 100644 --- a/zpm-syncfs.c +++ b/zpm-syncfs.c @@ -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 */ -- 2.40.0