X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=posix-modules;h=5bb29f0027914402a56da00ded989f0467fc29be;hb=279067b9021cfd0935711cae3f3297ae4b3808af;hp=a02ad955c77d1a46f29423251853b084916b2140;hpb=3030c5b5e0a5199e16b05927da72c43c42f211c3;p=gnulib.git diff --git a/posix-modules b/posix-modules index a02ad955c..5bb29f002 100755 --- a/posix-modules +++ b/posix-modules @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2002-2009 Free Software Foundation, Inc. +# Copyright (C) 2002-2008, 2010-2011 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,6 +26,8 @@ func_usage () echo "\ Usage: posix-modules +Lists the gnulib modules that implement POSIX interfaces. + Report bugs to ." } @@ -115,15 +117,14 @@ func_gnulib_dir () # explicit canonicalization command when $PATH contains no empty fields. self_abspathname= if test "${PATH_SEPARATOR+set}" != set; then - func_tmpdir - { echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh - chmod +x "$tmp"/conf.sh - if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -rf "$tmp" + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } fi if test "$PATH_SEPARATOR" = ";"; then # On Windows, programs are searched in "." before $PATH. @@ -249,10 +250,10 @@ done func_gnulib_dir ( # Get the header modules. - LC_ALL=C grep -h '^Gnulib module: ' "$gnulib_dir"/doc/posix-headers/* 2>/dev/null \ + LC_ALL=C grep -h '^Gnulib module: ' "$gnulib_dir"/doc/posix-headers/*.texi 2>/dev/null \ | sed -e 's,^Gnulib module: ,,' # Get the function modules. - LC_ALL=C grep -h '^Gnulib module: ' "$gnulib_dir"/doc/posix-functions/* 2>/dev/null \ + LC_ALL=C grep -h '^Gnulib module: ' "$gnulib_dir"/doc/posix-functions/*.texi 2>/dev/null \ | sed -e 's,^Gnulib module: ,,' # Then filter out the words "---", ",", "and", "or" and remove *-gnu modules. ) | sed -e 's/,/ /g' | LC_ALL=C sort | LC_ALL=C uniq \