X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-syncfs.c;h=59a88256f66c0cfb963750b8119a856876ddd668;hb=aeefcd018ce388d9a4f496994fd9961d13ba62df;hp=d21f34f3551bc97558a6afe6a40e660f60349e23;hpb=0b4c476faa9f0e5ce8d5c7363daa5e81d452814a;p=zpackage diff --git a/zpm-syncfs.c b/zpm-syncfs.c index d21f34f..59a8825 100644 --- a/zpm-syncfs.c +++ b/zpm-syncfs.c @@ -611,7 +611,7 @@ static int set_md(struct config *conf, struct nitem *item) { printf("chmod %o %s\n", item->mode, item->dest); } if (conf->setuser && conf->setgroup) { - printf("chown %d:%d %s\n", item->uid, item->gid, + printf("lchown %d:%d %s\n", item->uid, item->gid, item->dest); } printf("mtime %.0f %s\n", (double)item->mtime, item->dest); @@ -630,9 +630,9 @@ static int set_md(struct config *conf, struct nitem *item) { } if (conf->setuser && conf->setgroup) { - rv = chown(item->dest, item->uid, item->gid); + rv = lchown(item->dest, item->uid, item->gid); if (rv == -1) { - setsyserr(conf, "can't chown %s", item->dest); + setsyserr(conf, "can't lchown %s", item->dest); return conf->errabort; } } @@ -871,6 +871,12 @@ static int install_files(void *f, int ncols, char **vals, char **cols) { return conf->errabort; } +#if 0 + int64_t used, high; + used = sqlite3_memory_used()/1024/1024; + high = sqlite3_memory_highwater(0)/1024/1024; + fprintf(stderr, "memory = %ld MB / %ld MB\n", used, high); +#endif if (conf->verbose && !conf->dryrun) { fprintf(stderr, "%s '%c' %s\n", nitem.opstr, nitem.ftype, nitem.dest); @@ -1302,6 +1308,7 @@ int main(int ac, char **av){ conf.log = &localdb; if (pkgdbfile) { + /* TODO open read-only */ if (!zpm_open(&pkgdb, pkgdbfile)) { fprintf(stderr, "can't open src db %s\n", localdbfile); exit(EXIT_FAILURE);