3 # Copyright (C) 2022-2023 Free Software Foundation, Inc.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <https://www.gnu.org/licenses/>.
23 # outputs to stdout the --help usage message.
27 Usage: all-modules [option]
29 Lists the gnulib-tool command line options that can be used when creating
30 a testdir of nearly all of gnulib.
34 --for-mingw list only modules that work on mingw
35 --for-msvc list only modules that work on MSVC
37 Report bugs to <bug-gnulib@gnu.org>."
41 # outputs to stdout the --version message.
45 if test -d "$gnulib_dir"/.git \
46 && (git
--version) >/dev
/null
2>/dev
/null \
47 && (date --version) >/dev
/null
2>/dev
/null
; then
48 # gnulib checked out from git.
49 sed_extract_first_date
='/^Date/{
53 date=`cd "$gnulib_dir" && git log ChangeLog | sed -n -e "$sed_extract_first_date"`
54 # Turn "Fri Mar 21 07:16:51 2008 -0600" into "Mar 21 2008 07:16:51 -0600".
55 sed_year_before_time
='s/^[^ ]* \([^ ]*\) \([0-9]*\) \([0-9:]*\) \([0-9]*\) /\1 \2 \4 \3 /'
56 date=`echo "$date" | sed -e "$sed_year_before_time"`
57 # Use GNU date to compute the time in GMT.
58 date=`date -d "$date" -u +"%Y-%m-%d %H:%M:%S"`
59 version
=' '`cd "$gnulib_dir" && ./build-aux/git-version-gen /dev/null | sed -e 's/-dirty/-modified/'`
61 # gnulib copy without versioning information.
62 date=`sed -e 's/ .*//;q' "$gnulib_dir"/ChangeLog`
65 year
=`"$gnulib_dir"/build-aux/mdate-sh "$self_abspathname" | sed 's,^.* ,,'`
67 all-modules (GNU $package $date)$version
68 Copyright (C) $year Free Software Foundation, Inc.
69 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
70 This is free software: you are free to change and redistribute it.
71 There is NO WARRANTY, to the extent permitted by law.
73 Written by" "Bruno Haible"
76 # Excludes for mingw and MSVC.
78 # <pwd.h> and <grp.h> do not exist.
79 exclude_for_mingw
="$exclude_for_mingw idcache"
80 exclude_for_mingw
="$exclude_for_mingw pt_chown grantpt posix_openpt-tests posix_openpt"
81 exclude_for_mingw
="$exclude_for_mingw userspec-tests userspec"
82 # The functions getuid, getgid, geteuid, getegid don't exist.
83 exclude_for_mingw
="$exclude_for_mingw faccessat"
84 exclude_for_mingw
="$exclude_for_mingw fchownat-tests fchownat chownat"
85 # The functions fork, setsid, ttyname don't exist.
86 exclude_for_mingw
="$exclude_for_mingw forkpty-tests forkpty login_tty-tests login_tty"
89 exclude_for_msvc
="$exclude_for_mingw"
91 # Command-line option processing.
92 exclude
="year2038-recommended"
93 while test $# -gt 0; do
95 --for-mingw |
--for-ming |
--for-min |
--for-mi )
96 exclude
="$exclude $exclude_for_mingw"
98 --for-msvc |
--for-msv |
--for-ms )
99 exclude
="$exclude $exclude_for_msvc"
101 --help |
--hel |
--he |
--h )
104 --version |
--versio |
--versi |
--vers |
--ver |
--ve |
--v )
108 echo "all-modules: unknown option $1" 1>&2
109 echo "Try 'all-modules --help' for more information." 1>&2
112 echo "all-modules: too many arguments" 1>&2
113 echo "Try 'all-modules --help' for more information." 1>&2
118 # gnulib-tool --create-testdir collects all modules by default.
119 # We only need to filter out the excludes.
120 for m
in $exclude; do
121 printf '%s\n' "--avoid=$m"
125 # indent-tabs-mode: nil
126 # whitespace-check-buffer-indent: nil