+
+ /* so, old was conf, and something exists in the filesystem */
+
+ if (!sametype) {
+ warn("won't %s %s%s, %s exists",
+ nitem.op == OP_NEW ? "install" : nitem.opstr,
+ nitem.path,
+ isdir ? "/" : "",
+ eisdir ? "directory" : "file"
+ );
+ conf->errors++;
+ return conf->errabort;
+ }
+
+ /* all below are same type of file */
+ /* what about sametype, but old was different type */
+
+ if (isdir) {
+ return 0;
+ }
+
+ /* save or note cases */
+
+ if (nitem.op == OP_REMOVE) {
+ save ="saved removed config file %.8s";
+ } else
+
+ if (nitem.op == OP_UPDATE) {
+ if (!nitem.configuration) {
+ /* replacing config with non-config */
+ save = "replacing configuration file %.8s with non-configuration file";
+ } else if (oldhashsame) {
+ /* config file hasn't changed from old default,
+ * so go ahead and install the new one
+ */
+ save = "replaced old default config (%.8s) with new one.";
+ notehash = nitem.ohash;
+ } else {
+ note = "kept existing config file. new default version is %.8s";
+ save = 0;
+ }
+ } else
+
+ if (nitem.op == OP_NEW && !hashsame) {
+ note = "config file already existed. would have installed %.8s";
+ save = 0;
+ }
+
+ /*
+ * save files, add notes
+ */