mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-09-18 10:01:07 +03:00
* all-modules: Update comments. * build-aux/install-reloc: Likewise. * build-aux/reloc-ldflags: Likewise. * gnulib-tool: Likewise. * gnulib-tool.py: Likewise. * gnulib-tool.sh: Likewise. * lib/aligned-malloc.h: Likewise. * lib/boot-time.c: Likewise. * lib/c32is-impl.h: Likewise. * lib/c32srtombs-state.c: Likewise. * lib/c32to-impl.h: Likewise. * lib/c32width.c: Likewise. * lib/errno.in.h: Likewise. * lib/euidaccess.c: Likewise. * lib/fbufmode.c: Likewise. * lib/fenv-except-state-get.c: Likewise. * lib/fenv-except-state-set.c: Likewise. * lib/fenv-except-tracking-clear.c: Likewise. * lib/fenv-except-tracking-set.c: Likewise. * lib/fenv-except-tracking-test.c: Likewise. * lib/fenv-except-trapping.c: Likewise. * lib/fenv-round.c: Likewise. * lib/fflush.c: Likewise. * lib/fileblocks.c: Likewise. * lib/forkpty.c: Likewise. * lib/fpending.c: Likewise. * lib/fpurge.c: Likewise. * lib/freadable.c: Likewise. * lib/freadahead.c: Likewise. * lib/freading.c: Likewise. * lib/freadptr.c: Likewise. * lib/freadseek.c: Likewise. * lib/fseeko.c: Likewise. * lib/fseterr.c: Likewise. * lib/fsusage.c: Likewise. * lib/fwritable.c: Likewise. * lib/fwriting.c: Likewise. * lib/getdomainname.c: Likewise. * lib/idpriv-drop.c: Likewise. * lib/idpriv-droptemp.c: Likewise. * lib/limits.in.h: Likewise. * lib/mbrtoc16.c: Likewise. * lib/mbrtoc32.c: Likewise. * lib/mbsrtoc32s-state.c: Likewise. * lib/mbsrtowcs-state.c: Likewise. * lib/mbtowc-lock.h: Likewise. * lib/minmax.h: Likewise. * lib/netdb.in.h: Likewise. * lib/pipe-filter-ii.c: Likewise. * lib/posix_openpt.c: Likewise. * lib/ptsname_r.c: Likewise. * lib/readutmp.c: Likewise. * lib/readutmp.h: Likewise. * lib/resource-ext.h: Likewise. * lib/safe-read.h: Likewise. * lib/safe-write.h: Likewise. * lib/save-cwd.c: Likewise. * lib/stdbool.in.h: Likewise. * lib/striconv.c: Likewise. * lib/striconveh.c: Likewise. * lib/termcap.h: Likewise. * lib/terminfo.h: Likewise. * lib/unistd.in.h: Likewise. * lib/vasnprintf.c: Likewise. * lib/wcrtomb.c: Likewise. * lib/wcsrtombs-state.c: Likewise. * m4/fenv-environment.m4: Likewise. * m4/fenv-exceptions-state.m4: Likewise. * m4/fenv-exceptions-tracking.m4: Likewise. * m4/fenv-rounding.m4: Likewise. * m4/fmod.m4: Likewise. * m4/getdomainname.m4: Likewise. * m4/getloadavg.m4: Likewise. * m4/getopt.m4: Likewise. * m4/hypot.m4: Likewise. * m4/hypotf.m4: Likewise. * m4/hypotl.m4: Likewise. * m4/iconv.m4: Likewise. * m4/intl-thread-locale.m4: Likewise. * m4/largefile.m4: Likewise. * m4/libdl.m4: Likewise. * m4/locale-ja.m4: Likewise. * m4/locale_h.m4: Likewise. * m4/log.m4: Likewise. * m4/log10.m4: Likewise. * m4/log10f.m4: Likewise. * m4/logf.m4: Likewise. * m4/modf.m4: Likewise. * m4/modff.m4: Likewise. * m4/modfl.m4: Likewise. * m4/pthread-rwlock.m4: Likewise. * m4/semaphore.m4: Likewise. * m4/socklen.m4: Likewise. * m4/stdint.m4: Likewise. * m4/strtod.m4: Likewise. * m4/strtof.m4: Likewise. * m4/strtold.m4: Likewise. * modules/sigsegv: Likewise. * posix-modules: Likewise. * pygnulib/GLImport.py: Likewise. * tests/init.sh: Likewise. * tests/test-echo.sh: Likewise. * tests/test-isatty.c: Likewise. * tests/test-math-h.c: Likewise. * tests/test-nonblocking-pipe.h: Likewise. * tests/test-nonblocking-socket.h: Likewise. * tests/test-strtod.h: Likewise. * tests/test-strtof.h: Likewise. * tests/test-strtold.h: Likewise. * tests/test-vasnprintf.c: Likewise. * tests/test-vasnwprintf.c: Likewise.
253 lines
8.5 KiB
Bash
Executable File
253 lines
8.5 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (C) 2022-2025 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
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
#
|
|
|
|
progname=$0
|
|
package=gnulib
|
|
|
|
# func_exit STATUS
|
|
# exits with a given status.
|
|
# This function needs to be used, rather than 'exit', when a 'trap' handler is
|
|
# in effect that refers to $?.
|
|
func_exit ()
|
|
{
|
|
(exit $1); exit $1
|
|
}
|
|
|
|
# func_fatal_error message
|
|
# outputs to stderr a fatal error message, and terminates the program.
|
|
# Input:
|
|
# - progname name of this program
|
|
func_fatal_error ()
|
|
{
|
|
echo "$progname: *** $1" 1>&2
|
|
echo "$progname: *** Stop." 1>&2
|
|
func_exit 1
|
|
}
|
|
|
|
# func_readlink SYMLINK
|
|
# outputs the target of the given symlink.
|
|
if (type readlink) > /dev/null 2>&1; then
|
|
func_readlink ()
|
|
{
|
|
# Use the readlink program from GNU coreutils.
|
|
readlink "$1"
|
|
}
|
|
else
|
|
func_readlink ()
|
|
{
|
|
# Use two sed invocations. A single sed -n -e 's,^.* -> \(.*\)$,\1,p'
|
|
# would do the wrong thing if the link target contains " -> ".
|
|
LC_ALL=C ls -l "$1" | sed -e 's, -> ,#%%#,' | sed -n -e 's,^.*#%%#\(.*\)$,\1,p'
|
|
}
|
|
fi
|
|
|
|
# func_gnulib_dir
|
|
# locates the directory where the gnulib repository lives
|
|
# Input:
|
|
# - progname name of this program
|
|
# Sets variables
|
|
# - self_abspathname absolute pathname of this program
|
|
# - gnulib_dir absolute pathname of gnulib repository
|
|
func_gnulib_dir ()
|
|
{
|
|
case "$progname" in
|
|
/* | ?:*) self_abspathname="$progname" ;;
|
|
*/*) self_abspathname=`pwd`/"$progname" ;;
|
|
*)
|
|
# Look in $PATH.
|
|
# Iterate through the elements of $PATH.
|
|
# We use IFS=: instead of
|
|
# for d in `echo ":$PATH:" | sed -e 's/:::*/:.:/g' | sed -e 's/:/ /g'`
|
|
# because the latter does not work when some PATH element contains spaces.
|
|
# We use a canonicalized $pathx instead of $PATH, because empty PATH
|
|
# elements are by definition equivalent to '.', however field splitting
|
|
# according to IFS=: loses empty fields in many shells:
|
|
# - /bin/sh on Solaris loses all empty fields (at the beginning, at
|
|
# the end, and in the middle),
|
|
# - GNU bash, /bin/sh on AIX and HP-UX, and /bin/ksh on AIX, HP-UX,
|
|
# Solaris lose empty fields at the end.
|
|
# The 'case' statement is an optimization, to avoid evaluating the
|
|
# explicit canonicalization command when $PATH contains no empty fields.
|
|
self_abspathname=
|
|
if test "${PATH_SEPARATOR+set}" != set; then
|
|
# 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+set}" != set; then
|
|
# 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.
|
|
pathx=".;$PATH"
|
|
else
|
|
# On Unix, we have to convert empty PATH elements to ".".
|
|
pathx="$PATH"
|
|
case :$PATH: in
|
|
*::*)
|
|
pathx=`echo ":$PATH:" | sed -e 's/:::*/:.:/g' -e 's/^://' -e 's/:\$//'`
|
|
;;
|
|
esac
|
|
fi
|
|
saved_IFS="$IFS"
|
|
IFS="$PATH_SEPARATOR"
|
|
for d in $pathx; do
|
|
IFS="$saved_IFS"
|
|
test -z "$d" && d=.
|
|
if test -x "$d/$progname" && test ! -d "$d/$progname"; then
|
|
self_abspathname="$d/$progname"
|
|
break
|
|
fi
|
|
done
|
|
IFS="$saved_IFS"
|
|
if test -z "$self_abspathname"; then
|
|
func_fatal_error "could not locate the all-modules program - how did you invoke it?"
|
|
fi
|
|
;;
|
|
esac
|
|
while test -h "$self_abspathname"; do
|
|
# Resolve symbolic link.
|
|
linkval=`func_readlink "$self_abspathname"`
|
|
test -n "$linkval" || break
|
|
case "$linkval" in
|
|
/* | ?:* ) self_abspathname="$linkval" ;;
|
|
* ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
|
|
esac
|
|
done
|
|
gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
|
|
}
|
|
|
|
# func_usage
|
|
# outputs to stdout the --help usage message.
|
|
func_usage ()
|
|
{
|
|
echo "\
|
|
Usage: all-modules [option]
|
|
|
|
Lists the gnulib-tool command line options that can be used when creating
|
|
a testdir of nearly all of gnulib.
|
|
|
|
Options:
|
|
|
|
--for-mingw list only modules that work on mingw
|
|
--for-msvc list only modules that work on MSVC
|
|
|
|
Report bugs to <bug-gnulib@gnu.org>."
|
|
}
|
|
|
|
# func_version
|
|
# outputs to stdout the --version message.
|
|
func_version ()
|
|
{
|
|
func_gnulib_dir
|
|
if test -d "$gnulib_dir"/.git \
|
|
&& (git --version) >/dev/null 2>/dev/null \
|
|
&& (date --version) >/dev/null 2>/dev/null; then
|
|
# gnulib checked out from git.
|
|
sed_extract_first_date='/^Date/{
|
|
s/^Date:[ ]*//p
|
|
q
|
|
}'
|
|
date=`cd "$gnulib_dir" && git log -n 1 --format=medium --date=iso ChangeLog | sed -n -e "$sed_extract_first_date"`
|
|
# Turn "Fri Mar 21 07:16:51 2008 -0600" into "Mar 21 2008 07:16:51 -0600".
|
|
sed_year_before_time='s/^[^ ]* \([^ ]*\) \([0-9]*\) \([0-9:]*\) \([0-9]*\) /\1 \2 \4 \3 /'
|
|
date=`echo "$date" | sed -e "$sed_year_before_time"`
|
|
# Use GNU date to compute the time in GMT.
|
|
date=`date -d "$date" -u +"%Y-%m-%d %H:%M:%S"`
|
|
version=' '`cd "$gnulib_dir" && ./build-aux/git-version-gen /dev/null | sed -e 's/-dirty/-modified/'`
|
|
else
|
|
# gnulib copy without versioning information.
|
|
date=`sed -e 's/ .*//;q' "$gnulib_dir"/ChangeLog`
|
|
version=
|
|
fi
|
|
year=`"$gnulib_dir"/build-aux/mdate-sh "$self_abspathname" | sed 's,^.* ,,'`
|
|
echo "\
|
|
all-modules (GNU $package $date)$version
|
|
Copyright (C) $year Free Software Foundation, Inc.
|
|
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
|
This is free software: you are free to change and redistribute it.
|
|
There is NO WARRANTY, to the extent permitted by law.
|
|
|
|
Written by" "Bruno Haible"
|
|
}
|
|
|
|
# Excludes for mingw and MSVC.
|
|
exclude_for_mingw=
|
|
# <pwd.h> and <grp.h> do not exist.
|
|
exclude_for_mingw="$exclude_for_mingw idcache"
|
|
exclude_for_mingw="$exclude_for_mingw pt_chown grantpt posix_openpt-tests posix_openpt"
|
|
exclude_for_mingw="$exclude_for_mingw userspec-tests userspec"
|
|
# The functions getuid, getgid, geteuid, getegid don't exist.
|
|
exclude_for_mingw="$exclude_for_mingw faccessat"
|
|
exclude_for_mingw="$exclude_for_mingw fchownat-tests fchownat chownat"
|
|
# The functions fork, setsid, ttyname don't exist.
|
|
exclude_for_mingw="$exclude_for_mingw forkpty-tests forkpty login_tty-tests login_tty"
|
|
|
|
# Excludes for MSVC.
|
|
exclude_for_msvc="$exclude_for_mingw"
|
|
|
|
# Command-line option processing.
|
|
exclude="year2038-recommended"
|
|
while test $# -gt 0; do
|
|
case "$1" in
|
|
--for-mingw | --for-ming | --for-min | --for-mi )
|
|
exclude="$exclude $exclude_for_mingw"
|
|
shift ;;
|
|
--for-msvc | --for-msv | --for-ms )
|
|
exclude="$exclude $exclude_for_msvc"
|
|
shift ;;
|
|
--help | --hel | --he | --h )
|
|
func_usage
|
|
exit $? ;;
|
|
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
|
func_version
|
|
exit $? ;;
|
|
-* )
|
|
echo "all-modules: unknown option $1" 1>&2
|
|
echo "Try 'all-modules --help' for more information." 1>&2
|
|
exit 1 ;;
|
|
* )
|
|
echo "all-modules: too many arguments" 1>&2
|
|
echo "Try 'all-modules --help' for more information." 1>&2
|
|
exit 1 ;;
|
|
esac
|
|
done
|
|
|
|
# gnulib-tool --create-testdir collects all modules by default.
|
|
# We only need to filter out the excludes.
|
|
for m in $exclude; do
|
|
printf '%s\n' "--avoid=$m"
|
|
done
|
|
|
|
# Local Variables:
|
|
# indent-tabs-mode: nil
|
|
# whitespace-check-buffer-indent: nil
|
|
# End:
|