diff options
author | schmonz <schmonz@pkgsrc.org> | 2002-08-01 14:43:38 +0000 |
---|---|---|
committer | schmonz <schmonz@pkgsrc.org> | 2002-08-01 14:43:38 +0000 |
commit | 7794acfa2cd2dae93c7270ece07e245a80f5da46 (patch) | |
tree | a76b1f4422e2f1ae3e3c0356a83b549a1ee94438 /pkgtools | |
parent | 5c042a9ddfdc0ebd4833fc460fc7dec22d3cbeb3 (diff) | |
download | pkgsrc-7794acfa2cd2dae93c7270ece07e245a80f5da46.tar.gz |
The 20020723 pkg_install tools use strlcpy(), which Darwin lacks.
Provide a strlcpy() implementation (from -r1.12 of
basesrc/lib/libc/string/strlcpy.c), and use it on Darwin.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/distinfo | 5 | ||||
-rw-r--r-- | pkgtools/pkg_install/patches/patch-ad | 10 | ||||
-rw-r--r-- | pkgtools/pkg_install/patches/patch-ai | 69 |
3 files changed, 77 insertions, 7 deletions
diff --git a/pkgtools/pkg_install/distinfo b/pkgtools/pkg_install/distinfo index a69c6884c41..92219d37313 100644 --- a/pkgtools/pkg_install/distinfo +++ b/pkgtools/pkg_install/distinfo @@ -1,12 +1,13 @@ -$NetBSD: distinfo,v 1.12 2002/08/01 09:31:14 martti Exp $ +$NetBSD: distinfo,v 1.13 2002/08/01 14:43:38 schmonz Exp $ SHA1 (pkg_install-20020723.tar.gz) = c16763363a8ff4341c866d50e40dfa2639288009 Size (pkg_install-20020723.tar.gz) = 81502 bytes SHA1 (patch-aa) = f7e8c1c445545d549e4b0655066877d43015bf1f SHA1 (patch-ab) = 0b5effbb41b34f96877d3f9494d6cf5054795414 SHA1 (patch-ac) = fb24ffdc0fbf4ca85d588afcfac39a960b763706 -SHA1 (patch-ad) = a4f9bef5d5861c8778cc492a2cb2cfcfff4603c5 +SHA1 (patch-ad) = a4dbed4ec4be7f008064bc50f17f20aacc4cf8b5 SHA1 (patch-ae) = ea360800e97e0cfdaf7cfe5790f70d8145aa0e23 SHA1 (patch-af) = b1d9ce8d3c3e592a67db7ac9676a72317a1485c5 SHA1 (patch-ag) = e30435f0a626a893934c725c605486a145e27690 SHA1 (patch-ah) = ae0cee4e6f6efd740fc0d4288f8f71dd0039a913 +SHA1 (patch-ai) = fc16e812952f20a2db10e6b947521b5d18a7b6ae diff --git a/pkgtools/pkg_install/patches/patch-ad b/pkgtools/pkg_install/patches/patch-ad index 45e6aba7106..2b7e777faca 100644 --- a/pkgtools/pkg_install/patches/patch-ad +++ b/pkgtools/pkg_install/patches/patch-ad @@ -1,15 +1,15 @@ -$NetBSD: patch-ad,v 1.2 2002/08/01 09:31:16 martti Exp $ +$NetBSD: patch-ad,v 1.3 2002/08/01 14:43:39 schmonz Exp $ ---- lib/Makefile.orig Thu Aug 1 10:46:31 2002 -+++ lib/Makefile Thu Aug 1 10:57:09 2002 -@@ -5,13 +5,31 @@ +--- lib/Makefile.orig Thu Aug 1 04:46:31 2002 ++++ lib/Makefile +@@ -5,13 +5,31 @@ LIB+= install SRCS+= exec.c file.c ftpio.c global.c lpkg.c pen.c pkgdb.c \ plist.c str.c version.c path.c +OPSYS!= uname -s + +.if ${OPSYS} == "Darwin" -+SRCS+= md5c.c md5hl.c ++SRCS+= md5c.c md5hl.c strlcpy.c +.endif + +.if ${OPSYS} == "Linux" diff --git a/pkgtools/pkg_install/patches/patch-ai b/pkgtools/pkg_install/patches/patch-ai new file mode 100644 index 00000000000..002f4c56f86 --- /dev/null +++ b/pkgtools/pkg_install/patches/patch-ai @@ -0,0 +1,69 @@ +$NetBSD: patch-ai,v 1.1 2002/08/01 14:43:39 schmonz Exp $ + +--- lib/strlcpy.c.orig Thu Aug 1 10:21:56 2002 ++++ lib/strlcpy.c +@@ -0,0 +1,64 @@ ++/* ++ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, ++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ++ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ++ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; ++ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ++ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR ++ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ++ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include <sys/types.h> ++#include <assert.h> ++#include <string.h> ++ ++/* ++ * Copy src to string dst of size siz. At most siz-1 characters ++ * will be copied. Always NUL terminates (unless siz == 0). ++ * Returns strlen(src); if retval >= siz, truncation occurred. ++ */ ++size_t ++strlcpy(dst, src, siz) ++ char *dst; ++ const char *src; ++ size_t siz; ++{ ++ char *d = dst; ++ const char *s = src; ++ size_t n = siz; ++ ++ /* Copy as many bytes as will fit */ ++ if (n != 0 && --n != 0) { ++ do { ++ if ((*d++ = *s++) == 0) ++ break; ++ } while (--n != 0); ++ } ++ ++ /* Not enough room in dst, add NUL and traverse rest of src */ ++ if (n == 0) { ++ if (siz != 0) ++ *d = '\0'; /* NUL-terminate dst */ ++ while (*s++) ++ ; ++ } ++ ++ return(s - src - 1); /* count does not include NUL */ ++} |