diff options
author | mi <mi@FreeBSD.org> | 2019-04-11 12:37:41 +0800 |
---|---|---|
committer | mi <mi@FreeBSD.org> | 2019-04-11 12:37:41 +0800 |
commit | 343d646c38db762a55732bd4fe37e395e8049c62 (patch) | |
tree | 45d56f9d403d241038e21eea0e98a6c9a9340e85 /devel/tcl-trf | |
parent | f0bf5940d88f62c635f2cb43705da3237f0540e9 (diff) | |
download | freebsd-ports-gnome-343d646c38db762a55732bd4fe37e395e8049c62.tar.gz freebsd-ports-gnome-343d646c38db762a55732bd4fe37e395e8049c62.tar.zst freebsd-ports-gnome-343d646c38db762a55732bd4fe37e395e8049c62.zip |
The below-mentioned PR identified a problem, which should've been
caught by the test-harness -- but was not, because the harness was
not used correctly (for 10 years).
Provide a new harness and fix the reported problem as well as another
one -- with MD2 digests -- identified by the now-functioning
test-suit.
Bump PORTREVISION...
PR: 237132
Reported by: Vadim Zborovsky
Diffstat (limited to 'devel/tcl-trf')
-rw-r--r-- | devel/tcl-trf/Makefile | 5 | ||||
-rw-r--r-- | devel/tcl-trf/files/alltests.tcl | 24 | ||||
-rw-r--r-- | devel/tcl-trf/files/patch-md2 | 7 | ||||
-rw-r--r-- | devel/tcl-trf/files/patch-zlib | 74 |
4 files changed, 65 insertions, 45 deletions
diff --git a/devel/tcl-trf/Makefile b/devel/tcl-trf/Makefile index dd67e360b532..1956bf5c8d34 100644 --- a/devel/tcl-trf/Makefile +++ b/devel/tcl-trf/Makefile @@ -3,7 +3,7 @@ PORTNAME= Trf PORTVERSION= 2.1.4 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel tcl MASTER_SITES= SF/tcltrf/tcltrf/${PORTVERSION} PKGNAMEPREFIX= tcl- @@ -41,7 +41,8 @@ do-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/Trf/libTrf${PORTVERSION}.so do-test: - cd ${WRKSRC}/tests && ${SETENV} TCLLIBPATH="${WRKSRC}" ${TCLSH} all + cd ${WRKSRC} && ${SETENV} TCLLIBPATH="${WRKSRC}" ${TCLSH} \ + ${FILESDIR}/alltests.tcl PLIST_SUB+= TCL_DVER=${TCL_VER:C/\.//} VER=${PORTVERSION} diff --git a/devel/tcl-trf/files/alltests.tcl b/devel/tcl-trf/files/alltests.tcl new file mode 100644 index 000000000000..b94a734e1c13 --- /dev/null +++ b/devel/tcl-trf/files/alltests.tcl @@ -0,0 +1,24 @@ +package require tcltest + +source test.setup + +namespace import ::tcltest::* + +foreach c {hasZlib hasSSL hasBz} { + testConstraint $c 1 +} + +proc defblock {name hexdata} { + upvar $name x + + regsub -all { *} $hexdata {} hexdata + regsub -all "\n" $hexdata {} hexdata + # single long hex string now + + set x $hexdata +} + +configure -singleproc true -verbose bel + +testsDirectory tests +runAllTests diff --git a/devel/tcl-trf/files/patch-md2 b/devel/tcl-trf/files/patch-md2 index d0ce211d3c2e..883c205c5658 100644 --- a/devel/tcl-trf/files/patch-md2 +++ b/devel/tcl-trf/files/patch-md2 @@ -8,12 +8,7 @@ +#include "md2d.h" /* -@@ -38,18 +39,8 @@ - */ - --#define DIGEST_SIZE (MD2_DIGEST_LENGTH) -+#define DIGEST_SIZE (20) - #define CTX_TYPE MD2_CTX +@@ -42,14 +43,4 @@ /* - * Declarations of internal procedures. diff --git a/devel/tcl-trf/files/patch-zlib b/devel/tcl-trf/files/patch-zlib index 1c5c61bf6d67..f84cbfdcf339 100644 --- a/devel/tcl-trf/files/patch-zlib +++ b/devel/tcl-trf/files/patch-zlib @@ -94,36 +94,47 @@ -} - --- generic/crc_zlib.c 2009-06-18 00:54:43.000000000 -0400 -+++ generic/crc_zlib.c 2018-10-21 00:42:01.795595000 -0400 ++++ generic/crc_zlib.c 2019-04-11 00:09:21.075344000 -0400 @@ -29,4 +29,5 @@ #include "transformInt.h" +#include <zlib.h> /* -@@ -46,8 +47,5 @@ +@@ -39,5 +40,5 @@ + + #define DIGEST_SIZE 4 /* byte == 32 bit */ +-#define CTX_TYPE uLong ++#define CTX_TYPE uint32_t + + /* +@@ -46,8 +47,6 @@ static void MDcrcz_Start _ANSI_ARGS_ ((VOID* context)); -static void MDcrcz_Update _ANSI_ARGS_ ((VOID* context, unsigned int character)); -static void MDcrcz_UpdateBuf _ANSI_ARGS_ ((VOID* context, unsigned char* buffer, int bufLen)); -static void MDcrcz_Final _ANSI_ARGS_ ((VOID* context, VOID* digest)); -static int MDcrcz_Check _ANSI_ARGS_ ((Tcl_Interp* interp)); ++static void MDcrcz_UpdateBuf _ANSI_ARGS_ ((VOID* context, unsigned char* buffer, size_t bufLen)); +static void MDcrcz_Final _ANSI_ARGS_ ((VOID* digest, VOID *context)); /* -@@ -60,8 +58,8 @@ +@@ -60,11 +59,11 @@ DIGEST_SIZE, MDcrcz_Start, - MDcrcz_Update, -- MDcrcz_UpdateBuf, + NULL, -+ (Trf_MDUpdateBuf *)crc32, + MDcrcz_UpdateBuf, MDcrcz_Final, - MDcrcz_Check + NULL }; -@@ -118,66 +116,5 @@ +-#define CRC (*((uLong*) context)) ++#define CRC (*((CTX_TYPE *) context)) + + /* +@@ -118,36 +117,5 @@ /* call md specific initialization here */ - CRC = zf.zcrc32 (0L, Z_NULL, 0); @@ -158,47 +169,36 @@ - unsigned char buf = character; - - CRC = zf.zcrc32 (CRC, &buf, 1); --} -- --/* -- *------------------------------------------------------* -- * -- * MDcrcz_UpdateBuf -- -- * -- * ------------------------------------------------* -- * Update the internal state of the message digest -- * generator for a character buffer. -- * ------------------------------------------------* -- * -- * Sideeffects: -- * As of the called procedure. -- * -- * Result: -- * None. -- * -- *------------------------------------------------------* -- */ -- --static void --MDcrcz_UpdateBuf (context, buffer, bufLen) --VOID* context; --unsigned char* buffer; ++ CRC = crc32(0L, Z_NULL, 0); + } + +@@ -175,9 +143,9 @@ + VOID* context; + unsigned char* buffer; -int bufLen; --{ -- /* call md specific update here */ -- ++size_t bufLen; + { + /* call md specific update here */ + - CRC = zf.zcrc32 (CRC, buffer, bufLen); -+ CRC = crc32(0L, Z_NULL, 0); ++ CRC = crc32 (CRC, buffer, bufLen); } -@@ -202,5 +139,5 @@ +@@ -202,5 +170,5 @@ static void -MDcrcz_Final (context, digest) +MDcrcz_Final (digest, context) VOID* context; VOID* digest; -@@ -217,28 +154,2 @@ +@@ -208,5 +176,5 @@ + /* call md specific finalization here */ + +- uLong crc = CRC; ++ CTX_TYPE crc = CRC; + char* out = (char*) digest; + +@@ -217,28 +185,2 @@ out [0] = (char) ((crc >> 0) & 0xff); } - |