if (lstat(dest, &st) == -1) {
switch (errno) {
case ENOENT:
- /* TODO chatter if verbose */
+ if (conf->verbose > 1) {
+ fprintf(stderr, "expected file not found: '%s'\n", dest);
+ }
break;
default:
return seterror(conf, "can't stat %s: %s", dest, strerror(errno));
break;
case ENOTEMPTY: /* fall through */
case EEXIST:
- /* TODO chatter, or possibly require */
+ fprintf(stderr, "expected empty directory: %s\n", dest);
break;
default:
return seterror(conf, "can't unlink %s: %s", dest, strerror(errno));
int isdir = (diffs & D_ISDIR);
int eisdir = (diffs & D_EISDIR);
- /* TODO what if old was a directory? */
+ /* what if old was a directory? */
if (!n->configuration) {
/* replacing conf with non-conf */
/* absorb file, mark todo */
struct stat existing;
int update = 0;
- /* TODO put the result row in a hash table. May not actually
+ /* put the result row in a hash table? May not actually
* be faster
*/
if (!read_item(conf, ncols, vals, cols, &nitem)) {
* and group, it might be correct on disk
* but not as in the local database
*/
+
/* TODO detect whether this a logic bug or
* an on-disk difference
*/
}
if (!mdsame && isdir && conf->ignoredirmd) {
- /* TODO warn ignoring dir md */
+ if (conf->verbose > 1) {
+ fprintf(stderr, "ignoring directory metadata difference: %s\n", nitem.dest);
+ }
return 0;
}
/* error */
return seterror(conf, "%s (md+hash): %s", accept ? "existing file not acceptable" : "file exists", nitem.dest);
}
- /* TODO error, should be impossible */
+ /* error, should be impossible */
return seterror(conf, "impossible state reached");
}
/* existing path is a directory */
if (isdir) {
/* fix md */
- /* impossible, if isdir and eisdir, would
- * be same type
- * TODO
+ /* impossible, if isdir and eisdir, would be same type
*/
return set_md(conf, &nitem);
} else {
return install(conf, &nitem, 11);
}
/* if we get here, we missed a case */
- /* TODO error */
return seterror(conf, "impossible state 2 reached");
}
- /* TODO extra verbose print perms, mtime, etc, probably ls -l
- * format
+ /* TODO extra verbose print perms, mtime, etc, probably ls -l format
*/
if (conf->verbose) {
printf("%s\n", nitem.path);
localdbfile = ZPM_LOCAL_DB;
if ((s = getenv("ZPMDB"))) {
- /* TODO does this need to be copied ? */
localdbfile = s;
}
if ((s = getenv("ZPM_ROOT_DIR"))) {
- /* TODO does this need to be copied ? */
conf.rootdir = s;
}
}
}
- /* TODO find pkgid from arg */
-
/* TODO set conf var to finalize error reporting */
if (conf.verbose) {
fprintf(stderr, "syncing filesystem %s (ldb %s) from %s\n",