summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Morante2016-03-18 10:23:20 +0200
committerOscar Morante2016-03-18 10:23:20 +0200
commit61d13e4634cc6165508b1319da0b2a926cf3e69a (patch)
tree67dc07becfa8c4842a445fdc582b4b607cca55cb
parentea84c5d530e5f3e97789a769fd5a7977b567b575 (diff)
downloadaur-mutt-patched.tar.gz
add Aaron Schrab's date_conditional patch
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD9
-rw-r--r--ats.date_conditional.patch121
3 files changed, 130 insertions, 4 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bcfff9f26185..5ce9e4f4ca27 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -3,7 +3,7 @@
pkgbase = mutt-patched
pkgdesc = Small but very powerful text-based mail client (plus a huge pile of patches mostly from debian)
pkgver = 1.5.24
- pkgrel = 3
+ pkgrel = 4
url = http://www.mutt.org/
install = install
arch = i686
@@ -65,6 +65,7 @@ pkgbase = mutt-patched
source = sidebar-compose.patch
source = sidebar-new.patch
source = nntp.patch
+ source = ats.date_conditional.patch
sha1sums = 38a2da5eb01ff83a90a2caee28fa2e95dbfe6898
sha1sums = 1ad77bdf742ff584b5695f1908dde83044195c0e
sha1sums = 92fe7a726545424db6fc0f8b0612eeeeabb0fef4
@@ -107,6 +108,7 @@ pkgbase = mutt-patched
sha1sums = ba0a5082ef9da710644f4bd71d08b25ccfb7fb8a
sha1sums = ffc14992c112e262d994929102369df2be729ea9
sha1sums = f0f0278d0b369d7d42c338f0c751e46fa5ec915a
+ sha1sums = 8ccb2a97bbe13936be10577c8526893309666f1a
pkgname = mutt-patched
diff --git a/PKGBUILD b/PKGBUILD
index b39209cb46b7..9e9e178ab1b2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=mutt-patched
pkgver=1.5.24
-pkgrel=3
+pkgrel=4
pkgdesc='Small but very powerful text-based mail client (plus a huge pile of patches mostly from debian)'
url='http://www.mutt.org/'
license=('GPL')
@@ -59,6 +59,7 @@ source=(
'sidebar-compose.patch'
'sidebar-new.patch'
'nntp.patch'
+ 'ats.date_conditional.patch'
)
sha1sums=('38a2da5eb01ff83a90a2caee28fa2e95dbfe6898'
'1ad77bdf742ff584b5695f1908dde83044195c0e'
@@ -101,8 +102,9 @@ sha1sums=('38a2da5eb01ff83a90a2caee28fa2e95dbfe6898'
'19fd36f9a1f15d4481f08d90f9a88d3912e12cdb'
'ba0a5082ef9da710644f4bd71d08b25ccfb7fb8a'
'ffc14992c112e262d994929102369df2be729ea9'
- 'f0f0278d0b369d7d42c338f0c751e46fa5ec915a')
-
+ 'f0f0278d0b369d7d42c338f0c751e46fa5ec915a'
+ '8ccb2a97bbe13936be10577c8526893309666f1a'
+)
install=install
prepare() {
@@ -149,6 +151,7 @@ prepare() {
patch -Np1 -i "${srcdir}/sidebar-compose.patch"
patch -Np1 -i "${srcdir}/sidebar-new.patch"
patch -Np1 -i "${srcdir}/nntp.patch"
+ patch -Np1 -i "${srcdir}/ats.date_conditional.patch"
autoreconf -vfi
}
diff --git a/ats.date_conditional.patch b/ats.date_conditional.patch
new file mode 100644
index 000000000000..c2011e154386
--- /dev/null
+++ b/ats.date_conditional.patch
@@ -0,0 +1,121 @@
+Allows you to construct format expressions based on relative dates.
+
+This adds conditionality features to mutt's date-formatting operators,
+so that you can build conditions based on whether the date in question
+is less than or grater than some amount in the past.
+
+Example: %?[1y?less than one year&greater than one year?
+Example: %?[3d?less than three days&greater than three days?
+
+This is particularly useful in concert with nested_if. For example,
+this expression:
+ %<[1y?%<[1w?%<[1d?%[ %H:%M]&%[%a %d]>&%[%b %d]>&%[%y%m%d]>
+
+means to show the YYMMDD date for messages older than one year, the "mon
+dd" date for messages from one week to one year, the "day dd" date for
+messages from 1 to 7 days old, and the HH:MM time for messages under one
+day old.
+
+diff -r e2b6d94be38e hdrline.c
+--- a/hdrline.c Mon Jan 03 13:24:23 2011 -0600
++++ b/hdrline.c Mon Jan 03 13:24:27 2011 -0600
+@@ -341,6 +341,53 @@
+ 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;
+
+@@ -364,6 +411,7 @@
+ {
+ cp++;
+ if ((*cp == 'Z' || *cp == 'z') && (op == 'd' || op == '{'))
++ /* brace balancer: } */
+ {
+ if (len >= 5)
+ {
+diff -r e2b6d94be38e muttlib.c
+--- a/muttlib.c Mon Jan 03 13:24:23 2011 -0600
++++ b/muttlib.c Mon Jan 03 13:24:27 2011 -0600
+@@ -1239,7 +1239,16 @@
+ if (*src == '?')
+ {
+ flags |= M_FORMAT_OPTIONAL;
++ ch = *(++src); /* save the character to switch on */
+ src++;
++ cp = prefix;
++ count = 0;
++ while (count < sizeof (prefix) && *src != '?')
++ {
++ *cp++ = *src++;
++ count++;
++ }
++ *cp = 0;
+ }
+ else
+ {
+@@ -1255,12 +1264,13 @@
+ count++;
+ }
+ *cp = 0;
++
++ if (!*src)
++ break; /* bad format */
++
++ ch = *src++; /* save the character to switch on */
+ }
+
+- if (!*src)
+- break; /* bad format */
+-
+- ch = *src++; /* save the character to switch on */
+
+ if (flags & M_FORMAT_OPTIONAL)
+ {