fix(3p/notmuch): Rebase dottime patch on notmuch 0.31
Change-Id: I43e8f59cd7f58b9c8b501983edbe55a3cb2f20d0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2241 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
parent
6197e4bc81
commit
316a4fa1e0
2 changed files with 31 additions and 16 deletions
3
third_party/notmuch/default.nix
vendored
3
third_party/notmuch/default.nix
vendored
|
@ -3,7 +3,4 @@
|
||||||
pkgs.originals.notmuch.overrideAttrs(old: {
|
pkgs.originals.notmuch.overrideAttrs(old: {
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
patches = [ ./dottime.patch ] ++ (if old ? patches then old.patches else []);
|
patches = [ ./dottime.patch ] ++ (if old ? patches then old.patches else []);
|
||||||
|
|
||||||
# TODO(tazjin): Fix the build and re-enable CI.
|
|
||||||
meta.ci = false;
|
|
||||||
})
|
})
|
||||||
|
|
44
third_party/notmuch/dottime.patch
vendored
44
third_party/notmuch/dottime.patch
vendored
|
@ -1,5 +1,16 @@
|
||||||
|
From 569438172fa0e38129de4e61a72e06eff3330dca Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vincent Ambo <tazjin@google.com>
|
||||||
|
Date: Thu, 10 Dec 2020 10:53:47 +0100
|
||||||
|
Subject: [PATCH] time: Use dottime for formatting non-relative timestamps
|
||||||
|
|
||||||
|
---
|
||||||
|
notmuch-time.c | 10 +++++-----
|
||||||
|
util/gmime-extra.c | 7 +++++--
|
||||||
|
util/gmime-extra.h | 2 ++
|
||||||
|
3 files changed, 12 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
diff --git a/notmuch-time.c b/notmuch-time.c
|
diff --git a/notmuch-time.c b/notmuch-time.c
|
||||||
index 2734b36a..b1ec4bdc 100644
|
index cc7ffc23..3030a667 100644
|
||||||
--- a/notmuch-time.c
|
--- a/notmuch-time.c
|
||||||
+++ b/notmuch-time.c
|
+++ b/notmuch-time.c
|
||||||
@@ -50,8 +50,8 @@ notmuch_time_relative_date (const void *ctx, time_t then)
|
@@ -50,8 +50,8 @@ notmuch_time_relative_date (const void *ctx, time_t then)
|
||||||
|
@ -13,33 +24,33 @@ index 2734b36a..b1ec4bdc 100644
|
||||||
|
|
||||||
result = talloc_zero_size (ctx, RELATIVE_DATE_MAX);
|
result = talloc_zero_size (ctx, RELATIVE_DATE_MAX);
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
@@ -79,16 +79,16 @@ notmuch_time_relative_date (const void *ctx, time_t then)
|
@@ -78,16 +78,16 @@ notmuch_time_relative_date (const void *ctx, time_t then)
|
||||||
delta < DAY)
|
if (tm_then.tm_wday == tm_now.tm_wday &&
|
||||||
{
|
delta < DAY) {
|
||||||
strftime (result, RELATIVE_DATE_MAX,
|
strftime (result, RELATIVE_DATE_MAX,
|
||||||
- "Today %R", &tm_then); /* Today 12:30 */
|
- "Today %R", &tm_then); /* Today 12:30 */
|
||||||
+ "Today %k·%M", &tm_then); /* Today 12·30 */
|
+ "Today %k·%M", &tm_then); /* Today 12·30 */
|
||||||
return result;
|
return result;
|
||||||
} else if ((tm_now.tm_wday + 7 - tm_then.tm_wday) % 7 == 1) {
|
} else if ((tm_now.tm_wday + 7 - tm_then.tm_wday) % 7 == 1) {
|
||||||
strftime (result, RELATIVE_DATE_MAX,
|
strftime (result, RELATIVE_DATE_MAX,
|
||||||
- "Yest. %R", &tm_then); /* Yest. 12:30 */
|
- "Yest. %R", &tm_then); /* Yest. 12:30 */
|
||||||
+ "Yest. %k·%M", &tm_then); /* Yest. 12·30 */
|
+ "Yest. %k·%M", &tm_then); /* Yest. 12·30 */
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
if (tm_then.tm_wday != tm_now.tm_wday) {
|
if (tm_then.tm_wday != tm_now.tm_wday) {
|
||||||
strftime (result, RELATIVE_DATE_MAX,
|
strftime (result, RELATIVE_DATE_MAX,
|
||||||
- "%a. %R", &tm_then); /* Mon. 12:30 */
|
- "%a. %R", &tm_then); /* Mon. 12:30 */
|
||||||
+ "%a. %k·%M", &tm_then); /* Mon. 12·30 */
|
+ "%a. %k·%M", &tm_then); /* Mon. 12·30 */
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/util/gmime-extra.c b/util/gmime-extra.c
|
diff --git a/util/gmime-extra.c b/util/gmime-extra.c
|
||||||
index d1bb1d47..9df5a454 100644
|
index 04d8ed3d..868a2f69 100644
|
||||||
--- a/util/gmime-extra.c
|
--- a/util/gmime-extra.c
|
||||||
+++ b/util/gmime-extra.c
|
+++ b/util/gmime-extra.c
|
||||||
@@ -124,7 +124,10 @@ g_mime_message_get_date_string (void *ctx, GMimeMessage *message)
|
@@ -131,10 +131,13 @@ g_mime_message_get_date_string (void *ctx, GMimeMessage *message)
|
||||||
{
|
GDateTime *parsed_date = g_mime_message_get_date (message);
|
||||||
GDateTime* parsed_date = g_mime_message_get_date (message);
|
|
||||||
if (parsed_date) {
|
if (parsed_date) {
|
||||||
- char *date = g_mime_utils_header_format_date (parsed_date);
|
- char *date = g_mime_utils_header_format_date (parsed_date);
|
||||||
+ char *date = g_date_time_format(
|
+ char *date = g_date_time_format(
|
||||||
|
@ -48,9 +59,13 @@ index d1bb1d47..9df5a454 100644
|
||||||
+ );
|
+ );
|
||||||
return g_string_talloc_strdup (ctx, date);
|
return g_string_talloc_strdup (ctx, date);
|
||||||
} else {
|
} else {
|
||||||
return talloc_strdup(ctx, "Thu, 01 Jan 1970 00:00:00 +0000");
|
- return talloc_strdup (ctx, "Thu, 01 Jan 1970 00:00:00 +0000");
|
||||||
|
+ return talloc_strdup (ctx, "Thu, 01 Jan 1970 00·00:00");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
diff --git a/util/gmime-extra.h b/util/gmime-extra.h
|
diff --git a/util/gmime-extra.h b/util/gmime-extra.h
|
||||||
index b0c8d3d8..40f748f8 100644
|
index 094309ec..e6c98f8d 100644
|
||||||
--- a/util/gmime-extra.h
|
--- a/util/gmime-extra.h
|
||||||
+++ b/util/gmime-extra.h
|
+++ b/util/gmime-extra.h
|
||||||
@@ -1,5 +1,7 @@
|
@@ -1,5 +1,7 @@
|
||||||
|
@ -61,3 +76,6 @@ index b0c8d3d8..40f748f8 100644
|
||||||
#include <gmime/gmime.h>
|
#include <gmime/gmime.h>
|
||||||
#include <talloc.h>
|
#include <talloc.h>
|
||||||
|
|
||||||
|
--
|
||||||
|
2.29.2.576.ga3fc446d84-goog
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue