diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2026-10-05 18:16:38 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2026-10-05 18:16:38 +0000 |
| commit | 55850e313752497880ffde33870540b0b57814c1 (patch) | |
| tree | caaa72d69ca4b14ccd1652f260001e0cc360fa0d /src/repo/s6rc_repo_setuptodate.c | |
| parent | f706ab3b309a4c9a0425ac23d5ffff7ead48fcb2 (diff) | |
| download | s6-rc-55850e313752497880ffde33870540b0b57814c1.tar.gz | |
Propagate -L catchall changes to s6-rc-set-commit
s6-rc-set-install is undergoing changes, it might not work
properly. The rest is coming this week.
Diffstat (limited to 'src/repo/s6rc_repo_setuptodate.c')
| -rw-r--r-- | src/repo/s6rc_repo_setuptodate.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/repo/s6rc_repo_setuptodate.c b/src/repo/s6rc_repo_setuptodate.c index 83e208e..b6bd35d 100644 --- a/src/repo/s6rc_repo_setuptodate.c +++ b/src/repo/s6rc_repo_setuptodate.c @@ -4,11 +4,14 @@ #include <skalibs/nonposix.h> #include <string.h> +#include <stdint.h> #include <errno.h> #include <skalibs/stat.h> #include <skalibs/strerr.h> +#include <s6-rc/config.h> +#include <s6-rc/s6rc-utils.h> #include <s6-rc/repo.h> int s6rc_repo_setuptodate (char const *repo, char const *set) @@ -28,15 +31,24 @@ int s6rc_repo_setuptodate (char const *repo, char const *set) memcpy(dstfn + repolen + 10, set, setlen + 1) ; if (stat(srcfn, &stsource) == -1) { - strerr_warnfu2sys("stat ", srcfn) ; + strerr_warnfusys("stat ", srcfn) ; return -1 ; } if (stat(dstfn, &stcompiled) == -1) { if (errno == ENOENT) return 0 ; - strerr_warnfu2sys("stat ", dstfn) ; + strerr_warnfusys("stat ", dstfn) ; return -1 ; } + { + uint32_t version = s6rc_read_major(dstfn) ; + if (!version) + { + strerr_warnfusys("read major version from ", dstfn) ; + return -1 ; + } + if (version < s6rc_get_major(S6RC_VERSION)) return 0 ; + } return stsource.st_mtim.tv_sec < stcompiled.st_mtim.tv_sec ? 1 : stsource.st_mtim.tv_sec > stcompiled.st_mtim.tv_sec ? 0 : |
