aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@inria.fr>2026-01-25 18:04:08 +0100
committerTristan Riehs <tristan.riehs@inria.fr>2026-01-25 18:05:08 +0100
commiteffe1f88979dc6768f07c74dda7ea2a352959a41 (patch)
treeb04ab7016765833f734dca92e811142e228366b1
parent016ddf36a4f530bd79289baf106f21b716c877f0 (diff)
Outline of ftag sync pull
-rw-r--r--src/main.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index c33ea36..8c47d67 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1088,6 +1088,9 @@ static void ftag_query(int argc, char **argv)
* - negative value if remote ftag database is newer than the local one. */
static int ftag_sync_compare_mtimes(void)
{
+ /* TODO: create get_mtime routines
+
+ This will be useful in pull/push routines implementation. */
char *remote_path = FTAG_REMOTE_ROOT "/ftag.sqlite3";
char cmd[1024];
strbuild(cmd, "ssh %s 'test -f %s && stat --format=%%Y %s || echo 0'",
@@ -1133,7 +1136,19 @@ static void ftag_sync_pull(void)
{
if (!ftag_sync_is_remote_newer())
return;
- /* TODO: resume here */
+ char remote_arg[128];
+ strbuild(remote_arg, "%s:%s/%s",
+ FTAG_REMOTE_HOST, FTAG_REMOTE_ROOT, "ftag.sqlite3");
+ char *cmd[] = {
+ "scp",
+ DATABASE_PATH,
+ remote_arg,
+ NULL
+ };
+ ftag_execvp(cmd, 1);
+ /* TODO: manually set local and remote mtime
+
+ Make them equal to avoid further unecessary pull/push. */
}
static void ftag_sync(int argc, char **argv)