diff options
author | Sören Tempel <soeren+git@soeren-tempel.net> | 2015-12-21 03:46:11 +0100 |
---|---|---|
committer | Sören Tempel <soeren+git@soeren-tempel.net> | 2015-12-21 03:46:11 +0100 |
commit | def945176f32666f8918f86862b9f91a1ee0048c (patch) | |
tree | 7b37c8ebb5d448666bba1fb12e55731bfa2bd377 | |
parent | ae40ed17f1105605cbfee4fd8546faf659f50119 (diff) | |
download | aports-def945176f32666f8918f86862b9f91a1ee0048c.tar.bz2 aports-def945176f32666f8918f86862b9f91a1ee0048c.tar.xz |
testing/mmh: upgrade to 0.2
-rw-r--r-- | testing/mmh/APKBUILD | 27 | ||||
-rw-r--r-- | testing/mmh/musl-fixes.patch | 155 | ||||
-rw-r--r-- | testing/mmh/symlinks.patch | 12 |
3 files changed, 70 insertions, 124 deletions
diff --git a/testing/mmh/APKBUILD b/testing/mmh/APKBUILD index fab2e34865..808e3f1d58 100644 --- a/testing/mmh/APKBUILD +++ b/testing/mmh/APKBUILD @@ -1,19 +1,20 @@ # Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net> # Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net> pkgname=mmh -pkgver=0.1 -pkgrel=4 +pkgver=0.2 +pkgrel=0 pkgdesc="MUA for users who like the unix philosophy" url="http://marmaro.de/prog/mmh/" arch="all" license="BSD" depends="" -depends_dev="ncurses-dev" -makedepends="$depends_dev flex" +depends_dev="" +makedepends="ncurses-dev autoconf flex" install="" subpackages="$pkgname-doc" source="http://marmaro.de/prog/${pkgname}/files/${pkgname}-${pkgver}.tar.gz - musl-fixes.patch" + musl-fixes.patch + symlinks.patch" _builddir="$srcdir"/$pkgname-$pkgver prepare() { @@ -36,7 +37,6 @@ build() { --prefix=/usr \ --sysconfdir=/etc/$pkgname \ --mandir=/usr/share/man \ - --infodir=/usr/share/info \ --localstatedir=/var \ || return 1 make || return 1 @@ -47,9 +47,12 @@ package() { -C "$_builddir" install || return 1 } -md5sums="df9c3aa40dc4edb15fd7d6a39c4777cd mmh-0.1.tar.gz -b7a44eea5bdee97078b7e19a5d2031ee musl-fixes.patch" -sha256sums="68c4285b72d26f922390b594980535829025a973c910c8490b415543f4c774b1 mmh-0.1.tar.gz -2d232e308a7db86aa7e6893ea43052769c0684ae58336829b5c70739e5c801b8 musl-fixes.patch" -sha512sums="2b24795862ace1f093f1861bb90012160b6e6c253c743ca4de1ecce46bfd03707b9579a2113139e96a8638fe451f7693ba28605b123a76b80a955acc9f3f7080 mmh-0.1.tar.gz -e588bda54ecd1b61f8789550707a63f94efa0e172f3a012385044146005d8410643ea09d04d14ce1c1b14548905d8cf2db42714d5e7b157b2774ca207f06a978 musl-fixes.patch" +md5sums="f783e729a25cc3bbe4b856aca89b85b2 mmh-0.2.tar.gz +eb7946984ca385c6ad49e0f2ea5b2fa3 musl-fixes.patch +4351aef49407471609d1ab6047cafae2 symlinks.patch" +sha256sums="23a9f3bec1b43260b8a0b327825ce35b370ef19454585b3d4c8757599a7539ab mmh-0.2.tar.gz +a694cf2212787d7e924f61f23e276f92184cfb10fc38561deb88e532faec85ea musl-fixes.patch +bc91f0053297eeedb7dbffd5ca627cc6805f8b9987a4fd74c1eca5dee0a4666b symlinks.patch" +sha512sums="5fb38f94a8ff1b81e69af2d80f529796cb3c6685ece96f75a7c0f442a4b0d8ab2f21f7b97bcaf7fb7f1b1b29aff93750cbac33b370be20ff7f0730cf136893af mmh-0.2.tar.gz +a7a9df6c93cdc1fbd8c93b33eafa8f3749e56cc3bf10c97c18b6bf745fd2423b848aecd2334aa2c2531c0164ca558c592a44a3642c29436a9a7f159300ffc00b musl-fixes.patch +d6b92f582a15a2664f275b32e6ddf827fd0176e5e289a27bb210e9c58e02fa159bdf26c01f1227dad64ec5fb55ab5aac4b86246ba66ef46c656749be2a11842f symlinks.patch" diff --git a/testing/mmh/musl-fixes.patch b/testing/mmh/musl-fixes.patch index 4fc272695c..a1c0c8fe1c 100644 --- a/testing/mmh/musl-fixes.patch +++ b/testing/mmh/musl-fixes.patch @@ -1,34 +1,7 @@ ---- mmh-0.1.orig/sbr/discard.c -+++ mmh-0.1/sbr/discard.c -@@ -18,14 +18,6 @@ - - tcflush(fileno(io), TCOFLUSH); - --#if defined(_FSTDIO) || defined(__DragonFly__) -- fpurge(io); --#else --# ifdef LINUX_STDIO -- io->_IO_write_ptr = io->_IO_write_base; --# else -- if ((io->_ptr = io->_base)) -- io->_cnt = 0; --# endif --#endif -+ /* There used to be an fpurge() here on some platforms, stdio -+ hackery on others. But it didn't seem necessary. */ - } ---- mmh-0.1.orig/sbr/m_getfld.c -+++ mmh-0.1/sbr/m_getfld.c -@@ -137,7 +137,7 @@ - ** is used in m_Eom because the first character of the string - ** has been read and matched before m_Eom is called. - */ --char *msg_delim = ""; -+static char *msg_delim = ""; - - static unsigned char *fdelim; - static unsigned char *delimend; -@@ -147,26 +147,85 @@ +diff -upr mmh-0.2.orig/sbr/m_getfld.c mmh-0.2/sbr/m_getfld.c +--- mmh-0.2.orig/sbr/m_getfld.c 2015-12-21 03:36:00.060760463 +0100 ++++ mmh-0.2/sbr/m_getfld.c 2015-12-21 03:38:04.080205306 +0100 +@@ -149,26 +149,81 @@ static int edelimlen; static int (*eom_action)(int) = NULL; @@ -38,6 +11,10 @@ -# define _filbuf __srget /* Puke */ -# define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC -#endif +- +-#ifndef DEFINED__FILBUF_TO_SOMETHING_SPECIFIC +-extern int _filbuf(FILE*); +-#endif +/* +** This replaces the old approach, which included direct access to +** stdio internals. It uses one fread() to load a buffer that we @@ -49,10 +26,7 @@ + unsigned char *readpos; + unsigned char *end; /* One past the last character read in. */ +} m; - --#ifndef DEFINED__FILBUF_TO_SOMETHING_SPECIFIC --extern int _filbuf(FILE*); --#endif ++ +static void +setup_buffer(FILE *iob, struct m_getfld_buffer *m) +{ @@ -69,12 +43,12 @@ + m->readpos = m->end = m->msg_buf; + } +} - ++ +static size_t +read_more(struct m_getfld_buffer *m, FILE *iob) +{ + size_t num_read; - ++ + /* Move any leftover at the end of buf to the beginning. */ + if (m->end > m->readpos) { + memmove(m->msg_buf, m->readpos, m->end - m->readpos); @@ -82,7 +56,7 @@ + m->readpos = m->msg_buf + (m->end - m->readpos); + num_read = fread(m->readpos, 1, MSG_INPUT_SIZE, iob); + m->end = m->readpos + num_read; -+ + + return num_read; +} + @@ -107,26 +81,21 @@ +{ + return (m.readpos == m.msg_buf) ? EOF : (*--m.readpos = c); +} -+ -+ -+ + int m_getfld(int state, unsigned char *name, unsigned char *buf, int bufsz, FILE *iob) { -- register unsigned char *bp, *cp, *ep, *sp; -- register int cnt, c, i, j; -+ unsigned char *bp, *cp, *ep, *sp; + unsigned char *bp, *cp, *ep, *sp; +- int cnt, c, i, j; + int cnt, c, i, j, k; - if ((c = getc(iob)) < 0) { -+ setup_buffer(iob, &m); -+ + if ((c = Getc(iob)) < 0) { msg_count = 0; *buf = 0; return FILEEOF; -@@ -174,10 +233,10 @@ +@@ -176,10 +231,10 @@ m_getfld(int state, unsigned char *name, if (eom(c, iob)) { if (! eom_action) { /* flush null messages */ @@ -139,7 +108,7 @@ } msg_count = 0; *buf = 0; -@@ -190,16 +249,16 @@ +@@ -192,16 +247,16 @@ m_getfld(int state, unsigned char *name, case FLD: if (c == '\n' || c == '-') { /* we hit the header/body separator */ @@ -160,7 +129,7 @@ } msg_count = 0; *buf = 0; -@@ -216,47 +275,28 @@ +@@ -218,47 +273,28 @@ m_getfld(int state, unsigned char *name, cp = name; i = NAMESZ - 1; for (;;) { @@ -220,7 +189,7 @@ } if (c == ':') break; -@@ -310,7 +350,13 @@ +@@ -312,7 +348,14 @@ m_getfld(int state, unsigned char *name, ** that should be harmless enough, right? ** This is a corrupt message anyway. */ @@ -232,10 +201,11 @@ + ** e.g., get_content, can use ftell(), etc. + */ + fseek(iob, -cnt - 1, SEEK_CUR); ++ return BODY; } if ((i -= j) <= 0) { -@@ -334,16 +380,9 @@ +@@ -336,16 +379,9 @@ m_getfld(int state, unsigned char *name, */ cp = buf; i = bufsz-1; for (;;) { @@ -255,7 +225,7 @@ c = cnt < i ? cnt : i; while ((ep = locc( c, bp, '\n' ))) { /* -@@ -351,21 +390,13 @@ +@@ -353,21 +389,14 @@ m_getfld(int state, unsigned char *name, ** return. */ if ((j = *++ep) != ' ' && j != '\t') { @@ -281,10 +251,11 @@ + j = ep - m.readpos; + memcpy (cp, m.readpos, j); + m.readpos = ep; ++ cp += j; state = FLD; goto finish; -@@ -377,64 +408,34 @@ +@@ -379,64 +408,33 @@ m_getfld(int state, unsigned char *name, ** end of input or dest buffer - copy what ** we've found. */ @@ -315,7 +286,7 @@ - iob->_cnt -= c; - iob->_ptr += c; -#endif - state = FLDPLUS; +- state = FLDPLUS; break; } /* @@ -345,8 +316,8 @@ -#endif + *cp++ = j = Getc(iob); + c = Getc(iob); - if (c == EOF || - ((j == '\0' || j == '\n') && c != ' ' && c != '\t')) { + if (c == EOF || ((j == '\0' || j == '\n') + && c != ' ' && c != '\t')) { if (c != EOF) { -#ifdef LINUX_STDIO - --iob->_IO_read_ptr; @@ -365,7 +336,7 @@ } state = FLD; break; -@@ -452,17 +453,10 @@ +@@ -454,17 +452,10 @@ m_getfld(int state, unsigned char *name, ** don't add an eos. */ i = (bufsz < 0) ? -bufsz : bufsz-1; @@ -387,7 +358,7 @@ if (ismbox && c > 1) { /* ** packed maildrop - only take up to the (possible) -@@ -545,15 +539,8 @@ +@@ -547,15 +538,8 @@ m_getfld(int state, unsigned char *name, } } memcpy( buf, bp, c ); @@ -405,17 +376,9 @@ if (bufsz < 0) { msg_count = c; return (state); -@@ -574,16 +561,18 @@ - void - thisisanmbox(FILE *iob) - { -- register int c; -+ int c; - char text[10]; -- register char *cp; -- register char *delimstr; -+ char *cp; -+ char *delimstr; +@@ -581,11 +565,13 @@ thisisanmbox(FILE *iob) + char *cp; + char *delimstr; - c = getc(iob); + setup_buffer(iob, &m); @@ -429,7 +392,7 @@ /* ** Figure out what the message delimitter string is for this -@@ -597,7 +586,12 @@ +@@ -599,7 +585,12 @@ thisisanmbox(FILE *iob) ** abort. */ @@ -440,10 +403,10 @@ + } + } + if (c != 5) { - adios(NULL, "Read error"); + adios(EX_IOERR, NULL, "Read error"); } if (strncmp(text, "From ", 5)!=0) { -@@ -605,7 +599,7 @@ +@@ -607,7 +598,7 @@ thisisanmbox(FILE *iob) } ismbox = TRUE; delimstr = "\nFrom "; @@ -452,9 +415,9 @@ continue; } c = strlen(delimstr); -@@ -628,8 +622,9 @@ +@@ -630,8 +621,9 @@ thisisanmbox(FILE *iob) */ - pat_map = (unsigned char **) calloc(256, sizeof(unsigned char *)); + pat_map = (unsigned char **) mh_xcalloc(256, sizeof(unsigned char *)); - for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++ ) + for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++) { @@ -463,19 +426,16 @@ } -@@ -640,27 +635,34 @@ - static int - m_Eom(int c, FILE *iob) - { -- register long pos = 0L; -- register int i; -+ unsigned char *pos; -+ int i; +@@ -645,24 +637,31 @@ m_Eom(int c, FILE *iob) + long pos = 0L; + int i; char text[10]; + char *cp; - pos = ftell(iob); - if ((i = fread(text, sizeof *text, edelimlen, iob)) != edelimlen || +- (strncmp(text, (char *)edelim, edelimlen)!=0)) { +- if (i == 0 && ismbox) + pos = m.readpos; /* ftell */ + for (i=0, cp=text; i<edelimlen; ++i, ++cp) { + if ((*cp = Getc(iob)) == EOF) { @@ -484,8 +444,7 @@ + } + + if (i != edelimlen || - (strncmp(text, (char *)edelim, edelimlen)!=0)) { -- if (i == 0 && ismbox) ++ (strncmp(text, (char *)edelim, edelimlen)!=0)) { + if (i == 0 && ismbox) { /* ** the final newline in the (brain damaged) unix-format @@ -507,31 +466,3 @@ continue; } } -@@ -672,11 +674,11 @@ - static unsigned char * - matchc(int patln, char *pat, int strln, char *str) - { -- register char *es = str + strln - patln; -- register char *sp; -- register char *pp; -- register char *ep = pat + patln; -- register char pc = *pat++; -+ char *es = str + strln - patln; -+ char *sp; -+ char *pp; -+ char *ep = pat + patln; -+ char pc = *pat++; - - for(;;) { - while (pc != *str++) ---- mmh-0.1.orig/uip/Makefile.in -+++ mmh-0.1/uip/Makefile.in -@@ -32,7 +32,7 @@ - - COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS) - LINK = $(CC) $(LDFLAGS) -o $@ --LN = ln -+LN = ln -s - - INSTALL = @INSTALL@ - INSTALL_PROGRAM = @INSTALL_PROGRAM@ diff --git a/testing/mmh/symlinks.patch b/testing/mmh/symlinks.patch new file mode 100644 index 0000000000..f0679cc769 --- /dev/null +++ b/testing/mmh/symlinks.patch @@ -0,0 +1,12 @@ +diff -upr mmh-0.2.orig/uip/Makefile.in mmh-0.2/uip/Makefile.in +--- mmh-0.2.orig/uip/Makefile.in 2015-12-21 03:41:33.425934861 +0100 ++++ mmh-0.2/uip/Makefile.in 2015-12-21 03:42:09.715772415 +0100 +@@ -33,7 +33,7 @@ LEXLIB = @LEXLIB@ + + COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CFLAGS) + LINK = $(CC) $(LDFLAGS) -o $@ +-LN = ln ++LN = ln -s + + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ |