aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2019-10-01 14:03:58 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2019-10-01 14:15:13 +0200
commit4740bcd111b9c106b426a4bb9807917e9a17d4fe (patch)
treee4d3b59eef67442494b3e45a12efefda7a0dadb6
parenta21797efe6648f8f9173fa0c33f50961ac286deb (diff)
downloadl2md-4740bcd111b9c106b426a4bb9807917e9a17d4fe.tar.gz
l2md: rename/generalize oid_maildir into oid
It's not tied in any way to the fact that we're using maildir, plus we want to support different output modes in future, therefore move to a more generic name. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r--config.c9
-rw-r--r--l2md.h2
-rw-r--r--mail.c8
3 files changed, 9 insertions, 10 deletions
diff --git a/config.c b/config.c
index 8077da0..72eb6f8 100644
--- a/config.c
+++ b/config.c
@@ -35,9 +35,8 @@ static void config_dump(struct config *cfg)
verbose("repos.%s.initial_import = %u\n", repo->name, repo->initial_import);
url_for_each(repo, url, j) {
verbose("repos.%s.url = %s\n", repo->name, url->path);
- verbose("repos.%s.oid_maildir = %s\n",
- repo->name, url->oid_known ? url->oid_maildir :
- "[unknown]");
+ verbose("repos.%s.oid = %s\n", repo->name,
+ url->oid_known ? url->oid : "[unknown]");
}
}
}
@@ -53,8 +52,8 @@ static void config_probe_oids(struct config *cfg)
repo_for_each(cfg, repo, i) {
url_for_each(repo, url, j) {
repo_local_oid(cfg, repo, url, path, sizeof(path));
- ret = xread_file(path, url->oid_maildir,
- sizeof(url->oid_maildir) - 1, false);
+ ret = xread_file(path, url->oid, sizeof(url->oid) - 1,
+ false);
if (!ret)
url->oid_known = true;
}
diff --git a/l2md.h b/l2md.h
index 7b406a6..45e87d5 100644
--- a/l2md.h
+++ b/l2md.h
@@ -42,7 +42,7 @@ struct config_general {
struct config_url {
char path[PATH_MAX];
- char oid_maildir[GIT_OID_HEXSZ + 1];
+ char oid[GIT_OID_HEXSZ + 1];
bool oid_known;
};
diff --git a/mail.c b/mail.c
index 238da96..fd8f783 100644
--- a/mail.c
+++ b/mail.c
@@ -32,12 +32,12 @@ void sync_mail(struct config *cfg)
url_for_each(repo, url, j) {
repo_local_path(cfg, repo, url, path, sizeof(path));
repo_walk_files(cfg, repo, j, path,
- url->oid_known ? url->oid_maildir : NULL,
- url->oid_maildir, repo_walker);
+ url->oid_known ? url->oid : NULL,
+ url->oid, repo_walker);
repo_local_oid(cfg, repo, url, path, sizeof(path));
- xwrite_file(path, url->oid_maildir,
- sizeof(url->oid_maildir) - 1, true);
+ xwrite_file(path, url->oid, sizeof(url->oid) - 1,
+ true);
url->oid_known = true;
}
}