Subject: [alpine-aports] [PATCH] testing/imapfilter: patch password prompt flushing

From: Andrew Hills <[email-masked]>
Date: Thu, 28 May 2015 09:49:55 -0400

This is a temporary patch, while we wait for this pull request to
be merged upstream: https://github.com/lefcha/imapfilter/pull/92
---
 testing/imapfilter/APKBUILD       | 23 ++++++++++++++++++-----
 testing/imapfilter/io-flush.patch | 12 ++++++++++++
 2 files changed, 30 insertions(+), 5 deletions(-)
 create mode 100644 testing/imapfilter/io-flush.patch

diff --git a/testing/imapfilter/APKBUILD b/testing/imapfilter/APKBUILD
index 2beb7e2..956bd9a 100644
--- a/testing/imapfilter/APKBUILD
+++ b/testing/imapfilter/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Andrew Hills <[email-masked]>
 pkgname=imapfilter
 pkgver=2.5.7
-pkgrel=0
+pkgrel=1
 pkgdesc="Lua-based filtering for IMAP mailboxes"
 url="https://github.com/lefcha/imapfilter"
 arch="all"
@@ -12,10 +12,20 @@ depends_dev=
 makedepends="$depends_dev lua-dev openssl-dev pcre-dev libc-dev"
 install=
 subpackages="$pkgname-doc"
-source="saveas-https://github.com/lefcha/$pkgname/archive/v${pkgver}.tar.gz/$pkgname-$pkgver.tar.gz"
+source="saveas-https://github.com/lefcha/$pkgname/archive/v${pkgver}.tar.gz/$pkgname-$pkgver.tar.gz
+        io-flush.patch"

 _builddir="$srcdir"/$pkgname-$pkgver
+prepare() {
+    local i
+    cd "$_builddir"
+    for i in $source; do
+        case $i in
+        *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+        esac
+    done
+}
 
 build() {
 	cd "$_builddir"
@@ -30,6 +40,9 @@ package() {
         DESTDIR="$pkgdir" \
         install
 }
-md5sums="5af01afcca4a24b46f113f36bc3eaef8  imapfilter-2.5.7.tar.gz"
-sha256sums="c792d6a3a187cdc14fc38470837b45722a3750dabd2c6f71672806eeef79fad0  imapfilter-2.5.7.tar.gz"
-sha512sums="9297e98812312fbf2c92aa5477bdfecb522048e45b4bc4922e312bd89a72b020a98f5547e3f0882ae665c24db21e6995eda839b762947adc48bc413ab0c882f1  imapfilter-2.5.7.tar.gz"
+md5sums="5af01afcca4a24b46f113f36bc3eaef8  imapfilter-2.5.7.tar.gz
+c005e65cae202f8f6779380996d51ee1  io-flush.patch"
+sha256sums="c792d6a3a187cdc14fc38470837b45722a3750dabd2c6f71672806eeef79fad0  imapfilter-2.5.7.tar.gz
+14c49fd8ced2a0730a0b21e20e5b2149ad3a65eca55e258d591fef3f06befb59  io-flush.patch"
+sha512sums="9297e98812312fbf2c92aa5477bdfecb522048e45b4bc4922e312bd89a72b020a98f5547e3f0882ae665c24db21e6995eda839b762947adc48bc413ab0c882f1  imapfilter-2.5.7.tar.gz
+ab11ad7b52f0b56119e6da636bf4c53f09ca9f2fe8a7083fc9af9528ba0d67657b639283a3100868c919b3958c812ae7169d8879af4b7205f43207458e0b8073  io-flush.patch"
diff --git a/testing/imapfilter/io-flush.patch b/testing/imapfilter/io-flush.patch
new file mode 100644
index 0000000..ee42978
--- /dev/null
+++ b/testing/imapfilter/io-flush.patch
@@ -0,0 +1,12 @@
+diff --git a/src/auxiliary.lua b/src/auxiliary.lua
+index 9284d25..d59bf71 100644
+--- a/src/auxiliary.lua
++++ b/src/auxiliary.lua
+@@ -14,6 +14,7 @@ function get_password(prompt)
+     else
+         io.write('Enter password: ')
+     end
++    io.flush()
+     ifsys.noecho()
+     local p = io.read()
+     ifsys.echo()
-- 
2.4.2

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---