From e61aa7eaf6889b623fbe5c534bfea424020c48e9 Mon Sep 17 00:00:00 2001 From: Derek Schrock Date: Mon, 18 Dec 2017 13:43:24 -0500 Subject: [PATCH] Move date_conditional to local port files/ date_conditional lacks versions so any updates will result in a new hash --- mail/mutt/Makefile | 2 - mail/mutt/distinfo | 4 +- mail/mutt/files/patch-date-conditional | 97 ++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 mail/mutt/files/patch-date-conditional diff --git a/mail/mutt/Makefile b/mail/mutt/Makefile index 67a79051f87c..8322846ec378 100644 --- a/mail/mutt/Makefile +++ b/mail/mutt/Makefile @@ -17,10 +17,8 @@ EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} PATCH_SITES+= http://www.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ http://www2.mutt.org.ua/download/mutt-${VVV_PATCH_VERSION}/:vvv \ - https://github.com/aschrab/mutt/compare/dev-base...feature/:ats \ http://vc.org.ua/mutt/:vc PATCH_DIST_STRIP= -p1 -PATCHFILES= date-conditional.diff:ats MAINTAINER?= dereks@lifeofadishwasher.com COMMENT?= Small but powerful text based program for read/writing e-mail diff --git a/mail/mutt/distinfo b/mail/mutt/distinfo index f811a3a838b3..2b64a7e1c8d5 100644 --- a/mail/mutt/distinfo +++ b/mail/mutt/distinfo @@ -1,8 +1,6 @@ -TIMESTAMP = 1506285098 +TIMESTAMP = 1513622572 SHA256 (mutt/mutt-1.9.1.tar.gz) = 749b83a96373c6e2101ebe8c4b9a651735e02c478edb750750a5146a15d91bb1 SIZE (mutt/mutt-1.9.1.tar.gz) = 4193868 -SHA256 (mutt/date-conditional.diff) = 8936c5fe7a2a62a68f2a8d001c7a6dddf138c48186a338482b6639507ba9133e -SIZE (mutt/date-conditional.diff) = 2023 SHA256 (mutt/mutt-1.9.0.vc.greeting) = b4ac804c24a07c7eb8330ebfdc94cdbf6fd7a4671badfb32fb611df09c008317 SIZE (mutt/mutt-1.9.0.vc.greeting) = 4534 SHA256 (mutt/patch-1.9.1.vvv.nntp.gz) = f7098b713dfcbb2a4a6e5edaf536eb99be6d92fad073d5d3ac436b0191c7c892 diff --git a/mail/mutt/files/patch-date-conditional b/mail/mutt/files/patch-date-conditional new file mode 100644 index 000000000000..9cbae9c3718a --- /dev/null +++ b/mail/mutt/files/patch-date-conditional @@ -0,0 +1,97 @@ +--- PATCHES.orig 2017-12-03 03:10:17 UTC ++++ PATCHES +@@ -0,0 +1 @@ ++patch-1.5.0.ats.date_conditional.1 +--- hdrline.c.orig 2017-12-03 03:10:17 UTC ++++ hdrline.c +@@ -428,6 +428,53 @@ hdr_format_str (char *dest, + const char *cp; + struct tm *tm; + time_t T; ++ int i = 0, invert = 0; ++ ++ if (optional && (op == '[' || op == '(')) { ++ char *is; ++ T = time(NULL); ++ T -= (op == '(') ? hdr->received : hdr->date_sent; ++ ++ is = (char *)prefix; ++ if( *is == '>' ) { ++ invert = 1; ++ ++is; ++ } ++ ++ while( *is && *is != '?' ) { ++ int t = strtol (is, &is, 10); ++ switch (*(is++)) { ++ case '?': ++ break; ++ case 'y': ++ t *= 365 * 24 * 60 * 60; ++ break; ++ case 'M': ++ t *= 30 * 24 * 60 * 60; ++ break; ++ case 'w': ++ t *= 7 * 24 * 60 * 60; ++ break; ++ case 'd': ++ t *= 24 * 60 * 60; ++ break; ++ case 'h': ++ t *= 60 * 60; ++ break; ++ case 'm': ++ t *= 60; ++ break; ++ } ++ i += t; ++ } ++ ++ if (i < 0) ++ i *= -1; ++ ++ if( (T > i || T < -1*i) ^ invert ) ++ optional = 0; ++ break; ++ } + + p = dest; + +--- muttlib.c.orig 2017-12-03 03:10:17 UTC ++++ muttlib.c +@@ -1335,7 +1335,16 @@ void mutt_FormatString (char *dest, /* + if (*src == '?') + { + flags |= MUTT_FORMAT_OPTIONAL; +- src++; ++ ch = *(++src); /* save the character to switch on */ ++ cp = prefix; ++ ++src; ++ count = 0; ++ while (count < sizeof (prefix) && *src != '?') ++ { ++ *cp++ = *src++; ++ count++; ++ } ++ *cp = 0; + } + else + { +@@ -1351,12 +1360,12 @@ void mutt_FormatString (char *dest, /* + count++; + } + *cp = 0; +- } + +- if (!*src) +- break; /* bad format */ ++ if (!*src) ++ break; /* bad format */ + +- ch = *src++; /* save the character to switch on */ ++ ch = *src++; /* save the character to switch on */ ++ } + + if (flags & MUTT_FORMAT_OPTIONAL) + { -- 2.15.1