#include "sqlite3.h"
#include "zpm.h"
+#include "lib/buffer.h"
struct config {
struct zpm *log; /* logging db will be attached as "log" */
unsigned long ops_update, ops_update_completed;
unsigned long ops_install, ops_install_completed;
int progress; /* type of progress meter */
+ struct zpm_buffer note;
};
struct nitem {
};
static void usage() {
- printf("usage: zpm $scriptname [-fncC] args ...\n");
+ printf("usage: zpm syncfs ...\n");
}
static void warn(char *fmt, ...) {
fprintf(stderr, "\n");
}
+static void add_to_note(struct config *cf, char *fmt, ...) {
+ va_list ap;
+
+ va_start(ap, fmt);
+ zpm_buffer_appendvf(&cf->note, fmt, ap);
+ va_end(ap);
+}
+
static void pdots(int len, int ch, int was, int now, int total) {
was = len * was / total;
if (now > total) {
if (update) {
if (!exist) {
/* warn, it should exist */
+ add_to_note(conf, "%s missing, installing\n", nitem.dest);
fprintf(stderr, "%s missing, installing\n", nitem.dest);
return install(conf, &nitem, 3);
}
conf.overwrite = 0;
conf.accept = 0;
conf.acceptdir = 1;
+ zpm_buffer_init(&conf.note);
if (geteuid() != 0) {
conf.setuser = 0;
zpm_close(&localdb);
zpm_close(conf.src);
+ /* TODO add the note */
+ zpm_buffer_free(&conf.note);
return conf.errors ? 1 : 0;
}