pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/archivers/pax/files Mirror change in archivers/mtree b...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5e340f7bfef9
branches:  trunk
changeset: 479697:5e340f7bfef9
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Sat Aug 21 04:20:50 2004 +0000

description:
Mirror change in archivers/mtree by <heinz> on 2004/04/16:

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:

 archivers/pax/files/config.h.in  |   14 +++
 archivers/pax/files/configure    |  144 +++++++++++++++++++++++++++++++++++++++
 archivers/pax/files/configure.ac |    6 +
 archivers/pax/files/file_subs.c  |    8 +-
 archivers/pax/files/ftree.c      |    6 +-
 archivers/pax/files/stat_flags.c |    8 +-
 archivers/pax/files/tables.c     |    8 +-
 7 files changed, 179 insertions(+), 15 deletions(-)

diffs (truncated from 333 to 300 lines):

diff -r 8e185f4ce739 -r 5e340f7bfef9 archivers/pax/files/config.h.in
--- a/archivers/pax/files/config.h.in   Sat Aug 21 04:17:31 2004 +0000
+++ b/archivers/pax/files/config.h.in   Sat Aug 21 04:20:50 2004 +0000
@@ -3,6 +3,14 @@
 /* Define to 1 if you have the <ctype.h> header file. */
 #undef HAVE_CTYPE_H
 
+/* 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 <errno.h> header file. */
 #undef HAVE_ERRNO_H
 
@@ -149,3 +157,9 @@
 
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
+
+/* Define to 1 if the user- and root-changeable masks were detected */
+#if HAVE_STRUCT_STAT_ST_FLAGS && HAVE_DECL_UF_SETTABLE && HAVE_DECL_SF_SETTABLE
+#define HAVE_FILE_FLAGS 1
+#endif
+
diff -r 8e185f4ce739 -r 5e340f7bfef9 archivers/pax/files/configure
--- a/archivers/pax/files/configure     Sat Aug 21 04:17:31 2004 +0000
+++ b/archivers/pax/files/configure     Sat Aug 21 04:20:50 2004 +0000
@@ -3368,6 +3368,150 @@
 
 fi
 
+echo "$as_me:$LINENO: checking whether UF_SETTABLE is declared" >&5
+echo $ECHO_N "checking whether UF_SETTABLE is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_UF_SETTABLE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef UF_SETTABLE
+  char *p = (char *) UF_SETTABLE;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (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); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (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_have_decl_UF_SETTABLE=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_UF_SETTABLE=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_UF_SETTABLE" >&5
+echo "${ECHO_T}$ac_cv_have_decl_UF_SETTABLE" >&6
+if test $ac_cv_have_decl_UF_SETTABLE = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_UF_SETTABLE 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_UF_SETTABLE 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether SF_SETTABLE is declared" >&5
+echo $ECHO_N "checking whether SF_SETTABLE is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_SF_SETTABLE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef SF_SETTABLE
+  char *p = (char *) SF_SETTABLE;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (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); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (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_have_decl_SF_SETTABLE=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_SF_SETTABLE=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_SF_SETTABLE" >&5
+echo "${ECHO_T}$ac_cv_have_decl_SF_SETTABLE" >&6
+if test $ac_cv_have_decl_SF_SETTABLE = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SF_SETTABLE 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SF_SETTABLE 0
+_ACEOF
+
+
+fi
+
+
+
+
 
 # Checks for library functions.
 
diff -r 8e185f4ce739 -r 5e340f7bfef9 archivers/pax/files/configure.ac
--- a/archivers/pax/files/configure.ac  Sat Aug 21 04:17:31 2004 +0000
+++ b/archivers/pax/files/configure.ac  Sat Aug 21 04:20:50 2004 +0000
@@ -22,6 +22,12 @@
        sys/resource.h sys/stat.h sys/tape.h sys/time.h sys/types.h sys/uio.h \
        sys/wait.h])
 AC_CHECK_MEMBERS([struct stat.st_flags],,, [#include <sys/stat.h>])
+AC_CHECK_DECLS([UF_SETTABLE, SF_SETTABLE])
+AH_BOTTOM([/* Define to 1 if the user- and root-changeable masks were detected */
+#if HAVE_STRUCT_STAT_ST_FLAGS && HAVE_DECL_UF_SETTABLE && HAVE_DECL_SF_SETTABLE
+#define HAVE_FILE_FLAGS 1
+#endif
+])
 
 # Checks for library functions.
 AC_CHECK_FUNCS([lutimes])
diff -r 8e185f4ce739 -r 5e340f7bfef9 archivers/pax/files/file_subs.c
--- a/archivers/pax/files/file_subs.c   Sat Aug 21 04:17:31 2004 +0000
+++ b/archivers/pax/files/file_subs.c   Sat Aug 21 04:20:50 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: file_subs.c,v 1.9 2004/08/21 03:28:56 jlam Exp $       */
+/*     $NetBSD: file_subs.c,v 1.10 2004/08/21 04:20:50 jlam Exp $      */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -48,7 +48,7 @@
 #if 0
 static char sccsid[] = "@(#)file_subs.c        8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: file_subs.c,v 1.9 2004/08/21 03:28:56 jlam Exp $");
+__RCSID("$NetBSD: file_subs.c,v 1.10 2004/08/21 04:20:50 jlam Exp $");
 #endif
 #endif /* not lint */
 
@@ -230,7 +230,7 @@
                (void)unlink(arcn->tmp_name);
        }
 
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
        if (pfflags && arcn->type != PAX_SLK)
                set_chflags(arcn->name, arcn->sb.st_flags);
 #endif
@@ -600,7 +600,7 @@
 #endif
                set_ftime(arcn->name, arcn->sb.st_mtime, arcn->sb.st_atime, 0);
 
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
        if (pfflags && arcn->type != PAX_SLK)
                set_chflags(arcn->name, arcn->sb.st_flags);
 #endif
diff -r 8e185f4ce739 -r 5e340f7bfef9 archivers/pax/files/ftree.c
--- a/archivers/pax/files/ftree.c       Sat Aug 21 04:17:31 2004 +0000
+++ b/archivers/pax/files/ftree.c       Sat Aug 21 04:20:50 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftree.c,v 1.7 2004/08/21 03:28:56 jlam Exp $   */
+/*     $NetBSD: ftree.c,v 1.8 2004/08/21 04:20:50 jlam Exp $   */
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -84,7 +84,7 @@
 #if 0
 static char sccsid[] = "@(#)ftree.c    8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: ftree.c,v 1.7 2004/08/21 03:28:56 jlam Exp $");
+__RCSID("$NetBSD: ftree.c,v 1.8 2004/08/21 04:20:50 jlam Exp $");
 #endif
 #endif /* not lint */
 
@@ -544,7 +544,7 @@
                        statbuf.st_gid = ftnode->st_gid;
                if (ftnode->flags & (F_UID | F_UNAME))
                        statbuf.st_uid = ftnode->st_uid;
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
                if (ftnode->flags & F_FLAGS)
                        statbuf.st_flags = ftnode->st_flags;
 #endif
diff -r 8e185f4ce739 -r 5e340f7bfef9 archivers/pax/files/stat_flags.c
--- a/archivers/pax/files/stat_flags.c  Sat Aug 21 04:17:31 2004 +0000
+++ b/archivers/pax/files/stat_flags.c  Sat Aug 21 04:20:50 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stat_flags.c,v 1.2 2004/08/21 03:28:56 jlam Exp $      */
+/*     $NetBSD: stat_flags.c,v 1.3 2004/08/21 04:20:50 jlam Exp $      */
 
 /*-
  * Copyright (c) 1993
@@ -44,7 +44,7 @@
 #if 0
 static char sccsid[] = "@(#)stat_flags.c       8.2 (Berkeley) 7/28/94";
 #else
-__RCSID("$NetBSD: stat_flags.c,v 1.2 2004/08/21 03:28:56 jlam Exp $");
+__RCSID("$NetBSD: stat_flags.c,v 1.3 2004/08/21 04:20:50 jlam Exp $");
 #endif
 #endif /* not lint */
 
@@ -86,7 +86,7 @@
 
        string[0] = '\0';
        prefix = NULL;
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
        if (flags & UF_APPEND)
                SAPPEND("uappnd");
        if (flags & UF_IMMUTABLE)
@@ -145,7 +145,7 @@
        if (clrp)
                *clrp = 0;
 
-#if HAVE_STRUCT_STAT_ST_FLAGS
+#if HAVE_FILE_FLAGS
        string = *stringp;
        while ((p = strsep(&string, "\t ,")) != NULL) {
                clear = 0;
diff -r 8e185f4ce739 -r 5e340f7bfef9 archivers/pax/files/tables.c
--- a/archivers/pax/files/tables.c      Sat Aug 21 04:17:31 2004 +0000
+++ b/archivers/pax/files/tables.c      Sat Aug 21 04:20:50 2004 +0000



Home | Main Index | Thread Index | Old Index