diff options
author | Stefan Eßer <se@FreeBSD.org> | 2020-09-23 12:24:21 +0000 |
---|---|---|
committer | Stefan Eßer <se@FreeBSD.org> | 2020-09-23 12:24:21 +0000 |
commit | 540662a45772c921857e51c29031d8bce7b18172 (patch) | |
tree | 57079510a401b60f2ba3f7cfb6971c3625d616b1 | |
parent | devel/golangci-lint: Update to 1.31.0 (diff) |
Fix build with -fno-common
Since files that are patched in legacy patch files are affected, all
patches are regenerated with make makepatch.
In order to have makepatch operate on only the patched sources without the
result of RE_INPLACE being integrated into the patch files, move the
in-place editing of sources from post-patch to pre-build.
Notes
Notes:
svn path=/head/; revision=549719
-rw-r--r-- | mail/mboxgrep/Makefile | 4 | ||||
-rw-r--r-- | mail/mboxgrep/files/patch-noredundancy | 16 | ||||
-rw-r--r-- | mail/mboxgrep/files/patch-src_Makefile.in | 28 | ||||
-rw-r--r-- | mail/mboxgrep/files/patch-src_main.c | 23 | ||||
-rw-r--r-- | mail/mboxgrep/files/patch-src_mboxgrep.h | 35 | ||||
-rw-r--r-- | mail/mboxgrep/files/patch-src_scan.c (renamed from mail/mboxgrep/files/patch-md5) | 86 | ||||
-rw-r--r-- | mail/mboxgrep/files/patch-src_scan.h | 13 |
7 files changed, 125 insertions, 80 deletions
diff --git a/mail/mboxgrep/Makefile b/mail/mboxgrep/Makefile index f35269411047..4461fc12cba5 100644 --- a/mail/mboxgrep/Makefile +++ b/mail/mboxgrep/Makefile @@ -3,7 +3,7 @@ PORTNAME= mboxgrep PORTVERSION= 0.7.9 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= mail MASTER_SITES= SF @@ -29,7 +29,7 @@ OPTIONS_DEFINE= DOCS PCRE PCRE_LIB_DEPENDS= libpcre.so:devel/pcre -post-patch: +pre-build: @${REINPLACE_CMD} -e 's,void \*tmpp,FILE \*tmpp,g' ${WRKSRC}/src/main.c @${REINPLACE_CMD} -e 's,$$(prefix),$$(DESTDIR)$$(prefix),g' \ -e 's,$$(mandir),$$(DESTDIR)$$(mandir),g' \ diff --git a/mail/mboxgrep/files/patch-noredundancy b/mail/mboxgrep/files/patch-noredundancy deleted file mode 100644 index 1d942eb86761..000000000000 --- a/mail/mboxgrep/files/patch-noredundancy +++ /dev/null @@ -1,16 +0,0 @@ ---- src/Makefile.in Sun Mar 30 18:07:10 2003 -+++ src/Makefile.in Tue Feb 27 16:50:18 2007 -@@ -22,10 +22,10 @@ - CC = @CC@ - OBJS = info.o main.o mh.o scan.o maildir.o mbox.o misc.o \ -- wrap.o getopt.o getopt1.o md5.o -+ wrap.o - SRCS = info.c main.c mh.c scan.c maildir.c mbox.c misc.c \ -- wrap.c getopt.c getopt1.c md5.c -+ wrap.c - TARGET = mboxgrep - CFLAGS = @CFLAGS@ --LIBS = @LIBS@ -+LIBS = @LIBS@ -lcrypto - INSTALL = @INSTALL@ - prefix = @prefix@ diff --git a/mail/mboxgrep/files/patch-src_Makefile.in b/mail/mboxgrep/files/patch-src_Makefile.in new file mode 100644 index 000000000000..0e71264bbe1e --- /dev/null +++ b/mail/mboxgrep/files/patch-src_Makefile.in @@ -0,0 +1,28 @@ +--- src/Makefile.in.orig 2003-03-30 23:07:10 UTC ++++ src/Makefile.in +@@ -21,12 +21,12 @@ srcdir = @srcdir@ + + CC = @CC@ + OBJS = info.o main.o mh.o scan.o maildir.o mbox.o misc.o \ +- wrap.o getopt.o getopt1.o md5.o ++ wrap.o + SRCS = info.c main.c mh.c scan.c maildir.c mbox.c misc.c \ +- wrap.c getopt.c getopt1.c md5.c ++ wrap.c + TARGET = mboxgrep + CFLAGS = @CFLAGS@ +-LIBS = @LIBS@ ++LIBS = @LIBS@ -lcrypto + INSTALL = @INSTALL@ + prefix = @prefix@ + SHELL = /bin/sh +@@ -51,7 +51,7 @@ distclean: + + .PHONY: install + install: mboxgrep +- $(INSTALL) -d $(prefix)/bin +- $(INSTALL) -s $(TARGET) $(prefix)/bin ++ $(INSTALL) -d $(DESTDIR)$(prefix)/bin ++ $(INSTALL) -s $(TARGET) $(DESTDIR)$(prefix)/bin + + .NOEXPORT: diff --git a/mail/mboxgrep/files/patch-src_main.c b/mail/mboxgrep/files/patch-src_main.c new file mode 100644 index 000000000000..e5a42981f622 --- /dev/null +++ b/mail/mboxgrep/files/patch-src_main.c @@ -0,0 +1,23 @@ +--- src/main.c.orig 2003-08-24 19:23:50 UTC ++++ src/main.c +@@ -55,8 +55,9 @@ pcre_extra *hints; + char *boxname, *outboxname, *pipecmd, *tmpfilename; + int maildir_count = 0; + int count = 0; +-void *tmpp; ++FILE *tmpp; + checksum_t *cs; ++option_t config; + + int + main (int argc, char **argv) +@@ -238,8 +239,7 @@ main (int argc, char **argv) + config.pid = (int) getpid (); + } + +- cs = (checksum_t *) xmalloc (sizeof (checksum_t)); +- cs->md5 = (char **) xcalloc (1, sizeof (char **)); ++ cs = xmalloc (sizeof (checksum_t)); + cs->n = 0; + + if (optind < argc && ! haveregex) diff --git a/mail/mboxgrep/files/patch-src_mboxgrep.h b/mail/mboxgrep/files/patch-src_mboxgrep.h new file mode 100644 index 000000000000..3552201d7072 --- /dev/null +++ b/mail/mboxgrep/files/patch-src_mboxgrep.h @@ -0,0 +1,35 @@ +--- src/mboxgrep.h.orig 2003-04-06 21:01:49 UTC ++++ src/mboxgrep.h +@@ -28,6 +28,7 @@ + #define HOST_NAME_SIZE 256 + + #include <config.h> ++#include <stdint.h> + + #include <time.h> /* for tm structure */ + +@@ -99,10 +100,15 @@ typedef struct + } + folder_t; + ++typedef union { ++ uint64_t halves[2]; ++ unsigned char bytes[16]; ++} md5_t; ++ + typedef struct + { +- char **md5; + int n; ++ md5_t md5s[]; + } + checksum_t; + +@@ -129,6 +135,6 @@ typedef struct + } + option_t; + +-option_t config; ++extern option_t config; + + #endif /* MBOXGREP_H */ diff --git a/mail/mboxgrep/files/patch-md5 b/mail/mboxgrep/files/patch-src_scan.c index 87e6f297a58f..2584f0c4408a 100644 --- a/mail/mboxgrep/files/patch-md5 +++ b/mail/mboxgrep/files/patch-src_scan.c @@ -1,36 +1,16 @@ ---- src/mboxgrep.h Sun Apr 6 17:01:49 2003 -+++ src/mboxgrep.h Tue Feb 27 17:24:30 2007 -@@ -29,4 +29,5 @@ - - #include <config.h> -+#include <stdint.h> - - #include <time.h> /* for tm structure */ -@@ -100,8 +101,13 @@ - folder_t; - -+typedef union { -+ uint64_t halves[2]; -+ unsigned char bytes[16]; -+} md5_t; -+ - typedef struct - { -- char **md5; - int n; -+ md5_t md5s[]; - } - checksum_t; ---- src/scan.c Sun Apr 6 17:01:49 2003 -+++ src/scan.c Tue Feb 27 17:19:23 2007 -@@ -60,5 +60,5 @@ +--- src/scan.c.orig 2003-04-06 21:01:49 UTC ++++ src/scan.c +@@ -59,7 +59,7 @@ + #include "mh.h" #include "maildir.h" #include "wrap.h" -#include "md5.h" +#include <openssl/md5.h> #ifdef HAVE_FTS_OPEN # include <sys/stat.h> -@@ -74,5 +74,8 @@ + # include <fts.h> +@@ -73,7 +73,10 @@ + #include <dmalloc.h> #endif /* HAVE_LIBDMALLOC */ -void scan_mailbox (char path[]) @@ -40,13 +20,17 @@ +scan_mailbox (const char path[]) /* {{{ */ { -@@ -96,5 +99,4 @@ + static FILE *outf; +@@ -95,7 +98,6 @@ void scan_mailbox (char path[]) + int isdup = 0; time_t tt; struct tm *ct; - extern checksum_t *cs; extern option_t config; -@@ -145,10 +147,10 @@ + +@@ -144,12 +146,12 @@ void scan_mailbox (char path[]) + if ((config.format == MBOX) || (config.format == ZMBOX) || (config.format == BZ2MBOX)) - msg = (message_t *) mbox_read_message (mbox); @@ -60,14 +44,18 @@ + msg = maildir_read_message (maildird); if (msg == NULL) break; -@@ -179,5 +181,5 @@ + +@@ -178,7 +180,7 @@ void scan_mailbox (char path[]) + } if (config.dedup) - isdup = md5_check_message (msg->body, cs); + isdup = md5_check_message (msg->body, msg->bbytes); if (((res1 == 0) | (res2 == 0)) ^ ((config.invert ^ delete)) && -@@ -282,5 +284,6 @@ + ((config.dedup && !isdup) || !config.dedup)) +@@ -281,7 +283,8 @@ void scan_mailbox (char path[]) + } /* }}} */ -void recursive_scan (char path[]) @@ -75,14 +63,16 @@ +recursive_scan (const char path[]) /* {{{ */ -@@ -313,5 +316,5 @@ + { +@@ -312,37 +315,41 @@ void recursive_scan (char path[]) + fts_close (ftsfoo); } #else - ftw (path, (void *) scan_mailbox, 1); + ftw (path, (int (*)(const char *, const struct *, int))scan_mailbox, 1); #endif /* HAVE_FTS_OPEN */ } -@@ -319,29 +322,33 @@ + /* }}} */ -int md5_check_message (char *body, checksum_t *chksum) @@ -129,32 +119,4 @@ + cs->n++; return 0; ---- src/scan.h Sun Mar 30 18:07:10 2003 -+++ src/scan.h Tue Feb 27 16:51:58 2007 -@@ -24,7 +24,6 @@ - #include "mboxgrep.h" - --void scan_mailbox (char path[]); --void recursive_scan (char path[]); --int md5_check_message (char *body, checksum_t *chksum); -+void scan_mailbox(const char path[]); -+void recursive_scan(const char path[]); - - #endif /* SCAN_H */ ---- src/main.c Sun Aug 24 15:23:50 2003 -+++ src/main.c Tue Feb 27 17:25:30 2007 -@@ -56,5 +56,5 @@ - int maildir_count = 0; - int count = 0; --void *tmpp; -+FILE *tmpp; - checksum_t *cs; - -@@ -239,6 +239,5 @@ - } - -- cs = (checksum_t *) xmalloc (sizeof (checksum_t)); -- cs->md5 = (char **) xcalloc (1, sizeof (char **)); -+ cs = xmalloc (sizeof (checksum_t)); - cs->n = 0; - + } diff --git a/mail/mboxgrep/files/patch-src_scan.h b/mail/mboxgrep/files/patch-src_scan.h new file mode 100644 index 000000000000..c37be2d579ad --- /dev/null +++ b/mail/mboxgrep/files/patch-src_scan.h @@ -0,0 +1,13 @@ +--- src/scan.h.orig 2003-03-30 23:07:10 UTC ++++ src/scan.h +@@ -23,8 +23,7 @@ + + #include "mboxgrep.h" + +-void scan_mailbox (char path[]); +-void recursive_scan (char path[]); +-int md5_check_message (char *body, checksum_t *chksum); ++void scan_mailbox(const char path[]); ++void recursive_scan(const char path[]); + + #endif /* SCAN_H */ |