Hello Stuart!

Thanks for looking into this.

Stuart Henderson <[email protected]> wrote:
 |On 2018/03/08 17:35, Steffen Nurpmeso wrote:
 |> This brings in two and a half years of development and bug fixes.
 |> It has really improved, though a long road is ahead still.
 |> Changelog etc. at: https://www.sdaoden.eu/code-nail-ann.html
 ...
 |> +FIX_EXTRACT_PERMISSIONS=Yes
 |
 |You're upstream aren't you - is there a reason for the unusual
 |permissions in the tar file?

In a future release i will thus create the balls with a different
umask(1) so this should then no longer be necessary.
I gave the credit William (finally) and you (thanks).

 |It picks up idn2 in preference to idn if present at build, so
 |WANTLIB/LIB_DEPENDS needs fixing.

..Ok.. hmm.  I must say i dislike the entire IDN stuff very very
much (if 25 years ago the DNS had some extensions to support
longer labels UTF-8 could be it; even globally), so instead i have
changed the configuration to prefer IDN over IDN2, and added the
changeset as a patch for the OpenBSD port.  I really would prefer
this approach and have no IDN2 around, if possible. ?

 |$ make port-lib-depends-check
 |s-nail-14.9.9(mail/s-nail):
 |Missing lib: idn2.1 (/usr/local/bin/nail) (NOT REACHABLE)
 |Extra:  idn.17

Should work now.

Also i add a fix for a double-free that sneaked into the codebase,
unfortunately.  We have builtin double-free detection, terrible ...

Running "make test" does not work because we verify $HOME is an
accessible directory, which the port framework does not provide.
(The message is "nail: $HOME is not a directory or not accessible:
/s-nail-14.9.9_writes_to_HOME", but we do not write, we only
verify because $HOME is indeed target for several standardized
files which we possibly would need to address.)  Due to that the
error messages invalidate the test checksums.

Running the regression test manually succeeds:

  ?0[steffen@obsd s-nail-14.9.9]$ pwd
  /usr/ports/pobj/s-nail-14.9.9/s-nail-14.9.9
  ?0[steffen@obsd s-nail-14.9.9]$ make test
  /bin/sh ./cc-test.sh --check-only ./nail
...

except for t_behave_attachments which fails because i once again
have made it and escaped a newline in a printf(1) statement (and
did not retest on all platforms after doing so).
Ciao,

Index: Makefile
===================================================================
RCS file: /cvs/ports/mail/s-nail/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- Makefile    8 Dec 2017 01:04:14 -0000       1.19
+++ Makefile    9 Mar 2018 17:31:14 -0000
@@ -1,45 +1,43 @@
 # $OpenBSD: Makefile,v 1.19 2017/12/08 01:04:14 espie Exp $
 
-COMMENT=               enhanced, MIME capable Berkeley Mail
+COMMENT=       SysV mail/BSD Mail/POSIX mailx: send and receive mail
 
-DISTNAME=              s-nail-14.8.16
-CATEGORIES=            mail
-HOMEPAGE=              https://www.sdaoden.eu/code.html\#s-mailx
-FIX_EXTRACT_PERMISSIONS=Yes
+DISTNAME=      s-nail-14.9.9
+CATEGORIES=    mail
+HOMEPAGE=      https://www.sdaoden.eu/code.html\#s-mailx
+MAINTAINER=    Dmitrij D. Czarkoff <[email protected]>
 
 # BSD
-PERMIT_PACKAGE_CDROM=  Yes
-
-WANTLIB += c crypto iconv idn ssl
+PERMIT_PACKAGE_CDROM=Yes
 
-MASTER_SITES=          https://www.sdaoden.eu/downloads/
-MAINTAINER=            Dmitrij D. Czarkoff <[email protected]>
+MASTER_SITES=  https://ftp.sdaoden.eu/
+# XXX remove FIX_EXTRACT_PERMISSIONS with update to version >14.9.9
+FIX_EXTRACT_PERMISSIONS=Yes
 
-MAKE_FILE=             makefile
-MAKE_FLAGS=            CC="${CC}" \
-                       CFLAGS="${CFLAGS}" \
-                       C_INCLUDE_PATH="${LOCALBASE}/include" \
-                       LDFLAGS="${LDFLAGS}" \
-                       LD_LIBRARY_PATH="${LOCALBASE}/lib" \
-                       MANDIR="${PREFIX}/man" \
-                       SYSCONFDIR="${SYSCONFDIR}" \
-                       WANT_AUTOCC=0 \
-                       WANT_EDITLINE=0 \
-                       WANT_NCL=1 \
-                       WANT_DOTLOCK=0 \
-                       SID=
+WANTLIB=       c crypto curses iconv idn ssl
+LIB_DEPENDS=   converters/libiconv \
+               devel/libidn
+# xxx Verifies an accessible $HOME, which "make test" does not provide
+NO_TEST=       Yes
+
+MAKE_FILE=     makefile
+MAKE_FLAGS=    C_INCLUDE_PATH="${LOCALBASE}/include" \
+               LD_LIBRARY_PATH="${LOCALBASE}/lib" \
+               VAL_MANDIR="${PREFIX}/man" \
+               VAL_SYSCONFDIR="${SYSCONFDIR}" \
+               VAL_SID= \
+               \
+               OPT_AUTOCC=no \
+               OPT_DOTLOCK=no \
+               OPT_SPAM_SPAMC=yes \
+               OPT_SSL_RANDOM=no
 
 .if !empty(DEBUG)
-MAKE_FLAGS+=           WANT_DEBUG=1
-FAKE_FLAGS+=           WANT_DEBUG=1
+MAKE_FLAGS+=   OPT_DEBUG=yes
+FAKE_FLAGS+=   OPT_DEBUG=yes
 .endif
 
-MAKE_ENV=              VERBOSE=Yes
-
-LIB_DEPENDS=           converters/libiconv \
-                       devel/libidn
-
-INSTALL_TARGET=                packager-install
+MAKE_ENV=      VERBOSE=anynonempty
 
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/nail
Index: distinfo
===================================================================
RCS file: /cvs/ports/mail/s-nail/distinfo,v
retrieving revision 1.13
diff -u -p -r1.13 distinfo
--- distinfo    29 Jan 2017 06:08:51 -0000      1.13
+++ distinfo    9 Mar 2018 17:31:14 -0000
@@ -1,2 +1,2 @@
-SHA256 (s-nail-14.8.16.tar.gz) = xpt0+0scKhokHVOfVTFUpx53TocSI+6AjoY5Zl2bTMo=
-SIZE (s-nail-14.8.16.tar.gz) = 604423
+SHA256 (s-nail-14.9.9.tar.gz) = zb0ni2NPMt+A8i0KP8flmw1fPUGhn+9GOO/LbC0ZhJA=
+SIZE (s-nail-14.9.9.tar.gz) = 885904
Index: patches/patch-make_config_sh
===================================================================
RCS file: patches/patch-make_config_sh
diff -N patches/patch-make_config_sh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-make_config_sh        9 Mar 2018 17:31:14 -0000
@@ -0,0 +1,67 @@
+$OpenBSD$
+Author:     Steffen Nurpmeso <[email protected]>
+AuthorDate: 2018-03-09 16:14:31 +0100
+Commit:     Steffen Nurpmeso <[email protected]>
+CommitDate: 2018-03-09 16:14:42 +0100
+
+    make-config.sh: prefer libidn over libidn2 (Stuart Henderson)
+---
+ make-config.sh | 38 +++++++++++++++++++-------------------
+ 1 file changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/make-config.sh b/make-config.sh
+index 5b5a2d7f..242f8b8b 100644
+--- make-config.sh
++++ make-config.sh
+@@ -2675,25 +2675,7 @@ feat_def NETRC
+ feat_def AGENT
+ 
+ if feat_yes IDNA; then
+-   if link_check idna 'Libidn2' '#define HAVE_IDNA HAVE_IDNA_LIBIDN2' \
+-         '-lidn2' << \!
+-#include <idn2.h>
+-int main(void){
+-   char *idna_utf8, *idna_lc;
+-
+-   if(idn2_to_ascii_8z("does.this.work", &idna_utf8,
+-         IDN2_NONTRANSITIONAL | IDN2_TRANSITIONAL) != IDN2_OK)
+-      return 1;
+-   if(idn2_to_unicode_8zlz(idna_utf8, &idna_lc, 0) != IDN2_OK)
+-      return 1;
+-   idn2_free(idna_lc);
+-   idn2_free(idna_utf8);
+-   return 0;
+-}
+-!
+-   then
+-      :
+-   elif link_check idna 'GNU Libidn' '#define HAVE_IDNA HAVE_IDNA_LIBIDNA' \
++   if link_check idna 'GNU Libidn' '#define HAVE_IDNA HAVE_IDNA_LIBIDNA' \
+          '-lidn' << \!
+ #include <idna.h>
+ #include <idn-free.h>
+@@ -2710,6 +2692,24 @@ int main(void){
+    idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
+    return 0;
+ }
++!
++   then
++      :
++   elif link_check idna 'Libidn2' '#define HAVE_IDNA HAVE_IDNA_LIBIDN2' \
++         '-lidn2' << \!
++#include <idn2.h>
++int main(void){
++   char *idna_utf8, *idna_lc;
++
++   if(idn2_to_ascii_8z("does.this.work", &idna_utf8,
++         IDN2_NONTRANSITIONAL | IDN2_TRANSITIONAL) != IDN2_OK)
++      return 1;
++   if(idn2_to_unicode_8zlz(idna_utf8, &idna_lc, 0) != IDN2_OK)
++      return 1;
++   idn2_free(idna_lc);
++   idn2_free(idna_utf8);
++   return 0;
++}
+ !
+    then
+       :
Index: patches/patch-mime_c
===================================================================
RCS file: patches/patch-mime_c
diff -N patches/patch-mime_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-mime_c        9 Mar 2018 17:31:14 -0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+Author:     Steffen Nurpmeso <[email protected]>
+AuthorDate: 2018-03-09 18:05:04 +0100
+Commit:     Steffen Nurpmeso <[email protected]>
+CommitDate: 2018-03-09 18:05:04 +0100
+
+    a_mime__convhdra(): FIX double free (sic!!!)
+---
+ mime.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/mime.c b/mime.c
+index 8b913ce8..ac068ad3 100644
+--- mime.c
++++ mime.c
+@@ -650,6 +650,7 @@ a_mime__convhdra(struct str *inp, FILE *fp, size_t *colp,
+          goto jleave;
+       }
+       *inp = ciconv;
++      ciconv.s = NULL;
+    }
+ 
+    rv = mime_write_tohdr(inp, fp, colp, msh);
Index: patches/patch-nail_rc
===================================================================
RCS file: patches/patch-nail_rc
diff -N patches/patch-nail_rc
--- patches/patch-nail_rc       20 Oct 2016 10:49:23 -0000      1.5
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-nail_rc,v 1.5 2016/10/20 10:49:23 czarkoff Exp $
-
---- nail.rc.orig       Wed Oct  5 12:04:53 2016
-+++ nail.rc    Sat Oct  8 03:38:20 2016
-@@ -43,6 +43,9 @@ set ask
- # *header* on a per-folder basis (it is meaningless unless *header* is set)
- set bsdannounce
- 
-+# Use the traditional BSD Mail interface style.
-+set bsdcompat
-+
- # Uncomment this in order to get coloured output in $PAGER.
- # (Coloured output is only used if $TERM is either found in *colour-terms*
- # or includes the string "color")
Index: pkg/DESCR
===================================================================
RCS file: /cvs/ports/mail/s-nail/pkg/DESCR,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 DESCR
--- pkg/DESCR   29 Mar 2013 03:54:34 -0000      1.1.1.1
+++ pkg/DESCR   9 Mar 2018 17:31:14 -0000
@@ -1,5 +1,4 @@
-S-nail is a fork of Heirloom mailx, formerly known as nail.  It is a mail user
-agent derived from Berkeley Mail 8.1 and is intended to provide the
-functionality of the POSIX.2 mailx command with additional support for MIME
-messages, Maildir, POP3, IMAP, SMTP, threading, spam control, and other
-features.
+S-nail provides a simple and friendly environment for sending and receiving
+mail.  It is intended to provide the functionality of the POSIX mailx(1)
+command, but is MIME capable and optionally offers extensions for line editing,
+S/MIME, SMTP and POP3, among others.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Reply via email to