pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/mtree/files Introduce HAVE_FILE_FLAGS if the ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/e93b3d3ab51d
branches: trunk
changeset: 473162:e93b3d3ab51d
user: heinz <heinz%pkgsrc.org@localhost>
date: Fri Apr 16 23:43:36 2004 +0000
description:
Introduce HAVE_FILE_FLAGS if the system declares UF_SETTABLE and SF_SETTABLE
in addition to member 'st_flags' of struct stat. Use HAVE_FILE_FLAGS instead
of HAVE_STRUCT_STAT_ST_FLAGS.
This avoids confusion on UnixWare which has 'st_flags' but does _not_ support
file flags.
diffstat:
pkgtools/mtree/files/compare.c | 14 +-
pkgtools/mtree/files/config.h.in | 23 +-
pkgtools/mtree/files/configure | 1302 +++++++++++++++++++++++++-----------
pkgtools/mtree/files/configure.ac | 9 +
pkgtools/mtree/files/create.c | 11 +-
pkgtools/mtree/files/stat_flags.c | 10 +-
pkgtools/mtree/files/verify.c | 8 +-
7 files changed, 965 insertions(+), 412 deletions(-)
diffs (truncated from 2894 to 300 lines):
diff -r 87d3b57afa6f -r e93b3d3ab51d pkgtools/mtree/files/compare.c
--- a/pkgtools/mtree/files/compare.c Fri Apr 16 22:16:50 2004 +0000
+++ b/pkgtools/mtree/files/compare.c Fri Apr 16 23:43:36 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compare.c,v 1.2 2003/09/05 04:38:46 grant Exp $ */
+/* $NetBSD: compare.c,v 1.3 2004/04/16 23:43:36 heinz Exp $ */
/*-
* Copyright (c) 1989, 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: compare.c,v 1.2 2003/09/05 04:38:46 grant Exp $");
+__RCSID("$NetBSD: compare.c,v 1.3 2004/04/16 23:43:36 heinz Exp $");
#endif
#endif /* not lint */
@@ -99,7 +99,7 @@
} while (0)
#define LABEL if (!label++) MARK
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
#define CHANGEFLAGS \
@@ -137,7 +137,7 @@
flags = (~(s->st_flags & (mask)) & CH_MASK) & (pflags); \
CHANGEFLAGS; \
} while (0)
-#endif /* HAVE_STRUCT_STAT_ST_FLAGS */
+#endif /* HAVE_FILE_FLAGS */
int
compare(NODE *s, FTSENT *p)
@@ -187,7 +187,7 @@
}
if (Wflag)
goto afterpermwhack;
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
if (iflag && !uflag) {
if (s->flags & F_FLAGS)
SETFLAGS(p->fts_statp->st_flags, SP_FLGS);
@@ -343,7 +343,7 @@
tab = "\t";
}
}
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
/*
* XXX
* since lchflags(2) will reset file times, the utimes() above
@@ -370,7 +370,7 @@
printf(")\n");
tab = "\t";
}
-#endif /* HAVE_STRUCT_STAT_ST_FLAGS */
+#endif /* HAVE_FILE_FLAGS */
/*
* from this point, no more permission checking or whacking
diff -r 87d3b57afa6f -r e93b3d3ab51d pkgtools/mtree/files/config.h.in
--- a/pkgtools/mtree/files/config.h.in Fri Apr 16 22:16:50 2004 +0000
+++ b/pkgtools/mtree/files/config.h.in Fri Apr 16 23:43:36 2004 +0000
@@ -22,6 +22,14 @@
*/
#undef HAVE_DECL_GETENV
+/* Define to 1 if you have the declaration of `SF_SETTABLE', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SF_SETTABLE
+
+/* Define to 1 if you have the declaration of `UF_SETTABLE', and to 0 if you
+ don't. */
+#undef HAVE_DECL_UF_SETTABLE
+
/* Define to 1 if you have the `endgrent' function. */
#undef HAVE_ENDGRENT
@@ -136,9 +144,9 @@
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if you have the ANSI C header files. */
@@ -170,3 +178,12 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
+
+/* define HAVE_FILE_FLAGS if the user- and root-changeable masks
+were detected */
+#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && (HAVE_DECL_UF_SETTABLE == 1) && (HAVE_DECL_SF_SETTABLE == 1)
+#define HAVE_FILE_FLAGS 1
+#else
+#define HAVE_FILE_FLAGS 0
+#endif
+
diff -r 87d3b57afa6f -r e93b3d3ab51d pkgtools/mtree/files/configure
--- a/pkgtools/mtree/files/configure Fri Apr 16 22:16:50 2004 +0000
+++ b/pkgtools/mtree/files/configure Fri Apr 16 23:43:36 2004 +0000
@@ -1,11 +1,10 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57 for mtree 20030905.
+# Generated by GNU Autoconf 2.59 for mtree 20030905.
#
# Report bugs to <grant%NetBSD.org@localhost>.
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
@@ -22,9 +21,10 @@
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
@@ -43,7 +43,7 @@
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
@@ -220,16 +220,17 @@
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
@@ -669,7 +670,7 @@
# Be sure to have absolute paths.
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
+ localstatedir libdir includedir oldincludedir infodir mandir
do
eval ac_val=$`echo $ac_var`
case $ac_val in
@@ -709,10 +710,10 @@
# Try the directory containing this script, then its parent.
ac_confdir=`(dirname "$0") 2>/dev/null ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$0" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
@@ -804,9 +805,9 @@
cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
@@ -886,12 +887,45 @@
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
cd $ac_dir
# Check for guested configure; otherwise get Cygnus style configure.
@@ -902,7 +936,7 @@
echo
$SHELL $ac_srcdir/configure --help=recursive
elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
+ test -f $ac_srcdir/configure.in; then
echo
$ac_configure --help
else
@@ -916,10 +950,9 @@
if $ac_init_version; then
cat <<\_ACEOF
mtree configure 20030905
-generated by GNU Autoconf 2.57
-
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+generated by GNU Autoconf 2.59
+
+Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -931,7 +964,7 @@
running configure, to aid debugging if configure makes a mistake.
It was created by mtree $as_me 20030905, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1008,19 +1041,19 @@
2)
ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
+ ac_must_keep_next=false # Got value, back to normal.
else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
Home |
Main Index |
Thread Index |
Old Index