bug-gnulib
[Top][All Lists]
Advanced

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

Re: Is / distinct from //?


From: Eric Blake
Subject: Re: Is / distinct from //?
Date: Mon, 18 Dec 2006 06:50:20 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Thunderbird/1.5.0.8 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paul Eggert on 12/18/2006 1:08 AM:
> @@ -11,12 +11,12 @@ AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
>      [ if test x"$cross_compiling" = xyes ; then
>       # When cross-compiling, there is no way to tell whether // is special
>       # short of a list of hosts.  However, the only known hosts to date
> -     # that have a distinct // are Apollo DomainOS (too old to port to)
> -     # and Cygwin.  If anyone knows of another system for which // has
> +     # that have a distinct // are Apollo DomainOS (too old to port to),
> +     # Cygwin, and z/OS.  If anyone knows of another system for which // has
>       # special semantics and is distinct from /, please report it to
>       # <address@hidden>.

Minor nit - now that gnulib owns the file, should we change the reporting
address?

> -     if test $[2] = $[4]; then
> +     if test $[2] = $[4] && wc //dev/null >/dev/null 2>&1; then
>         ac_cv_double_slash_root=no

I've also been meaning to fix this .m4 file to use gl_* instead of ac_*;
since it is not owned by autoconf, it should not be using autoconf's
namespace.  But I've been waiting for another change (such as this report
against z/OS) to make it worthwhile.

Oh, and I think double-slash-root would go well as an independent LGPL
module; I've seen other modules that might benefit from having
DOUBLE_SLASH_IS_DISTINCT_ROOT without having to drag in all of the GPL
dirname module, such as getcwd (by the way, why is getcwd GPL when it
looks like it comes from glibc?).  How about this larger patch instead?

2006-12-18  Paul Eggert  <address@hidden>
        and Eric Blake  <address@hidden>

        * m4/double-slash-root.m4 (gl_DOUBLE_SLASH_ROOT):
        Port to z/OS.  Problem reported by Paul Gilmartin.
        * modules/double-slash-root: New module.
        * modules/dirname (Depends-on): Factor out double-slash-root.
        * MODULES.html.sh (File system functions): Mention new module.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFhpyc84KuGfSFAYARAq1VAJ9Lw/K73yc/qYMjyE5qAqCbQSUuwQCfZjPA
Y9svFAk9KI/iuDERrOygHm0=
=UbUk
-----END PGP SIGNATURE-----
Index: MODULES.html.sh
===================================================================
RCS file: /sources/gnulib/gnulib/MODULES.html.sh,v
retrieving revision 1.161
diff -u -p -r1.161 MODULES.html.sh
--- MODULES.html.sh     20 Nov 2006 22:07:27 -0000      1.161
+++ MODULES.html.sh     18 Dec 2006 13:48:32 -0000
@@ -1978,6 +1978,7 @@ func_all_modules ()
   func_module cycle-check
   func_module fsusage
   func_module dirfd
+  func_module double-slash-root
   func_module euidaccess
   func_module file-type
   func_module fileblocks
Index: modules/dirname
===================================================================
RCS file: /sources/gnulib/gnulib/modules/dirname,v
retrieving revision 1.11
diff -u -p -r1.11 dirname
--- modules/dirname     13 Oct 2006 12:40:23 -0000      1.11
+++ modules/dirname     18 Dec 2006 13:48:32 -0000
@@ -6,11 +6,11 @@ lib/dirname.h
 lib/dirname.c
 lib/basename.c
 lib/stripslash.c
-m4/dos.m4
 m4/dirname.m4
-m4/double-slash-root.m4
+m4/dos.m4
 
 Depends-on:
+double-slash-root
 stdbool
 xalloc
 xstrndup
Index: modules/double-slash-root
===================================================================
RCS file: modules/double-slash-root
diff -N modules/double-slash-root
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ modules/double-slash-root   18 Dec 2006 13:48:32 -0000
@@ -0,0 +1,20 @@
+Description:
+Check whether // must be treated differently than /.
+
+Files:
+m4/double-slash-root.m4
+
+Depends-on:
+
+configure.ac:
+gl_DOUBLE_SLASH_ROOT
+
+Makefile.am:
+
+Include:
+
+License:
+LGPL
+
+Maintainer:
+Eric Blake
Index: m4/double-slash-root.m4
===================================================================
RCS file: /sources/gnulib/gnulib/m4/double-slash-root.m4,v
retrieving revision 1.1
diff -u -p -r1.1 double-slash-root.m4
--- m4/double-slash-root.m4     3 Jul 2006 08:32:46 -0000       1.1
+++ m4/double-slash-root.m4     18 Dec 2006 13:48:33 -0000
@@ -1,4 +1,4 @@
-#serial 1   -*- autoconf -*-
+# double-slash-root.m4 serial 2   -*- Autoconf -*-
 dnl Copyright (C) 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,37 +7,37 @@ dnl with or without modifications, as lo
 AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
 [
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_CACHE_CHECK([whether // is distinct from /], [ac_cv_double_slash_root],
+  AC_CACHE_CHECK([whether // is distinct from /], [gl_cv_double_slash_root],
     [ if test x"$cross_compiling" = xyes ; then
        # When cross-compiling, there is no way to tell whether // is special
        # short of a list of hosts.  However, the only known hosts to date
-       # that have a distinct // are Apollo DomainOS (too old to port to)
-       # and Cygwin.  If anyone knows of another system for which // has
+       # that have a distinct // are Apollo DomainOS (too old to port to),
+       # Cygwin, and z/OS.  If anyone knows of another system for which // has
        # special semantics and is distinct from /, please report it to
-       # <address@hidden>.
+       # <address@hidden>.
        case $host in
-         *-cygwin)
-           ac_cv_double_slash_root=yes ;;
+         *-cygwin | i370-ibm-openedition)
+           gl_cv_double_slash_root=yes ;;
          *)
            # Be optimistic and assume that / and // are the same when we
            # don't know.
-           ac_cv_double_slash_root='unknown, assuming no' ;;
+           gl_cv_double_slash_root='unknown, assuming no' ;;
        esac
       else
        set x `ls -di / //`
-       if test $[2] = $[4]; then
-         ac_cv_double_slash_root=no
+       if test $[2] = $[4] && wc //dev/null >/dev/null 2>&1; then
+         gl_cv_double_slash_root=no
        else
-         ac_cv_double_slash_root=yes
+         gl_cv_double_slash_root=yes
        fi
       fi])
-  if test x"$ac_cv_double_slash_root" = xyes; then
-    ac_double_slash_root=1
+  if test x"$gl_cv_double_slash_root" = xyes; then
+    gl_double_slash_root=1
   else
-    ac_double_slash_root=0
+    gl_double_slash_root=0
   fi
 
   AC_DEFINE_UNQUOTED([DOUBLE_SLASH_IS_DISTINCT_ROOT],
-   $ac_double_slash_root,
+   $gl_double_slash_root,
    [Define to 1 if // is a file system root distinct from /.])
 ])

reply via email to

[Prev in Thread] Current Thread [Next in Thread]