summaryrefslogtreecommitdiff
path: root/core/s-nail
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2014-02-03 03:28:00 +0000
committerNicolás Reynolds <fauno@endefensadelsl.org>2014-02-03 03:28:00 +0000
commit5646de4a9273897b8a619641ed988c4bb217a509 (patch)
tree9f4c0ca7e9066f8eb5f065eb7102d06d923470b2 /core/s-nail
parent171120794a952c6e0e75aef6ecdf46cd6d5154c8 (diff)
Mon Feb 3 03:26:00 UTC 2014
Diffstat (limited to 'core/s-nail')
-rw-r--r--core/s-nail/PKGBUILD15
-rw-r--r--core/s-nail/sort.patch75
2 files changed, 86 insertions, 4 deletions
diff --git a/core/s-nail/PKGBUILD b/core/s-nail/PKGBUILD
index afdc8a507..21c91e6ca 100644
--- a/core/s-nail/PKGBUILD
+++ b/core/s-nail/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 204556 2014-01-22 16:33:11Z bisson $
+# $Id: PKGBUILD 205003 2014-02-02 20:56:12Z bisson $
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s@arch@gmail.com>
@@ -6,15 +6,17 @@
pkgname=s-nail
pkgver=14.5.2
-pkgrel=1
+pkgrel=2
pkgdesc='Mail processing system with a command syntax reminiscent of ed'
url='http://sdaoden.users.sourceforge.net/code.html#s-nail'
license=('custom:BSD')
arch=('i686' 'x86_64')
depends=('openssl')
optdepends=('smtp-forwarder: for sending mail')
-source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}-${pkgver//./_}.tar.xz")
-sha1sums=('26ad43f5f41b429d5f13a3ce73a3dff75325950c')
+source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}-${pkgver//./_}.tar.xz"
+ 'sort.patch')
+sha1sums=('26ad43f5f41b429d5f13a3ce73a3dff75325950c'
+ '909da731e590d1d2877ed38bed667440a02d1259')
groups=('base')
backup=('etc/mail.rc')
@@ -22,6 +24,11 @@ replaces=('mailx' 'mailx-heirloom' 'heirloom-mailx')
provides=('mailx' 'mailx-heirloom' 'heirloom-mailx')
conflicts=('mailx' 'mailx-heirloom' 'heirloom-mailx')
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -p1 -i ../sort.patch # http://sourceforge.net/mailarchive/message.php?msg_id=31906477
+}
+
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
make \
diff --git a/core/s-nail/sort.patch b/core/s-nail/sort.patch
new file mode 100644
index 000000000..fdb8d526d
--- /dev/null
+++ b/core/s-nail/sort.patch
@@ -0,0 +1,75 @@
+s-nail-14_5_2-sort.patch, 2014-01-30:
+
+Apply:
+ $ cd s-nail-14.5.2
+ $ patch -bu < s-nail-14_5_2-sort.patch
+
+Description:
+Reverses (sort(),thread(): use srelax()!, 2014-01-18, [a9b67e9]), which
+was a hasty commit of an untested diff that i've added few minutes
+beforehand.
+It was of course wrong.
+The problem (no memory relaxation during entire sort operation) requires
+a different approach (either only relax when we don't need to hold
+dope storage (as for SORT_TO/SORT_FROM/SORT_SUBJECT/+) or use heap
+memory for those allocations, then).
+
+s-nail-14_5_2-sort-alt.patch is an alternative working thesis that uses
+heap allocations, thus continues to relax the dope storage.
+This version has been pushed to [master].
+
+diff --git a/thread.c b/thread.c
+index 3ac5966..9ec1ac9 100644
+--- a/thread.c
++++ b/thread.c
+@@ -361,8 +361,6 @@ makethreads(struct message *m, long cnt, int nmail)
+ return;
+ mprime = nextprime(cnt);
+ mt = scalloc(mprime, sizeof *mt);
+-
+- srelax_hold();
+ for (i = 0; i < cnt; i++) {
+ if ((m[i].m_flag&MHIDDEN) == 0) {
+ mlook(NULL, mt, &m[i], mprime);
+@@ -376,7 +374,6 @@ makethreads(struct message *m, long cnt, int nmail)
+ m[i].m_level = 0;
+ if (!nmail && !(inhook&2))
+ m[i].m_collapsed = 0;
+- srelax();
+ }
+ /*
+ * Most folders contain the eldest messages first. Traversing
+@@ -387,12 +384,8 @@ makethreads(struct message *m, long cnt, int nmail)
+ * are replies to the one message, and are sorted such that
+ * youngest messages occur first.
+ */
+- for (i = cnt-1; i >= 0; i--) {
++ for (i = cnt-1; i >= 0; i--)
+ lookup(&m[i], mt, mprime);
+- srelax();
+- }
+- srelax_rele();
+-
+ threadroot = interlink(m, cnt, nmail);
+ finalize(threadroot);
+ free(mt);
+@@ -572,8 +565,6 @@ sort(void *vp)
+ default:
+ break;
+ }
+-
+- srelax_hold();
+ for (n = 0, i = 0; i < msgCount; i++) {
+ mp = &message[i];
+ if ((mp->m_flag&MHIDDEN) == 0) {
+@@ -637,10 +628,7 @@ sort(void *vp)
+ mp->m_child = mp->m_younger = mp->m_elder = mp->m_parent = NULL;
+ mp->m_level = 0;
+ mp->m_collapsed = 0;
+- srelax();
+ }
+- srelax_rele();
+-
+ if (n > 0) {
+ qsort(ms, n, sizeof *ms, func);
+ threadroot = &message[ms[0].ms_n];