pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/mtree/files Make this build using libnbcompat...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/21e87e08d95f
branches:  trunk
changeset: 460853:21e87e08d95f
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Sep 05 18:38:58 2003 +0000

description:
Make this build using libnbcompat-20030829.  Several files from the older
libnbcompat where moved into mtree/files since they logically belong
together (and are that way in the NetBSD src tree).

diffstat:

 pkgtools/mtree/files/Makefile.in  |    5 +-
 pkgtools/mtree/files/config.h.in  |   12 +
 pkgtools/mtree/files/configure    |   73 ++++-
 pkgtools/mtree/files/configure.ac |    5 +-
 pkgtools/mtree/files/extern.h     |   88 +++++
 pkgtools/mtree/files/getid.c      |  453 ++++++++++++++++++++++++++++
 pkgtools/mtree/files/misc.c       |  305 ++++++++++++++++++
 pkgtools/mtree/files/mtree.h      |  129 ++++++++
 pkgtools/mtree/files/pack_dev.c   |  317 +++++++++++++++++++
 pkgtools/mtree/files/pack_dev.h   |   59 +++
 pkgtools/mtree/files/spec.c       |  612 ++++++++++++++++++++++++++++++++++++++
 pkgtools/mtree/files/stat_flags.c |  197 ++++++++++++
 pkgtools/mtree/files/stat_flags.h |   35 ++
 13 files changed, 2285 insertions(+), 5 deletions(-)

diffs (truncated from 2397 to 300 lines):

diff -r 6b430ea0c2a6 -r 21e87e08d95f pkgtools/mtree/files/Makefile.in
--- a/pkgtools/mtree/files/Makefile.in  Fri Sep 05 18:35:49 2003 +0000
+++ b/pkgtools/mtree/files/Makefile.in  Fri Sep 05 18:38:58 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.in,v 1.5 2003/09/05 04:38:45 grant Exp $
+#      $NetBSD: Makefile.in,v 1.6 2003/09/05 18:38:58 jlam Exp $
 
 srcdir=                @srcdir@
 
@@ -22,7 +22,8 @@
 
 PROG=          mtree
 
-SRCS=  compare.c crc.c create.c excludes.c mtree.c verify.c
+SRCS=  compare.c crc.c create.c excludes.c misc.c mtree.c spec.c verify.c \
+       getid.c stat_flags.c pack_dev.c
 OBJS=  $(SRCS:.c=.o)
 
 .PHONY: all clean install
diff -r 6b430ea0c2a6 -r 21e87e08d95f pkgtools/mtree/files/config.h.in
--- a/pkgtools/mtree/files/config.h.in  Fri Sep 05 18:35:49 2003 +0000
+++ b/pkgtools/mtree/files/config.h.in  Fri Sep 05 18:38:58 2003 +0000
@@ -37,9 +37,15 @@
 /* Define to 1 if you have the `gethostname' function. */
 #undef HAVE_GETHOSTNAME
 
+/* Define to 1 if you have the <grp.h> header file. */
+#undef HAVE_GRP_H
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `util' library (-lutil). */
+#undef HAVE_LIBUTIL
+
 /* Define to 1 if you have the `mbsrtowcs' function. */
 #undef HAVE_MBSRTOWCS
 
@@ -55,6 +61,9 @@
 /* Define to 1 if you have the `mkdir' function. */
 #undef HAVE_MKDIR
 
+/* Define to 1 if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
@@ -97,6 +106,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the <util.h> header file. */
+#undef HAVE_UTIL_H
+
 /* Define to 1 if you have the <wchar.h> header file. */
 #undef HAVE_WCHAR_H
 
diff -r 6b430ea0c2a6 -r 21e87e08d95f pkgtools/mtree/files/configure
--- a/pkgtools/mtree/files/configure    Fri Sep 05 18:35:49 2003 +0000
+++ b/pkgtools/mtree/files/configure    Fri Sep 05 18:38:58 2003 +0000
@@ -2242,8 +2242,74 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
+# Checks for libraries.
+
+
+echo "$as_me:$LINENO: checking for fparseln in -lutil" >&5
+echo $ECHO_N "checking for fparseln in -lutil... $ECHO_C" >&6
+if test "${ac_cv_lib_util_fparseln+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lutil  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char fparseln ();
+int
+main ()
+{
+fparseln ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_util_fparseln=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_util_fparseln=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_util_fparseln" >&5
+echo "${ECHO_T}$ac_cv_lib_util_fparseln" >&6
+if test $ac_cv_lib_util_fparseln = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBUTIL 1
+_ACEOF
+
+  LIBS="-lutil $LIBS"
+
+fi
+
+
 # Checks for header files.
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2718,7 +2784,10 @@
 
 
 
-for ac_header in fnmatch.h
+
+
+
+for ac_header in fnmatch.h grp.h pwd.h util.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
diff -r 6b430ea0c2a6 -r 21e87e08d95f pkgtools/mtree/files/configure.ac
--- a/pkgtools/mtree/files/configure.ac Fri Sep 05 18:35:49 2003 +0000
+++ b/pkgtools/mtree/files/configure.ac Fri Sep 05 18:38:58 2003 +0000
@@ -10,9 +10,12 @@
 AC_PROG_CC
 AC_PROG_INSTALL
 
+# Checks for libraries.
+AC_CHECK_LIB(util, fparseln)
+
 # Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS([fnmatch.h])
+AC_CHECK_HEADERS([fnmatch.h grp.h pwd.h util.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
diff -r 6b430ea0c2a6 -r 21e87e08d95f pkgtools/mtree/files/extern.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/mtree/files/extern.h     Fri Sep 05 18:38:58 2003 +0000
@@ -0,0 +1,88 @@
+/*     $NetBSD: extern.h,v 1.1 2003/09/05 18:38:58 jlam Exp $  */
+
+/*-
+ * Copyright (c) 1991, 1993
+ *     The Regents of the University of California.  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. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *     @(#)extern.h    8.1 (Berkeley) 6/6/93
+ */
+
+#include "mtree.h"
+
+#if HAVE_CONFIG_H
+#include "config.h" 
+#else 
+#define HAVE_STRUCT_STAT_ST_FLAGS 1
+#endif
+ 
+#include <nbcompat.h>
+#if HAVE_ERR_H 
+#include <err.h> 
+#endif
+#if HAVE_FTS_H
+#include <fts.h>
+#endif
+
+#if HAVE_NETDB_H
+/* For MAXHOSTNAMELEN on some platforms. */
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#endif
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 256
+#endif
+
+void    addtag(slist_t *, char *);
+int     check_excludes(const char *, const char *);
+int     compare(NODE *, FTSENT *);
+int     crc(int, u_int32_t *, u_int32_t *);
+void    cwalk(void);
+void    dump_nodes(const char *, NODE *, int);
+void    init_excludes(void);
+int     matchtags(NODE *);
+void    mtree_err(const char *, ...)
+           __attribute__((__format__(__printf__, 1, 2)));
+const char *nodetype(u_int);
+u_int   parsekey(const char *, int *);
+void    parsetags(slist_t *, char *);
+u_int   parsetype(const char *);
+void    read_excludes_file(const char *);
+const char *rlink(const char *);
+int     verify(void);
+
+extern int     dflag, eflag, iflag, lflag, mflag, rflag, sflag, tflag, uflag;
+extern int     Wflag;
+extern size_t  mtree_lineno;
+extern u_int32_t crc_total;
+extern int     ftsoptions, keys;
+extern char    fullpath[];
+extern slist_t includetags, excludetags;
+
+
+#include "stat_flags.h"
diff -r 6b430ea0c2a6 -r 21e87e08d95f pkgtools/mtree/files/getid.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/mtree/files/getid.c      Fri Sep 05 18:38:58 2003 +0000
@@ -0,0 +1,453 @@
+/*     $NetBSD: getid.c,v 1.1 2003/09/05 18:38:58 jlam Exp $   */
+/*     from: NetBSD: getpwent.c,v 1.48 2000/10/03 03:22:26 enami Exp */
+/*     from: NetBSD: getgrent.c,v 1.41 2002/01/12 23:51:30 lukem Exp */
+
+/*
+ * Copyright (c) 1987, 1988, 1989, 1993, 1994, 1995
+ *     The Regents of the University of California.  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. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ */
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation



Home | Main Index | Thread Index | Old Index