Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Miles Alan
aports
Commits
def94517
Commit
def94517
authored
9 years ago
by
Sören Tempel
Browse files
Options
Downloads
Patches
Plain Diff
testing/mmh: upgrade to 0.2
parent
ae40ed17
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
testing/mmh/APKBUILD
+15
-12
15 additions, 12 deletions
testing/mmh/APKBUILD
testing/mmh/musl-fixes.patch
+43
-112
43 additions, 112 deletions
testing/mmh/musl-fixes.patch
testing/mmh/symlinks.patch
+12
-0
12 additions, 0 deletions
testing/mmh/symlinks.patch
with
70 additions
and
124 deletions
testing/mmh/APKBUILD
+
15
−
12
View file @
def94517
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname
=
mmh
pkgname
=
mmh
pkgver
=
0.
1
pkgver
=
0.
2
pkgrel
=
4
pkgrel
=
0
pkgdesc
=
"MUA for users who like the unix philosophy"
pkgdesc
=
"MUA for users who like the unix philosophy"
url
=
"http://marmaro.de/prog/mmh/"
url
=
"http://marmaro.de/prog/mmh/"
arch
=
"all"
arch
=
"all"
license
=
"BSD"
license
=
"BSD"
depends
=
""
depends
=
""
depends_dev
=
"
ncurses-dev
"
depends_dev
=
""
makedepends
=
"
$depends_dev
flex"
makedepends
=
"
ncurses-dev autoconf
flex"
install
=
""
install
=
""
subpackages
=
"
$pkgname
-doc"
subpackages
=
"
$pkgname
-doc"
source
=
"http://marmaro.de/prog/
${
pkgname
}
/files/
${
pkgname
}
-
${
pkgver
}
.tar.gz
source
=
"http://marmaro.de/prog/
${
pkgname
}
/files/
${
pkgname
}
-
${
pkgver
}
.tar.gz
musl-fixes.patch"
musl-fixes.patch
symlinks.patch"
_builddir
=
"
$srcdir
"
/
$pkgname
-
$pkgver
_builddir
=
"
$srcdir
"
/
$pkgname
-
$pkgver
prepare
()
{
prepare
()
{
...
@@ -36,7 +37,6 @@ build() {
...
@@ -36,7 +37,6 @@ build() {
--prefix
=
/usr
\
--prefix
=
/usr
\
--sysconfdir
=
/etc/
$pkgname
\
--sysconfdir
=
/etc/
$pkgname
\
--mandir
=
/usr/share/man
\
--mandir
=
/usr/share/man
\
--infodir
=
/usr/share/info
\
--localstatedir
=
/var
\
--localstatedir
=
/var
\
||
return
1
||
return
1
make
||
return
1
make
||
return
1
...
@@ -47,9 +47,12 @@ package() {
...
@@ -47,9 +47,12 @@ package() {
-C
"
$_builddir
"
install
||
return
1
-C
"
$_builddir
"
install
||
return
1
}
}
md5sums
=
"df9c3aa40dc4edb15fd7d6a39c4777cd mmh-0.1.tar.gz
md5sums
=
"f783e729a25cc3bbe4b856aca89b85b2 mmh-0.2.tar.gz
b7a44eea5bdee97078b7e19a5d2031ee musl-fixes.patch"
eb7946984ca385c6ad49e0f2ea5b2fa3 musl-fixes.patch
sha256sums
=
"68c4285b72d26f922390b594980535829025a973c910c8490b415543f4c774b1 mmh-0.1.tar.gz
4351aef49407471609d1ab6047cafae2 symlinks.patch"
2d232e308a7db86aa7e6893ea43052769c0684ae58336829b5c70739e5c801b8 musl-fixes.patch"
sha256sums
=
"23a9f3bec1b43260b8a0b327825ce35b370ef19454585b3d4c8757599a7539ab mmh-0.2.tar.gz
sha512sums
=
"2b24795862ace1f093f1861bb90012160b6e6c253c743ca4de1ecce46bfd03707b9579a2113139e96a8638fe451f7693ba28605b123a76b80a955acc9f3f7080 mmh-0.1.tar.gz
a694cf2212787d7e924f61f23e276f92184cfb10fc38561deb88e532faec85ea musl-fixes.patch
e588bda54ecd1b61f8789550707a63f94efa0e172f3a012385044146005d8410643ea09d04d14ce1c1b14548905d8cf2db42714d5e7b157b2774ca207f06a978 musl-fixes.patch"
bc91f0053297eeedb7dbffd5ca627cc6805f8b9987a4fd74c1eca5dee0a4666b symlinks.patch"
sha512sums
=
"5fb38f94a8ff1b81e69af2d80f529796cb3c6685ece96f75a7c0f442a4b0d8ab2f21f7b97bcaf7fb7f1b1b29aff93750cbac33b370be20ff7f0730cf136893af mmh-0.2.tar.gz
a7a9df6c93cdc1fbd8c93b33eafa8f3749e56cc3bf10c97c18b6bf745fd2423b848aecd2334aa2c2531c0164ca558c592a44a3642c29436a9a7f159300ffc00b musl-fixes.patch
d6b92f582a15a2664f275b32e6ddf827fd0176e5e289a27bb210e9c58e02fa159bdf26c01f1227dad64ec5fb55ab5aac4b86246ba66ef46c656749be2a11842f symlinks.patch"
This diff is collapsed.
Click to expand it.
testing/mmh/musl-fixes.patch
+
43
−
112
View file @
def94517
--- mmh-0.1.orig/sbr/discard.c
diff -upr mmh-0.2.orig/sbr/m_getfld.c mmh-0.2/sbr/m_getfld.c
+++ mmh-0.1/sbr/discard.c
--- mmh-0.2.orig/sbr/m_getfld.c 2015-12-21 03:36:00.060760463 +0100
@@ -18,14 +18,6 @@
+++ mmh-0.2/sbr/m_getfld.c 2015-12-21 03:38:04.080205306 +0100
@@ -149,26 +149,81 @@
static int edelimlen;
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 @@
static int (*eom_action)(int) = NULL;
static int (*eom_action)(int) = NULL;
...
@@ -38,6 +11,10 @@
...
@@ -38,6 +11,10 @@
-# define _filbuf __srget /* Puke */
-# define _filbuf __srget /* Puke */
-# define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
-# define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
-#endif
-#endif
-
-#ifndef DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
-extern int _filbuf(FILE*);
-#endif
+/*
+/*
+** This replaces the old approach, which included direct access to
+** This replaces the old approach, which included direct access to
+** stdio internals. It uses one fread() to load a buffer that we
+** stdio internals. It uses one fread() to load a buffer that we
...
@@ -49,10 +26,7 @@
...
@@ -49,10 +26,7 @@
+ unsigned char *readpos;
+ unsigned char *readpos;
+ unsigned char *end; /* One past the last character read in. */
+ unsigned char *end; /* One past the last character read in. */
+} m;
+} m;
+
-#ifndef DEFINED__FILBUF_TO_SOMETHING_SPECIFIC
-extern int _filbuf(FILE*);
-#endif
+static void
+static void
+setup_buffer(FILE *iob, struct m_getfld_buffer *m)
+setup_buffer(FILE *iob, struct m_getfld_buffer *m)
+{
+{
...
@@ -69,12 +43,12 @@
...
@@ -69,12 +43,12 @@
+ m->readpos = m->end = m->msg_buf;
+ m->readpos = m->end = m->msg_buf;
+ }
+ }
+}
+}
+
+static size_t
+static size_t
+read_more(struct m_getfld_buffer *m, FILE *iob)
+read_more(struct m_getfld_buffer *m, FILE *iob)
+{
+{
+ size_t num_read;
+ size_t num_read;
+
+ /* Move any leftover at the end of buf to the beginning. */
+ /* Move any leftover at the end of buf to the beginning. */
+ if (m->end > m->readpos) {
+ if (m->end > m->readpos) {
+ memmove(m->msg_buf, m->readpos, m->end - m->readpos);
+ memmove(m->msg_buf, m->readpos, m->end - m->readpos);
...
@@ -82,7 +56,7 @@
...
@@ -82,7 +56,7 @@
+ m->readpos = m->msg_buf + (m->end - m->readpos);
+ m->readpos = m->msg_buf + (m->end - m->readpos);
+ num_read = fread(m->readpos, 1, MSG_INPUT_SIZE, iob);
+ num_read = fread(m->readpos, 1, MSG_INPUT_SIZE, iob);
+ m->end = m->readpos + num_read;
+ m->end = m->readpos + num_read;
+
+ return num_read;
+ return num_read;
+}
+}
+
+
...
@@ -107,26 +81,21 @@
...
@@ -107,26 +81,21 @@
+{
+{
+ return (m.readpos == m.msg_buf) ? EOF : (*--m.readpos = c);
+ return (m.readpos == m.msg_buf) ? EOF : (*--m.readpos = c);
+}
+}
+
+
+
int
int
m_getfld(int state, unsigned char *name, unsigned char *buf,
m_getfld(int state, unsigned char *name, unsigned char *buf,
int bufsz, FILE *iob)
int bufsz, FILE *iob)
{
{
- register unsigned char *bp, *cp, *ep, *sp;
unsigned char *bp, *cp, *ep, *sp;
- register int cnt, c, i, j;
- int cnt, c, i, j;
+ unsigned char *bp, *cp, *ep, *sp;
+ int cnt, c, i, j, k;
+ int cnt, c, i, j, k;
- if ((c = getc(iob)) < 0) {
- if ((c = getc(iob)) < 0) {
+ setup_buffer(iob, &m);
+
+ if ((c = Getc(iob)) < 0) {
+ if ((c = Getc(iob)) < 0) {
msg_count = 0;
msg_count = 0;
*buf = 0;
*buf = 0;
return FILEEOF;
return FILEEOF;
@@ -17
4
,10 +23
3
,10 @@
@@ -17
6
,10 +23
1
,10 @@
m_getfld(int state, unsigned char *name,
if (eom(c, iob)) {
if (eom(c, iob)) {
if (! eom_action) {
if (! eom_action) {
/* flush null messages */
/* flush null messages */
...
@@ -139,7 +108,7 @@
...
@@ -139,7 +108,7 @@
}
}
msg_count = 0;
msg_count = 0;
*buf = 0;
*buf = 0;
@@ -19
0
,16 +24
9
,16 @@
@@ -19
2
,16 +24
7
,16 @@
m_getfld(int state, unsigned char *name,
case FLD:
case FLD:
if (c == '\n' || c == '-') {
if (c == '\n' || c == '-') {
/* we hit the header/body separator */
/* we hit the header/body separator */
...
@@ -160,7 +129,7 @@
...
@@ -160,7 +129,7 @@
}
}
msg_count = 0;
msg_count = 0;
*buf = 0;
*buf = 0;
@@ -21
6
,47 +27
5
,28 @@
@@ -21
8
,47 +27
3
,28 @@
m_getfld(int state, unsigned char *name,
cp = name;
cp = name;
i = NAMESZ - 1;
i = NAMESZ - 1;
for (;;) {
for (;;) {
...
@@ -220,7 +189,7 @@
...
@@ -220,7 +189,7 @@
}
}
if (c == ':')
if (c == ':')
break;
break;
@@ -31
0
,7 +3
50
,1
3
@@
@@ -31
2
,7 +3
48
,1
4
@@
m_getfld(int state, unsigned char *name,
** that should be harmless enough, right?
** that should be harmless enough, right?
** This is a corrupt message anyway.
** This is a corrupt message anyway.
*/
*/
...
@@ -232,10 +201,11 @@
...
@@ -232,10 +201,11 @@
+ ** e.g., get_content, can use ftell(), etc.
+ ** e.g., get_content, can use ftell(), etc.
+ */
+ */
+ fseek(iob, -cnt - 1, SEEK_CUR);
+ fseek(iob, -cnt - 1, SEEK_CUR);
+
return BODY;
return BODY;
}
}
if ((i -= j) <= 0) {
if ((i -= j) <= 0) {
@@ -33
4
,16 +3
80
,9 @@
@@ -33
6
,16 +3
79
,9 @@
m_getfld(int state, unsigned char *name,
*/
*/
cp = buf; i = bufsz-1;
cp = buf; i = bufsz-1;
for (;;) {
for (;;) {
...
@@ -255,7 +225,7 @@
...
@@ -255,7 +225,7 @@
c = cnt < i ? cnt : i;
c = cnt < i ? cnt : i;
while ((ep = locc( c, bp, '\n' ))) {
while ((ep = locc( c, bp, '\n' ))) {
/*
/*
@@ -35
1
,21 +39
0
,1
3
@@
@@ -35
3
,21 +3
8
9,1
4
@@
m_getfld(int state, unsigned char *name,
** return.
** return.
*/
*/
if ((j = *++ep) != ' ' && j != '\t') {
if ((j = *++ep) != ' ' && j != '\t') {
...
@@ -281,10 +251,11 @@
...
@@ -281,10 +251,11 @@
+ j = ep - m.readpos;
+ j = ep - m.readpos;
+ memcpy (cp, m.readpos, j);
+ memcpy (cp, m.readpos, j);
+ m.readpos = ep;
+ m.readpos = ep;
+
cp += j;
cp += j;
state = FLD;
state = FLD;
goto finish;
goto finish;
@@ -37
7
,64 +408,3
4
@@
@@ -37
9
,64 +408,3
3
@@
m_getfld(int state, unsigned char *name,
** end of input or dest buffer - copy what
** end of input or dest buffer - copy what
** we've found.
** we've found.
*/
*/
...
@@ -315,7 +286,7 @@
...
@@ -315,7 +286,7 @@
- iob->_cnt -= c;
- iob->_cnt -= c;
- iob->_ptr += c;
- iob->_ptr += c;
-#endif
-#endif
state = FLDPLUS;
-
state = FLDPLUS;
break;
break;
}
}
/*
/*
...
@@ -345,8 +316,8 @@
...
@@ -345,8 +316,8 @@
-#endif
-#endif
+ *cp++ = j = Getc(iob);
+ *cp++ = j = Getc(iob);
+ c = Getc(iob);
+ c = Getc(iob);
if (c == EOF ||
if (c == EOF ||
((j == '\0' || j == '\n')
((j == '\0' || j == '\n')
&& c != ' ' && c != '\t')) {
&& c != ' ' && c != '\t')) {
if (c != EOF) {
if (c != EOF) {
-#ifdef LINUX_STDIO
-#ifdef LINUX_STDIO
- --iob->_IO_read_ptr;
- --iob->_IO_read_ptr;
...
@@ -365,7 +336,7 @@
...
@@ -365,7 +336,7 @@
}
}
state = FLD;
state = FLD;
break;
break;
@@ -45
2
,17 +45
3
,10 @@
@@ -45
4
,17 +45
2
,10 @@
m_getfld(int state, unsigned char *name,
** don't add an eos.
** don't add an eos.
*/
*/
i = (bufsz < 0) ? -bufsz : bufsz-1;
i = (bufsz < 0) ? -bufsz : bufsz-1;
...
@@ -387,7 +358,7 @@
...
@@ -387,7 +358,7 @@
if (ismbox && c > 1) {
if (ismbox && c > 1) {
/*
/*
** packed maildrop - only take up to the (possible)
** packed maildrop - only take up to the (possible)
@@ -54
5
,15 +53
9
,8 @@
@@ -54
7
,15 +53
8
,8 @@
m_getfld(int state, unsigned char *name,
}
}
}
}
memcpy( buf, bp, c );
memcpy( buf, bp, c );
...
@@ -405,17 +376,9 @@
...
@@ -405,17 +376,9 @@
if (bufsz < 0) {
if (bufsz < 0) {
msg_count = c;
msg_count = c;
return (state);
return (state);
@@ -574,16 +561,18 @@
@@ -581,11 +565,13 @@
thisisanmbox(FILE *iob)
void
char *cp;
thisisanmbox(FILE *iob)
char *delimstr;
{
- register int c;
+ int c;
char text[10];
- register char *cp;
- register char *delimstr;
+ char *cp;
+ char *delimstr;
- c = getc(iob);
- c = getc(iob);
+ setup_buffer(iob, &m);
+ setup_buffer(iob, &m);
...
@@ -429,7 +392,7 @@
...
@@ -429,7 +392,7 @@
/*
/*
** Figure out what the message delimitter string is for this
** Figure out what the message delimitter string is for this
@@ -59
7
,7 +58
6
,12 @@
@@ -59
9
,7 +58
5
,12 @@
thisisanmbox(FILE *iob)
** abort.
** abort.
*/
*/
...
@@ -440,10 +403,10 @@
...
@@ -440,10 +403,10 @@
+ }
+ }
+ }
+ }
+ if (c != 5) {
+ if (c != 5) {
adios(NULL, "Read error");
adios(
EX_IOERR,
NULL, "Read error");
}
}
if (strncmp(text, "From ", 5)!=0) {
if (strncmp(text, "From ", 5)!=0) {
@@ -60
5
,7 +59
9
,7 @@
@@ -60
7
,7 +59
8
,7 @@
thisisanmbox(FILE *iob)
}
}
ismbox = TRUE;
ismbox = TRUE;
delimstr = "\nFrom ";
delimstr = "\nFrom ";
...
@@ -452,9 +415,9 @@
...
@@ -452,9 +415,9 @@
continue;
continue;
}
}
c = strlen(delimstr);
c = strlen(delimstr);
@@ -6
28
,8 +62
2
,9 @@
@@ -6
30
,8 +62
1
,9 @@
thisisanmbox(FILE *iob)
*/
*/
pat_map = (unsigned char **) calloc(256, sizeof(unsigned char *));
pat_map = (unsigned char **)
mh_x
calloc(256, sizeof(unsigned char *));
- for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++ )
- for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++ )
+ for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++) {
+ for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++) {
...
@@ -463,19 +426,16 @@
...
@@ -463,19 +426,16 @@
}
}
@@ -640,27 +635,34 @@
@@ -645,24 +637,31 @@
m_Eom(int c, FILE *iob)
static int
long pos = 0L;
m_Eom(int c, FILE *iob)
int i;
{
- register long pos = 0L;
- register int i;
+ unsigned char *pos;
+ int i;
char text[10];
char text[10];
+ char *cp;
+ char *cp;
- pos = ftell(iob);
- pos = ftell(iob);
- if ((i = fread(text, sizeof *text, edelimlen, iob)) != edelimlen ||
- if ((i = fread(text, sizeof *text, edelimlen, iob)) != edelimlen ||
- (strncmp(text, (char *)edelim, edelimlen)!=0)) {
- if (i == 0 && ismbox)
+ pos = m.readpos; /* ftell */
+ pos = m.readpos; /* ftell */
+ for (i=0, cp=text; i<edelimlen; ++i, ++cp) {
+ for (i=0, cp=text; i<edelimlen; ++i, ++cp) {
+ if ((*cp = Getc(iob)) == EOF) {
+ if ((*cp = Getc(iob)) == EOF) {
...
@@ -484,8 +444,7 @@
...
@@ -484,8 +444,7 @@
+ }
+ }
+
+
+ if (i != edelimlen ||
+ if (i != edelimlen ||
(strncmp(text, (char *)edelim, edelimlen)!=0)) {
+ (strncmp(text, (char *)edelim, edelimlen)!=0)) {
- if (i == 0 && ismbox)
+ if (i == 0 && ismbox) {
+ if (i == 0 && ismbox) {
/*
/*
** the final newline in the (brain damaged) unix-format
** the final newline in the (brain damaged) unix-format
...
@@ -507,31 +466,3 @@
...
@@ -507,31 +466,3 @@
continue;
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@
This diff is collapsed.
Click to expand it.
testing/mmh/symlinks.patch
0 → 100644
+
12
−
0
View file @
def94517
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@
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment