pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/45869: print/a2ps doesn't check for the existence of mempcpy



The following reply was made to PR pkg/45869; it has been noted by GNATS.

From: David Shao <davshao%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/45869: print/a2ps doesn't check for the existence of mempcpy
Date: Wed, 21 Mar 2012 22:19:43 -0700

 --0016e6de17e046534b04bbce0e3d
 Content-Type: text/plain; charset=ISO-8859-1
 
 The following patch that mostly uses the ideas initially suggested at
 least results in a successful bmake replace clean of a2ps on DragonFly
 current,
 DragonFly  3.1-DEVELOPMENT x86_64.  The patch has not been tested for
 functionality.
 
 The addition to the suggested idea is that file regex.c has to also be
 patched to not use __mempcpy, but to use
 the actual mempcpy.
 
 There are a large number of packages blocked from building on
 DragonFly due to a2ps not able to be built.
 
 diff --git a/print/a2ps/distinfo b/print/a2ps/distinfo
 index 2236234..b7d902a 100644
 --- a/print/a2ps/distinfo
 +++ b/print/a2ps/distinfo
 @@ -6,3 +6,6 @@ Size (a2ps-4.14.tar.gz) = 2552507 bytes
  SHA1 (patch-aa) = 6317b6abca697388538fc705037da55379a4e1e1
  SHA1 (patch-ab) = 7b1f1e3ed2af47e7d9864ec2dbcd7d105f93632a
  SHA1 (patch-ac) = 8e09c4c3b320b58bf12c4266d4d22977b5f9b826
 +SHA1 (patch-config.h.in) = 393438c0966c98d6d714f1851e6960983bec5d44
 +SHA1 (patch-configure) = f67e1f6f81fd20d7dc4f681bf0d57e20473d5727
 +SHA1 (patch-src_regex.c) = aa467f6531090aeda3482cc3e5d262f4a1bfbde9
 diff --git a/print/a2ps/patches/patch-config.h.in
 b/print/a2ps/patches/patch-config.h.in
 new file mode 100644
 index 0000000..26f201cc
 --- /dev/null
 +++ b/print/a2ps/patches/patch-config.h.in
 @@ -0,0 +1,14 @@
 +$NetBSD$
 +
 +--- config.h.in.orig  2012-03-22 03:09:22.155555000 +0000
 ++++ config.h.in
 +@@ -158,6 +158,9 @@
 + /* Define to 1 if you have the <memory.h> header file. */
 + #undef HAVE_MEMORY_H
 +
 ++/* Define to 1 if you have the `mempcpy` function. */
 ++#undef HAVE_MEMPCPY
 ++
 + /* Define to 1 if you have the `memset' function. */
 + #undef HAVE_MEMSET
 +
 diff --git a/print/a2ps/patches/patch-configure
 b/print/a2ps/patches/patch-configure
 new file mode 100644
 index 0000000..a12745a
 --- /dev/null
 +++ b/print/a2ps/patches/patch-configure
 @@ -0,0 +1,13 @@
 +$NetBSD$
 +
 +--- configure.orig    2012-03-22 03:08:24.745475000 +0000
 ++++ configure
 +@@ -24841,7 +24841,7 @@ fi
 +
 +
 +
 +-for ac_func in uname strchr strerror strerror_r getcwd bcopy bzero
 tempnam strsignal psignal setlocale
 ++for ac_func in uname strchr strerror strerror_r getcwd bcopy bzero
 tempnam strsignal psignal setlocale mempcpy
 + do
 + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 + { echo "$as_me:$LINENO: checking for $ac_func" >&5
 diff --git a/print/a2ps/patches/patch-src_regex.c
 b/print/a2ps/patches/patch-src_regex.c
 new file mode 100644
 index 0000000..709bc83
 --- /dev/null
 +++ b/print/a2ps/patches/patch-src_regex.c
 @@ -0,0 +1,16 @@
 +$NetBSD$
 +
 +--- src/regex.c.orig  2007-12-29 01:33:58.000000000 +0000
 ++++ src/regex.c
 +@@ -5789,7 +5789,11 @@ regerror (errcode, preg, errbuf, errbuf_
 +       if (msg_size > errbuf_size)
 +         {
 + #if defined HAVE_MEMPCPY || defined _LIBC
 ++#ifdef __DragonFly__
 ++       *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
 ++#else
 +        *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
 ++#endif /* __DragonFly__ */
 + #else
 +           memcpy (errbuf, msg, errbuf_size - 1);
 +           errbuf[errbuf_size - 1] = 0;
 
 --0016e6de17e046534b04bbce0e3d
 Content-Type: application/octet-stream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gICooKGNoYXIgKikg
 bWVtcGNweSAoZXJyYnVmLCBtc2csIGVycmJ1Zl9zaXplIC0gMSkpID0gJ1wwJzsKKysjZWxzZQor
 IAkgICooKGNoYXIgKikgX19tZW1wY3B5IChlcnJidWYsIG1zZywgZXJyYnVmX3NpemUgLSAxKSkg
 PSAnXDAnOworKyNlbmRpZiAvKiBfX0RyYWdvbkZseV9fICovCisgI2Vsc2UKKyAgICAgICAgICAg
 bWVtY3B5IChlcnJidWYsIG1zZywgZXJyYnVmX3NpemUgLSAxKTsKKyAgICAgICAgICAgZXJyYnVm
 W2VycmJ1Zl9zaXplIC0gMV0gPSAwOwo=
 --0016e6de17e046534b04bbce0e3d--
 


Home | Main Index | Thread Index | Old Index