xcrypt 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +106 -0
  3. data/ext/libxcrypt/AUTHORS +38 -0
  4. data/ext/libxcrypt/COPYING.LIB +502 -0
  5. data/ext/libxcrypt/ChangeLog +239 -0
  6. data/ext/libxcrypt/INSTALL +380 -0
  7. data/ext/libxcrypt/LICENSING +152 -0
  8. data/ext/libxcrypt/Makefile.am +704 -0
  9. data/ext/libxcrypt/Makefile.in +4110 -0
  10. data/ext/libxcrypt/NEWS +630 -0
  11. data/ext/libxcrypt/README +1 -0
  12. data/ext/libxcrypt/README.md +179 -0
  13. data/ext/libxcrypt/THANKS +13 -0
  14. data/ext/libxcrypt/TODO +1 -0
  15. data/ext/libxcrypt/TODO.md +100 -0
  16. data/ext/libxcrypt/aclocal.m4 +2617 -0
  17. data/ext/libxcrypt/autogen.sh +33 -0
  18. data/ext/libxcrypt/autom4te.cache/output.0 +19884 -0
  19. data/ext/libxcrypt/autom4te.cache/output.1 +19884 -0
  20. data/ext/libxcrypt/autom4te.cache/output.2 +19884 -0
  21. data/ext/libxcrypt/autom4te.cache/output.3 +19885 -0
  22. data/ext/libxcrypt/autom4te.cache/requests +714 -0
  23. data/ext/libxcrypt/autom4te.cache/traces.0 +4088 -0
  24. data/ext/libxcrypt/autom4te.cache/traces.1 +1060 -0
  25. data/ext/libxcrypt/autom4te.cache/traces.2 +4088 -0
  26. data/ext/libxcrypt/autom4te.cache/traces.3 +1060 -0
  27. data/ext/libxcrypt/build-aux/ci/ci-log-dependency-versions +79 -0
  28. data/ext/libxcrypt/build-aux/ci/ci-log-logfiles +22 -0
  29. data/ext/libxcrypt/build-aux/ci/clang-gcov-wrapper +2 -0
  30. data/ext/libxcrypt/build-aux/ci/configure-wrapper +10 -0
  31. data/ext/libxcrypt/build-aux/ci/summarize-coverage +24 -0
  32. data/ext/libxcrypt/build-aux/m4/ax_append_compile_flags.m4 +46 -0
  33. data/ext/libxcrypt/build-aux/m4/ax_append_flag.m4 +50 -0
  34. data/ext/libxcrypt/build-aux/m4/ax_check_compile_flag.m4 +53 -0
  35. data/ext/libxcrypt/build-aux/m4/ax_check_vscript.m4 +142 -0
  36. data/ext/libxcrypt/build-aux/m4/ax_gcc_func_attribute.m4 +246 -0
  37. data/ext/libxcrypt/build-aux/m4/ax_require_defined.m4 +37 -0
  38. data/ext/libxcrypt/build-aux/m4/ax_valgrind_check.m4 +239 -0
  39. data/ext/libxcrypt/build-aux/m4/libtool.m4 +8488 -0
  40. data/ext/libxcrypt/build-aux/m4/ltoptions.m4 +467 -0
  41. data/ext/libxcrypt/build-aux/m4/ltsugar.m4 +124 -0
  42. data/ext/libxcrypt/build-aux/m4/ltversion.m4 +24 -0
  43. data/ext/libxcrypt/build-aux/m4/lt~obsolete.m4 +99 -0
  44. data/ext/libxcrypt/build-aux/m4/pkg_compat.m4 +88 -0
  45. data/ext/libxcrypt/build-aux/m4/zw_alignment.m4 +90 -0
  46. data/ext/libxcrypt/build-aux/m4/zw_automodern.m4 +307 -0
  47. data/ext/libxcrypt/build-aux/m4/zw_detect_asan.m4 +24 -0
  48. data/ext/libxcrypt/build-aux/m4/zw_endianness.m4 +152 -0
  49. data/ext/libxcrypt/build-aux/m4/zw_ld_wrap.m4 +47 -0
  50. data/ext/libxcrypt/build-aux/m4/zw_prog_perl.m4 +40 -0
  51. data/ext/libxcrypt/build-aux/m4/zw_simple_warnings.m4 +150 -0
  52. data/ext/libxcrypt/build-aux/m4/zw_static_assert.m4 +68 -0
  53. data/ext/libxcrypt/build-aux/m4-autogen/compile +364 -0
  54. data/ext/libxcrypt/build-aux/m4-autogen/config.guess +1815 -0
  55. data/ext/libxcrypt/build-aux/m4-autogen/config.sub +2354 -0
  56. data/ext/libxcrypt/build-aux/m4-autogen/depcomp +792 -0
  57. data/ext/libxcrypt/build-aux/m4-autogen/install-sh +541 -0
  58. data/ext/libxcrypt/build-aux/m4-autogen/ltmain.sh +11524 -0
  59. data/ext/libxcrypt/build-aux/m4-autogen/missing +236 -0
  60. data/ext/libxcrypt/build-aux/m4-autogen/test-driver +160 -0
  61. data/ext/libxcrypt/build-aux/scripts/BuildCommon.pm +712 -0
  62. data/ext/libxcrypt/build-aux/scripts/check-perlcritic-config +76 -0
  63. data/ext/libxcrypt/build-aux/scripts/compute-symver-floor +116 -0
  64. data/ext/libxcrypt/build-aux/scripts/expand-selected-hashes +80 -0
  65. data/ext/libxcrypt/build-aux/scripts/gen-crypt-h +131 -0
  66. data/ext/libxcrypt/build-aux/scripts/gen-crypt-hashes-h +141 -0
  67. data/ext/libxcrypt/build-aux/scripts/gen-crypt-symbol-vers-h +150 -0
  68. data/ext/libxcrypt/build-aux/scripts/gen-libcrypt-map +67 -0
  69. data/ext/libxcrypt/build-aux/scripts/move-if-change +84 -0
  70. data/ext/libxcrypt/build-aux/scripts/skip-if-exec-format-error +78 -0
  71. data/ext/libxcrypt/codecov.yml +4 -0
  72. data/ext/libxcrypt/config.h.in +303 -0
  73. data/ext/libxcrypt/configure +19885 -0
  74. data/ext/libxcrypt/configure.ac +549 -0
  75. data/ext/libxcrypt/doc/crypt.3 +512 -0
  76. data/ext/libxcrypt/doc/crypt.5 +343 -0
  77. data/ext/libxcrypt/doc/crypt_checksalt.3 +106 -0
  78. data/ext/libxcrypt/doc/crypt_gensalt.3 +285 -0
  79. data/ext/libxcrypt/doc/crypt_gensalt_ra.3 +1 -0
  80. data/ext/libxcrypt/doc/crypt_gensalt_rn.3 +1 -0
  81. data/ext/libxcrypt/doc/crypt_preferred_method.3 +68 -0
  82. data/ext/libxcrypt/doc/crypt_r.3 +1 -0
  83. data/ext/libxcrypt/doc/crypt_ra.3 +1 -0
  84. data/ext/libxcrypt/doc/crypt_rn.3 +1 -0
  85. data/ext/libxcrypt/lib/alg-des-tables.c +3858 -0
  86. data/ext/libxcrypt/lib/alg-des.c +269 -0
  87. data/ext/libxcrypt/lib/alg-des.h +74 -0
  88. data/ext/libxcrypt/lib/alg-gost3411-2012-const.h +313 -0
  89. data/ext/libxcrypt/lib/alg-gost3411-2012-core.c +238 -0
  90. data/ext/libxcrypt/lib/alg-gost3411-2012-core.h +51 -0
  91. data/ext/libxcrypt/lib/alg-gost3411-2012-hmac.c +78 -0
  92. data/ext/libxcrypt/lib/alg-gost3411-2012-hmac.h +46 -0
  93. data/ext/libxcrypt/lib/alg-gost3411-2012-precalc.h +1426 -0
  94. data/ext/libxcrypt/lib/alg-gost3411-2012-ref.h +67 -0
  95. data/ext/libxcrypt/lib/alg-hmac-sha1.c +140 -0
  96. data/ext/libxcrypt/lib/alg-hmac-sha1.h +35 -0
  97. data/ext/libxcrypt/lib/alg-md4.c +270 -0
  98. data/ext/libxcrypt/lib/alg-md4.h +43 -0
  99. data/ext/libxcrypt/lib/alg-md5.c +291 -0
  100. data/ext/libxcrypt/lib/alg-md5.h +43 -0
  101. data/ext/libxcrypt/lib/alg-sha1.c +288 -0
  102. data/ext/libxcrypt/lib/alg-sha1.h +34 -0
  103. data/ext/libxcrypt/lib/alg-sha256.c +630 -0
  104. data/ext/libxcrypt/lib/alg-sha256.h +123 -0
  105. data/ext/libxcrypt/lib/alg-sha512.c +311 -0
  106. data/ext/libxcrypt/lib/alg-sha512.h +81 -0
  107. data/ext/libxcrypt/lib/alg-sm3-hmac.c +113 -0
  108. data/ext/libxcrypt/lib/alg-sm3-hmac.h +42 -0
  109. data/ext/libxcrypt/lib/alg-sm3.c +449 -0
  110. data/ext/libxcrypt/lib/alg-sm3.h +63 -0
  111. data/ext/libxcrypt/lib/alg-yescrypt-common.c +713 -0
  112. data/ext/libxcrypt/lib/alg-yescrypt-opt.c +1568 -0
  113. data/ext/libxcrypt/lib/alg-yescrypt-platform.c +106 -0
  114. data/ext/libxcrypt/lib/alg-yescrypt.h +360 -0
  115. data/ext/libxcrypt/lib/byteorder.h +164 -0
  116. data/ext/libxcrypt/lib/crypt-bcrypt.c +1061 -0
  117. data/ext/libxcrypt/lib/crypt-des-obsolete.c +215 -0
  118. data/ext/libxcrypt/lib/crypt-des.c +491 -0
  119. data/ext/libxcrypt/lib/crypt-gensalt-static.c +40 -0
  120. data/ext/libxcrypt/lib/crypt-gost-yescrypt.c +182 -0
  121. data/ext/libxcrypt/lib/crypt-md5.c +232 -0
  122. data/ext/libxcrypt/lib/crypt-nthash.c +134 -0
  123. data/ext/libxcrypt/lib/crypt-obsolete.h +40 -0
  124. data/ext/libxcrypt/lib/crypt-pbkdf1-sha1.c +260 -0
  125. data/ext/libxcrypt/lib/crypt-port.h +514 -0
  126. data/ext/libxcrypt/lib/crypt-scrypt.c +247 -0
  127. data/ext/libxcrypt/lib/crypt-sha256.c +308 -0
  128. data/ext/libxcrypt/lib/crypt-sha512.c +323 -0
  129. data/ext/libxcrypt/lib/crypt-sm3-yescrypt.c +189 -0
  130. data/ext/libxcrypt/lib/crypt-sm3.c +308 -0
  131. data/ext/libxcrypt/lib/crypt-static.c +44 -0
  132. data/ext/libxcrypt/lib/crypt-sunmd5.c +314 -0
  133. data/ext/libxcrypt/lib/crypt-yescrypt.c +177 -0
  134. data/ext/libxcrypt/lib/crypt.c +421 -0
  135. data/ext/libxcrypt/lib/crypt.h.in +249 -0
  136. data/ext/libxcrypt/lib/gen-des-tables.c +363 -0
  137. data/ext/libxcrypt/lib/hashes.conf +59 -0
  138. data/ext/libxcrypt/lib/libcrypt.map.in +48 -0
  139. data/ext/libxcrypt/lib/libcrypt.minver +97 -0
  140. data/ext/libxcrypt/lib/libxcrypt.pc.in +15 -0
  141. data/ext/libxcrypt/lib/util-base64.c +26 -0
  142. data/ext/libxcrypt/lib/util-gensalt-sha.c +88 -0
  143. data/ext/libxcrypt/lib/util-get-random-bytes.c +154 -0
  144. data/ext/libxcrypt/lib/util-make-failure-token.c +48 -0
  145. data/ext/libxcrypt/lib/util-xbzero.c +43 -0
  146. data/ext/libxcrypt/lib/util-xstrcpy.c +42 -0
  147. data/ext/libxcrypt/lib/xcrypt.h.in +58 -0
  148. data/ext/libxcrypt/libxcrypt.spec.rpkg +481 -0
  149. data/ext/libxcrypt/rpkg.conf +2 -0
  150. data/ext/libxcrypt/rpkg.macros +86 -0
  151. data/ext/libxcrypt/test/TestCommon.pm +326 -0
  152. data/ext/libxcrypt/test/alg-des.c +80 -0
  153. data/ext/libxcrypt/test/alg-gost3411-2012-hmac.c +90 -0
  154. data/ext/libxcrypt/test/alg-gost3411-2012.c +191 -0
  155. data/ext/libxcrypt/test/alg-hmac-sha1.c +187 -0
  156. data/ext/libxcrypt/test/alg-md4.c +111 -0
  157. data/ext/libxcrypt/test/alg-md5.c +134 -0
  158. data/ext/libxcrypt/test/alg-pbkdf-hmac-sha256.c +269 -0
  159. data/ext/libxcrypt/test/alg-sha1.c +111 -0
  160. data/ext/libxcrypt/test/alg-sha256.c +141 -0
  161. data/ext/libxcrypt/test/alg-sha512.c +170 -0
  162. data/ext/libxcrypt/test/alg-sm3-hmac.c +149 -0
  163. data/ext/libxcrypt/test/alg-sm3.c +168 -0
  164. data/ext/libxcrypt/test/alg-yescrypt.c +466 -0
  165. data/ext/libxcrypt/test/badsalt.c +726 -0
  166. data/ext/libxcrypt/test/badsetting.c +350 -0
  167. data/ext/libxcrypt/test/byteorder.c +254 -0
  168. data/ext/libxcrypt/test/checksalt.c +265 -0
  169. data/ext/libxcrypt/test/compile-strong-alias.c +43 -0
  170. data/ext/libxcrypt/test/crypt-badargs.c +392 -0
  171. data/ext/libxcrypt/test/crypt-gost-yescrypt.c +149 -0
  172. data/ext/libxcrypt/test/crypt-nested-call.c +180 -0
  173. data/ext/libxcrypt/test/crypt-sm3-yescrypt.c +149 -0
  174. data/ext/libxcrypt/test/crypt-too-long-phrase.c +157 -0
  175. data/ext/libxcrypt/test/des-cases.h +196 -0
  176. data/ext/libxcrypt/test/des-obsolete.c +206 -0
  177. data/ext/libxcrypt/test/des-obsolete_r.c +207 -0
  178. data/ext/libxcrypt/test/explicit-bzero.c +334 -0
  179. data/ext/libxcrypt/test/gensalt-bcrypt_x.c +54 -0
  180. data/ext/libxcrypt/test/gensalt-extradata.c +246 -0
  181. data/ext/libxcrypt/test/gensalt-nested-call.c +126 -0
  182. data/ext/libxcrypt/test/gensalt-nthash.c +65 -0
  183. data/ext/libxcrypt/test/gensalt.c +599 -0
  184. data/ext/libxcrypt/test/getrandom-fallbacks.c +295 -0
  185. data/ext/libxcrypt/test/getrandom-interface.c +211 -0
  186. data/ext/libxcrypt/test/ka-table-gen.py +945 -0
  187. data/ext/libxcrypt/test/ka-table.inc +5849 -0
  188. data/ext/libxcrypt/test/ka-tester.c +240 -0
  189. data/ext/libxcrypt/test/preferred-method.c +133 -0
  190. data/ext/libxcrypt/test/short-outbuf.c +119 -0
  191. data/ext/libxcrypt/test/special-char-salt.c +1160 -0
  192. data/ext/libxcrypt/test/symbols-compat.pl +137 -0
  193. data/ext/libxcrypt/test/symbols-renames.pl +107 -0
  194. data/ext/libxcrypt/test/symbols-static.pl +87 -0
  195. data/ext/xcrypt/xcrypt.c +9 -0
  196. data/lib/xcrypt/ffi.rb +76 -0
  197. data/lib/xcrypt/version.rb +5 -0
  198. data/lib/xcrypt.rb +89 -0
  199. metadata +267 -0
@@ -0,0 +1,236 @@
1
+ #! /bin/sh
2
+ # Common wrapper for a few potentially missing GNU and other programs.
3
+
4
+ scriptversion=2024-12-03.03; # UTC
5
+
6
+ # shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells
7
+
8
+ # Copyright (C) 1996-2025 Free Software Foundation, Inc.
9
+ # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
10
+
11
+ # This program is free software; you can redistribute it and/or modify
12
+ # it under the terms of the GNU General Public License as published by
13
+ # the Free Software Foundation; either version 2, or (at your option)
14
+ # any later version.
15
+
16
+ # This program is distributed in the hope that it will be useful,
17
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ # GNU General Public License for more details.
20
+
21
+ # You should have received a copy of the GNU General Public License
22
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
23
+
24
+ # As a special exception to the GNU General Public License, if you
25
+ # distribute this file as part of a program that contains a
26
+ # configuration script generated by Autoconf, you may include it under
27
+ # the same distribution terms that you use for the rest of that program.
28
+
29
+ if test $# -eq 0; then
30
+ echo 1>&2 "Try '$0 --help' for more information"
31
+ exit 1
32
+ fi
33
+
34
+ case $1 in
35
+
36
+ --is-lightweight)
37
+ # Used by our autoconf macros to check whether the available missing
38
+ # script is modern enough.
39
+ exit 0
40
+ ;;
41
+
42
+ --run)
43
+ # Back-compat with the calling convention used by older automake.
44
+ shift
45
+ ;;
46
+
47
+ -h|--h|--he|--hel|--help)
48
+ echo "\
49
+ $0 [OPTION]... PROGRAM [ARGUMENT]...
50
+
51
+ Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
52
+ to PROGRAM being missing or too old.
53
+
54
+ Options:
55
+ -h, --help display this help and exit
56
+ -v, --version output version information and exit
57
+
58
+ Supported PROGRAM values:
59
+ aclocal autoconf autogen autoheader autom4te automake autoreconf
60
+ bison flex help2man lex makeinfo perl yacc
61
+
62
+ Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
63
+ 'g' are ignored when checking the name.
64
+
65
+ Report bugs to <bug-automake@gnu.org>.
66
+ GNU Automake home page: <https://www.gnu.org/software/automake/>.
67
+ General help using GNU software: <https://www.gnu.org/gethelp/>."
68
+ exit $?
69
+ ;;
70
+
71
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
72
+ echo "missing (GNU Automake) $scriptversion"
73
+ exit $?
74
+ ;;
75
+
76
+ -*)
77
+ echo 1>&2 "$0: unknown '$1' option"
78
+ echo 1>&2 "Try '$0 --help' for more information"
79
+ exit 1
80
+ ;;
81
+
82
+ esac
83
+
84
+ # Run the given program, remember its exit status.
85
+ "$@"; st=$?
86
+
87
+ # If it succeeded, we are done.
88
+ test $st -eq 0 && exit 0
89
+
90
+ # Also exit now if we it failed (or wasn't found), and '--version' was
91
+ # passed; such an option is passed most likely to detect whether the
92
+ # program is present and works.
93
+ case $2 in --version|--help) exit $st;; esac
94
+
95
+ # Exit code 63 means version mismatch. This often happens when the user
96
+ # tries to use an ancient version of a tool on a file that requires a
97
+ # minimum version.
98
+ if test $st -eq 63; then
99
+ msg="probably too old"
100
+ elif test $st -eq 127; then
101
+ # Program was missing.
102
+ msg="missing on your system"
103
+ else
104
+ # Program was found and executed, but failed. Give up.
105
+ exit $st
106
+ fi
107
+
108
+ perl_URL=https://www.perl.org/
109
+ flex_URL=https://github.com/westes/flex
110
+ gnu_software_URL=https://www.gnu.org/software
111
+
112
+ program_details ()
113
+ {
114
+ case $1 in
115
+ aclocal|automake|autoreconf)
116
+ echo "The '$1' program is part of the GNU Automake package:"
117
+ echo "<$gnu_software_URL/automake>"
118
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
119
+ echo "<$gnu_software_URL/autoconf>"
120
+ echo "<$gnu_software_URL/m4/>"
121
+ echo "<$perl_URL>"
122
+ ;;
123
+ autoconf|autom4te|autoheader)
124
+ echo "The '$1' program is part of the GNU Autoconf package:"
125
+ echo "<$gnu_software_URL/autoconf/>"
126
+ echo "It also requires GNU m4 and Perl in order to run:"
127
+ echo "<$gnu_software_URL/m4/>"
128
+ echo "<$perl_URL>"
129
+ ;;
130
+ *)
131
+ :
132
+ ;;
133
+ esac
134
+ }
135
+
136
+ give_advice ()
137
+ {
138
+ # Normalize program name to check for.
139
+ normalized_program=`echo "$1" | sed '
140
+ s/^gnu-//; t
141
+ s/^gnu//; t
142
+ s/^g//; t'`
143
+
144
+ printf '%s\n' "'$1' is $msg."
145
+
146
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
147
+ autoheader_deps="'acconfig.h'"
148
+ automake_deps="'Makefile.am'"
149
+ aclocal_deps="'acinclude.m4'"
150
+ case $normalized_program in
151
+ aclocal*)
152
+ echo "You should only need it if you modified $aclocal_deps or"
153
+ echo "$configure_deps."
154
+ ;;
155
+ autoconf*)
156
+ echo "You should only need it if you modified $configure_deps."
157
+ ;;
158
+ autogen*)
159
+ echo "You should only need it if you modified a '.def' or '.tpl' file."
160
+ echo "You may want to install the GNU AutoGen package:"
161
+ echo "<$gnu_software_URL/autogen/>"
162
+ ;;
163
+ autoheader*)
164
+ echo "You should only need it if you modified $autoheader_deps or"
165
+ echo "$configure_deps."
166
+ ;;
167
+ automake*)
168
+ echo "You should only need it if you modified $automake_deps or"
169
+ echo "$configure_deps."
170
+ ;;
171
+ autom4te*)
172
+ echo "You might have modified some maintainer files that require"
173
+ echo "the 'autom4te' program to be rebuilt."
174
+ ;;
175
+ autoreconf*)
176
+ echo "You should only need it if you modified $aclocal_deps or"
177
+ echo "$automake_deps or $autoheader_deps or $automake_deps or"
178
+ echo "$configure_deps."
179
+ ;;
180
+ bison*|yacc*)
181
+ echo "You should only need it if you modified a '.y' file."
182
+ echo "You may want to install the GNU Bison package:"
183
+ echo "<$gnu_software_URL/bison/>"
184
+ ;;
185
+ help2man*)
186
+ echo "You should only need it if you modified a dependency" \
187
+ "of a man page."
188
+ echo "You may want to install the GNU Help2man package:"
189
+ echo "<$gnu_software_URL/help2man/>"
190
+ ;;
191
+ lex*|flex*)
192
+ echo "You should only need it if you modified a '.l' file."
193
+ echo "You may want to install the Fast Lexical Analyzer package:"
194
+ echo "<$flex_URL>"
195
+ ;;
196
+ makeinfo*)
197
+ echo "You should only need it if you modified a '.texi' file, or"
198
+ echo "any other file indirectly affecting the aspect of the manual."
199
+ echo "You might want to install the Texinfo package:"
200
+ echo "<$gnu_software_URL/texinfo/>"
201
+ echo "The spurious makeinfo call might also be the consequence of"
202
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
203
+ echo "want to install GNU make:"
204
+ echo "<$gnu_software_URL/make/>"
205
+ ;;
206
+ perl*)
207
+ echo "You should only need it to run GNU Autoconf, GNU Automake, "
208
+ echo " assorted other tools, or if you modified a Perl source file."
209
+ echo "You may want to install the Perl 5 language interpreter:"
210
+ echo "<$perl_URL>"
211
+ ;;
212
+ *)
213
+ echo "You might have modified some files without having the proper"
214
+ echo "tools for further handling them. Check the 'README' file, it"
215
+ echo "often tells you about the needed prerequisites for installing"
216
+ echo "this package. You may also peek at any GNU archive site, in"
217
+ echo "case some other package contains this missing '$1' program."
218
+ ;;
219
+ esac
220
+ program_details "$normalized_program"
221
+ }
222
+
223
+ give_advice "$1" | sed -e '1s/^/WARNING: /' \
224
+ -e '2,$s/^/ /' >&2
225
+
226
+ # Propagate the correct exit status (expected to be 127 for a program
227
+ # not found, 63 for a program that failed due to version mismatch).
228
+ exit $st
229
+
230
+ # Local variables:
231
+ # eval: (add-hook 'before-save-hook 'time-stamp nil t)
232
+ # time-stamp-start: "scriptversion="
233
+ # time-stamp-format: "%:y-%02m-%02d.%02H"
234
+ # time-stamp-time-zone: "UTC0"
235
+ # time-stamp-end: "; # UTC"
236
+ # End:
@@ -0,0 +1,160 @@
1
+ #! /bin/sh
2
+ # test-driver - basic testsuite driver script.
3
+
4
+ scriptversion=2024-12-03.03; # UTC
5
+
6
+ # Copyright (C) 2011-2025 Free Software Foundation, Inc.
7
+ #
8
+ # This program is free software; you can redistribute it and/or modify
9
+ # it under the terms of the GNU General Public License as published by
10
+ # the Free Software Foundation; either version 2, or (at your option)
11
+ # any later version.
12
+ #
13
+ # This program is distributed in the hope that it will be useful,
14
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ # GNU General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+
21
+ # As a special exception to the GNU General Public License, if you
22
+ # distribute this file as part of a program that contains a
23
+ # configuration script generated by Autoconf, you may include it under
24
+ # the same distribution terms that you use for the rest of that program.
25
+
26
+ # This file is maintained in Automake, please report
27
+ # bugs to <bug-automake@gnu.org> or send patches to
28
+ # <automake-patches@gnu.org>.
29
+
30
+ # Make unconditional expansion of undefined variables an error. This
31
+ # helps a lot in preventing typo-related bugs.
32
+ set -u
33
+
34
+ usage_error ()
35
+ {
36
+ echo "$0: $*" >&2
37
+ print_usage >&2
38
+ exit 2
39
+ }
40
+
41
+ print_usage ()
42
+ {
43
+ cat <<END
44
+ Usage:
45
+ test-driver --test-name NAME --log-file PATH --trs-file PATH
46
+ [--expect-failure {yes|no}] [--color-tests {yes|no}]
47
+ [--collect-skipped-logs {yes|no}]
48
+ [--enable-hard-errors {yes|no}] [--]
49
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
50
+
51
+ The '--test-name', '--log-file' and '--trs-file' options are mandatory.
52
+ See the GNU Automake documentation for information.
53
+
54
+ Report bugs to <bug-automake@gnu.org>.
55
+ GNU Automake home page: <https://www.gnu.org/software/automake/>.
56
+ General help using GNU software: <https://www.gnu.org/gethelp/>.
57
+ END
58
+ }
59
+
60
+ test_name= # Used for reporting.
61
+ log_file= # Where to save the output of the test script.
62
+ trs_file= # Where to save the metadata of the test run.
63
+ expect_failure=no
64
+ color_tests=no
65
+ collect_skipped_logs=yes
66
+ enable_hard_errors=yes
67
+ while test $# -gt 0; do
68
+ case $1 in
69
+ --help) print_usage; exit $?;;
70
+ --version) echo "test-driver (GNU Automake) $scriptversion"; exit $?;;
71
+ --test-name) test_name=$2; shift;;
72
+ --log-file) log_file=$2; shift;;
73
+ --trs-file) trs_file=$2; shift;;
74
+ --color-tests) color_tests=$2; shift;;
75
+ --collect-skipped-logs) collect_skipped_logs=$2; shift;;
76
+ --expect-failure) expect_failure=$2; shift;;
77
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
78
+ --) shift; break;;
79
+ -*) usage_error "invalid option: '$1'";;
80
+ *) break;;
81
+ esac
82
+ shift
83
+ done
84
+
85
+ missing_opts=
86
+ test x"$test_name" = x && missing_opts="$missing_opts --test-name"
87
+ test x"$log_file" = x && missing_opts="$missing_opts --log-file"
88
+ test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
89
+ if test x"$missing_opts" != x; then
90
+ usage_error "the following mandatory options are missing:$missing_opts"
91
+ fi
92
+
93
+ if test $# -eq 0; then
94
+ usage_error "missing argument"
95
+ fi
96
+
97
+ if test $color_tests = yes; then
98
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
99
+ red='' # Red.
100
+ grn='' # Green.
101
+ lgn='' # Light green.
102
+ blu='' # Blue.
103
+ mgn='' # Magenta.
104
+ std='' # No color.
105
+ else
106
+ red= grn= lgn= blu= mgn= std=
107
+ fi
108
+
109
+ do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
110
+ trap "st=129; $do_exit" 1
111
+ trap "st=130; $do_exit" 2
112
+ trap "st=141; $do_exit" 13
113
+ trap "st=143; $do_exit" 15
114
+
115
+ # Test script is run here. We create the file first, then append to it,
116
+ # to ameliorate tests themselves also writing to the log file. Our tests
117
+ # don't, but others can (automake bug#35762).
118
+ : >"$log_file"
119
+ "$@" >>"$log_file" 2>&1
120
+ estatus=$?
121
+
122
+ if test $enable_hard_errors = no && test $estatus -eq 99; then
123
+ tweaked_estatus=1
124
+ else
125
+ tweaked_estatus=$estatus
126
+ fi
127
+
128
+ case $tweaked_estatus:$expect_failure in
129
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
130
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
131
+ 77:*) col=$blu res=SKIP recheck=no gcopy=$collect_skipped_logs;;
132
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
133
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
134
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
135
+ esac
136
+
137
+ # Report the test outcome and exit status in the logs, so that one can
138
+ # know whether the test passed or failed simply by looking at the '.log'
139
+ # file, without the need of also peaking into the corresponding '.trs'
140
+ # file (automake bug#11814).
141
+ echo "$res $test_name (exit status: $estatus)" >>"$log_file"
142
+
143
+ # Report outcome to console.
144
+ echo "${col}${res}${std}: $test_name"
145
+
146
+ # Register the test result, and other relevant metadata.
147
+ echo ":test-result: $res" > $trs_file
148
+ echo ":global-test-result: $res" >> $trs_file
149
+ echo ":recheck: $recheck" >> $trs_file
150
+ echo ":copy-in-global-log: $gcopy" >> $trs_file
151
+
152
+ # Local Variables:
153
+ # mode: shell-script
154
+ # sh-indentation: 2
155
+ # eval: (add-hook 'before-save-hook 'time-stamp nil t)
156
+ # time-stamp-start: "scriptversion="
157
+ # time-stamp-format: "%:y-%02m-%02d.%02H"
158
+ # time-stamp-time-zone: "UTC0"
159
+ # time-stamp-end: "; # UTC"
160
+ # End: