From 69b02d967ca104d81325ef6c32572ec62b976ddc Mon Sep 17 00:00:00 2001 From: Jaroslav Pulchart Date: Thu, 17 Sep 2026 08:50:00 +0200 Subject: [PATCH 1/2] amiga: build the date in a fixed locale and zero pad it date '+%-d.%-m.%Y' produced 17.9.2026 where the cookie convention is dd.mm.yyyy, and the call ran in whatever locale the builder had. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 531122c..1ba24c3 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ HOSTCC ?= cc # ---- common flags ---- -AMIGA_DATE ?= $(shell date '+%-d.%-m.%Y') +AMIGA_DATE ?= $(shell LC_ALL=C date '+%d.%m.%Y') ODFS_GIT_VERSION ?= $(shell desc=$$(git describe --tags --match "v*" --dirty --always 2>/dev/null || echo unknown); printf '%s\n' "$$desc" | grep -q '^v' && printf '%s' "$$desc" || printf 'early-0-g%s' "$$desc") ODFS_VERSION_MAJOR ?= $(or $(shell printf '%s\n' "$(ODFS_GIT_VERSION)" | sed -n 's/^v\([0-9][0-9]*\)\..*/\1/p'),0) ODFS_VERSION_MINOR ?= $(or $(shell printf '%s\n' "$(ODFS_GIT_VERSION)" | sed -n 's/^v[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/p'),0) From 992bde3193164d0ad898d3348b2ebd6b888cb7e7 Mon Sep 17 00:00:00 2001 From: Jaroslav Pulchart Date: Thu, 17 Sep 2026 08:50:00 +0200 Subject: [PATCH 2/2] amiga: put a version the Version command can read into the cookie Two things came out of one string. The cookie carried the git describe where Version looks for ., and rt_IdString pointed at the cookie itself, "$VER: " and all, which a ROMTag has no use for. Before, on the v0.7.0 release build: > version CD0: ODFileSystem 0.-1 > version CD0: full ODFileSystem 0.-1 > version L:ODFileSystem ODFileSystem v0.7.0 (28.7.2026) > version L:ODFileSystem full ODFileSystem v0.7.0 (28.7.2026) > version ODFileSystem ODFileSystem 0.-1 > version ODFileSystem full ODFileSystem 0.-1 ROMTag: "$VER: ODFileSystem v0.7.0 (28.7.2026)" Suggested change: the numbers go into that position and the describe follows the date, so every reader parses it and none of them lose the describe: > version L:ODFileSystem ODFileSystem 0.7 > version L:ODFileSystem full ODFileSystem 0.7 (17.9.2026) v0.7.0-12-g2e6d42b > version ODFileSystem ODFileSystem 0.7 > version ODFileSystem full ODFileSystem 0.7 (17.9.2026) v0.7.0-12-g2e6d42b > version CD0: ODFileSystem 0.7 > version CD0: full ODFileSystem 0.7 (17.9.2026) v0.7.0-12-g2e6d42b ROMTag: ODFileSystem 0.7 (17.9.2026) v0.7.0-12-g2e6d42b rt_IdString and the FileSysResource entry name point past the prefix and share that one string, so the separate creator string is gone. --- platform/amiga/handler_main.c | 9 +++++++-- platform/amiga/resident.c | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/platform/amiga/handler_main.c b/platform/amiga/handler_main.c index 4121cf5..a17e868 100644 --- a/platform/amiga/handler_main.c +++ b/platform/amiga/handler_main.c @@ -73,9 +73,14 @@ #define DMDF_REMOVEDEVICE (1L << 1) #endif +#define ODFS_STR_(x) #x +#define ODFS_STR(x) ODFS_STR_(x) + +/* Version reads the token after the name as . */ const char version_string[] __attribute__((used)) = - "$VER: ODFileSystem " ODFS_GIT_VERSION - " (" ODFS_AMIGA_DATE ")"; + "$VER: ODFileSystem " + ODFS_STR(ODFS_VERSION_MAJOR) "." ODFS_STR(ODFS_VERSION_MINOR) + " (" ODFS_AMIGA_DATE ") " ODFS_GIT_VERSION; #define VOLUME_PUBLISH_RETRY_MICROS 100000UL diff --git a/platform/amiga/resident.c b/platform/amiga/resident.c index e4ef205..dcab703 100644 --- a/platform/amiga/resident.c +++ b/platform/amiga/resident.c @@ -34,8 +34,8 @@ extern const char version_string[]; static const char name_string[] = "ODFileSystem"; -static const char creator_string[] = - "ODFileSystem " ODFS_GIT_VERSION " (" ODFS_AMIGA_DATE ")"; +/* the cookie without its "$VER: " prefix */ +#define ODFS_ID_STRING (&version_string[sizeof("$VER: ") - 1]) void entrypoint(void); static int rt_init(BPTR seglist asm("a0"), struct ExecBase *SysBase asm("a6")); @@ -49,7 +49,7 @@ static const struct Resident __attribute__((used,no_reorder)) romtag = { .rt_Type = NT_UNKNOWN, .rt_Pri = 10, .rt_Name = (APTR)&name_string, - .rt_IdString = (APTR)&version_string, + .rt_IdString = (APTR)ODFS_ID_STRING, .rt_Init = (APTR)rt_init }; @@ -81,7 +81,7 @@ static int rt_init(BPTR seglist asm("a0"), struct ExecBase *SysBase asm("a6")) { if (seglist == NULL) { seglist = MKBADDR((UBYTE *)entrypoint - 4); } - fse->fse_Node.ln_Name = (char *)creator_string; + fse->fse_Node.ln_Name = (char *)ODFS_ID_STRING; fse->fse_DosType = DOSTYPE; fse->fse_GlobalVec = -1; fse->fse_PatchFlags = 0x190;