From 8dc6169bcae4255a996f29ab59c839c559fcdc24 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 29 Nov 2021 13:43:35 -0800 Subject: catgirl: Fix strptime decode on musl --- .../0004-Fix-strptime-decode-for-musl-libc.patch | 34 ++++++++++++++++++++++ ...sable-colorized-output-in-M-l-window-list.patch | 34 ---------------------- ...sable-colorized-output-in-M-l-window-list.patch | 34 ++++++++++++++++++++++ pkg/catgirl/ver | 2 +- 4 files changed, 69 insertions(+), 35 deletions(-) create mode 100644 pkg/catgirl/patch/0004-Fix-strptime-decode-for-musl-libc.patch delete mode 100644 pkg/catgirl/patch/0004-HACK-Disable-colorized-output-in-M-l-window-list.patch create mode 100644 pkg/catgirl/patch/0005-HACK-Disable-colorized-output-in-M-l-window-list.patch (limited to 'pkg') diff --git a/pkg/catgirl/patch/0004-Fix-strptime-decode-for-musl-libc.patch b/pkg/catgirl/patch/0004-Fix-strptime-decode-for-musl-libc.patch new file mode 100644 index 00000000..fdeef0f8 --- /dev/null +++ b/pkg/catgirl/patch/0004-Fix-strptime-decode-for-musl-libc.patch @@ -0,0 +1,34 @@ +From c6813f480f7c60541f4e3cb7601c89dfafc59ddc Mon Sep 17 00:00:00 2001 +From: psykose +Date: Tue, 26 Oct 2021 10:14:17 +0200 +Subject: [PATCH] Fix strptime decode for musl libc + +POSIX does not define a %F for strptime[1], but does define %F for +strftime[2]. Afaik most libc's implement %F for both, but musl is very +standards-compliant and does not have %F on strptime, leading to +unparsed message tag times, which causes all backlog sent from bouncer +on startup to have a timestamp of the current time, instead of the +actual timestamp sent. + +[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html +[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html +--- + handle.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/handle.c b/handle.c +index 1ace1b3..7f99a7c 100644 +--- a/handle.c ++++ b/handle.c +@@ -91,7 +91,7 @@ static const time_t *tagTime(const struct Message *msg) { + static time_t time; + struct tm tm; + if (!msg->tags[TagTime]) return NULL; +- if (!strptime(msg->tags[TagTime], "%FT%T", &tm)) return NULL; ++ if (!strptime(msg->tags[TagTime], "%Y-%m-%dT%T", &tm)) return NULL; + time = timegm(&tm); + return &time; + } +-- +2.34.0 + diff --git a/pkg/catgirl/patch/0004-HACK-Disable-colorized-output-in-M-l-window-list.patch b/pkg/catgirl/patch/0004-HACK-Disable-colorized-output-in-M-l-window-list.patch deleted file mode 100644 index 2e51b598..00000000 --- a/pkg/catgirl/patch/0004-HACK-Disable-colorized-output-in-M-l-window-list.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 80dac47ee3aa26290cda962ab2531afb054bf47a Mon Sep 17 00:00:00 2001 -From: Michael Forney -Date: Thu, 3 Jun 2021 00:54:30 -0700 -Subject: [PATCH] [HACK] Disable colorized output in M-l window list - -vid_attr is not supported by NetBSD's libcurses, and this is not -crucial feature. ---- - ui.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/ui.c b/ui.c -index 64e83d3..407672c 100644 ---- a/ui.c -+++ b/ui.c -@@ -686,7 +686,6 @@ static void windowList(const struct Window *window) { - - char buf[TimeCap]; - strftime(buf, sizeof(buf), uiTime.format, localtime(&line->time)); -- vid_attr(colorAttr(Colors[Gray]), colorPair(Colors[Gray], -1), NULL); - printf("%s ", buf); - - bool align = false; -@@ -702,7 +701,6 @@ static void windowList(const struct Window *window) { - size_t tab = strcspn(str, "\t"); - if (tab < len) len = tab; - -- vid_attr(styleAttr(style), stylePair(style), NULL); - printf("%.*s", (int)len, str); - str += len; - } --- -2.32.0 - diff --git a/pkg/catgirl/patch/0005-HACK-Disable-colorized-output-in-M-l-window-list.patch b/pkg/catgirl/patch/0005-HACK-Disable-colorized-output-in-M-l-window-list.patch new file mode 100644 index 00000000..2e51b598 --- /dev/null +++ b/pkg/catgirl/patch/0005-HACK-Disable-colorized-output-in-M-l-window-list.patch @@ -0,0 +1,34 @@ +From 80dac47ee3aa26290cda962ab2531afb054bf47a Mon Sep 17 00:00:00 2001 +From: Michael Forney +Date: Thu, 3 Jun 2021 00:54:30 -0700 +Subject: [PATCH] [HACK] Disable colorized output in M-l window list + +vid_attr is not supported by NetBSD's libcurses, and this is not +crucial feature. +--- + ui.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/ui.c b/ui.c +index 64e83d3..407672c 100644 +--- a/ui.c ++++ b/ui.c +@@ -686,7 +686,6 @@ static void windowList(const struct Window *window) { + + char buf[TimeCap]; + strftime(buf, sizeof(buf), uiTime.format, localtime(&line->time)); +- vid_attr(colorAttr(Colors[Gray]), colorPair(Colors[Gray], -1), NULL); + printf("%s ", buf); + + bool align = false; +@@ -702,7 +701,6 @@ static void windowList(const struct Window *window) { + size_t tab = strcspn(str, "\t"); + if (tab < len) len = tab; + +- vid_attr(styleAttr(style), stylePair(style), NULL); + printf("%.*s", (int)len, str); + str += len; + } +-- +2.32.0 + diff --git a/pkg/catgirl/ver b/pkg/catgirl/ver index 4fef0332..aed89268 100644 --- a/pkg/catgirl/ver +++ b/pkg/catgirl/ver @@ -1 +1 @@ -1.9a r0 +1.9a r1 -- cgit v1.2.3