• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision3918 (tree)
Time2018-11-25 14:25:41
Authormagicant

Log Message

Allow disabling double-bracket command

A new configuration option "--disable-double-bracket" is added.

The combination table in fulltest.sh is updated with brand-new patterns
generated by PICT.

Change Summary

Incremental Difference

--- yash/branches/double_bracket/INSTALL (revision 3917)
+++ yash/branches/double_bracket/INSTALL (revision 3918)
@@ -86,6 +86,9 @@
8686 --enable-dirstack --disable-dirstack
8787 If disabled, the `dirs', `pushd', and `popd' built-in commands are
8888 not available.
89+ --enable-double-bracket --disable-double-bracket
90+ If disabled, the double-bracket command (the [[ ... ]] syntax) is
91+ not available.
8992 --enable-help --disable-help
9093 If disabled, the `help' built-in command is not available.
9194 --enable-history --disable-history
--- yash/branches/double_bracket/configure (revision 3917)
+++ yash/branches/double_bracket/configure (revision 3918)
@@ -44,6 +44,7 @@
4444 debug="false"
4545 enable_array="true"
4646 enable_dirstack="true"
47+enable_double_bracket="true"
4748 enable_nls="true"
4849 enable_help="true"
4950 enable_history="true"
@@ -95,17 +96,18 @@
9596 opt="${1#--*able-}"
9697 opt="${opt%%=*}"
9798 case "$opt" in
98- array) enable_array=$val ;;
99- dirstack) enable_dirstack=$val ;;
100- help) enable_help=$val ;;
101- history) enable_history=$val ;;
102- lineedit) enable_lineedit=$val ;;
103- nls) enable_nls=$val ;;
104- printf) enable_printf=$val ;;
105- socket) enable_socket=$val ;;
106- test) enable_test=$val ;;
107- ulimit) enable_ulimit=$val ;;
108- *) echo "$0: $1: invalid option" >&2; exit 2 ;;
99+ array) enable_array=$val ;;
100+ dirstack) enable_dirstack=$val ;;
101+ double-bracket) enable_double_bracket=$val ;;
102+ help) enable_help=$val ;;
103+ history) enable_history=$val ;;
104+ lineedit) enable_lineedit=$val ;;
105+ nls) enable_nls=$val ;;
106+ printf) enable_printf=$val ;;
107+ socket) enable_socket=$val ;;
108+ test) enable_test=$val ;;
109+ ulimit) enable_ulimit=$val ;;
110+ *) echo "$0: $1: invalid option" >&2; exit 2 ;;
109111 esac
110112 }
111113
@@ -184,19 +186,20 @@
184186 --htmldir=DIR html documentation [DOCDIR]
185187
186188 Optional features:
187- --enable-FEATURE[=ARG] enable or disable FEATURE [ARG=yes]
188- --disable-FEATURE disable FEATURE (same as --enable-FEATURE=no)
189- --enable-array enable the array builtin
190- --enable-dirstack enable the directory stack (pushd, popd, dirs)
191- --enable-help enable the help builtin
192- --enable-history enable history
193- --enable-lineedit enable command line editing
194- --enable-nls enable native language support
195- --enable-printf enable the echo/printf builtins
196- --enable-socket enable socket redirection by /dev/tcp, /dev/udp
197- --enable-test enable the test builtin
198- --enable-ulimit enable the ulimit builtin
199- --default-loadpath=DIR specify the default \$YASH_LOADPATH value
189+ --enable-FEATURE[=ARG] enable or disable FEATURE [ARG=yes]
190+ --disable-FEATURE disable FEATURE (same as --enable-FEATURE=no)
191+ --enable-array enable the array builtin
192+ --enable-dirstack enable the directory stack (pushd, popd, dirs)
193+ --enable-double-bracket enable the double-bracket command
194+ --enable-help enable the help builtin
195+ --enable-history enable history
196+ --enable-lineedit enable command line editing
197+ --enable-nls enable native language support
198+ --enable-printf enable the echo/printf builtins
199+ --enable-socket enable socket redirection by /dev/tcp, /dev/udp
200+ --enable-test enable the test builtin
201+ --enable-ulimit enable the ulimit builtin
202+ --default-loadpath=DIR specify the default \$YASH_LOADPATH value
200203
201204 Optional packages:
202205 --with-intl-lib=LIBS search space-separated LIBS for NLS
@@ -1498,6 +1501,12 @@
14981501 defconfigh "YASH_ENABLE_ARRAY"
14991502 fi
15001503
1504+# enable/disable the double-bracket command
1505+if ${enable_double_bracket}
1506+then
1507+ defconfigh "YASH_ENABLE_DOUBLE_BRACKET"
1508+fi
1509+
15011510 # enable/disable the directory stack
15021511 if ${enable_dirstack}
15031512 then
@@ -1536,6 +1545,15 @@
15361545 then
15371546 defconfigh "YASH_ENABLE_TEST"
15381547 builtin_objs="$builtin_objs "'$(TEST_OBJS)'
1548+else
1549+ if ${enable_double_bracket}
1550+ then
1551+ cat >&2 <<END
1552+The test built-in is required for the double-bracket command, but disabled.
1553+Add the "--disable-double-bracket" option and try again.
1554+END
1555+ fail
1556+ fi
15391557 fi
15401558
15411559 # check for getrlimit and setrlimit
--- yash/branches/double_bracket/tests/fulltest.sh (revision 3917)
+++ yash/branches/double_bracket/tests/fulltest.sh (revision 3918)
@@ -1,5 +1,5 @@
11 # fulltest.sh: runs tests for many combinations of configuration options
2-# (C) 2010-2015 magicant
2+# (C) 2010-2018 magicant
33
44 do_test () {
55 if [ -r Makefile ]; then
@@ -15,33 +15,24 @@
1515
1616 echo "$0: using '${MAKE:=make}' as make"
1717
18-a0='' a1='--disable-lineedit' a2='--disable-history --disable-lineedit' a3=''
19-b0='' b1='--disable-array'
20-c0='' c1='--disable-dirstack'
21-d0='' d1='--disable-help'
22-e0='' e1='--disable-nls'
23-f0='' f1='--disable-printf'
24-g0='' g1='--disable-socket'
25-h0='' h1='--disable-test'
26-i0='' i1='--disable-ulimit'
27-j0='' j1='--debug'
28-k0='' k1=''
29-l0='' l1=''
30-m0='' m1=''
18+a0='' a1='--disable-lineedit' a2='--disable-history --disable-lineedit'
19+b0='' b1='--disable-double-bracket' b2='--disable-double-bracket --disable-test'
20+c0='' c1='--disable-array'
21+d0='' d1='--disable-dirstack'
22+e0='' e1='--disable-help'
23+f0='' f1='--disable-nls'
24+g0='' g1='--disable-printf'
25+h0='' h1='--disable-socket'
26+i0='' i1='--disable-ulimit'
27+j0='' j1='--debug'
3128
32-do_test $a0 $b0 $c0 $d0 $e0 $f0 $g0 $h0 $i0 $j0 $k0 $l0 $m0 "$@"
33-do_test $a0 $b0 $c0 $d0 $e0 $f1 $g1 $h1 $i1 $j1 $k1 $l1 $m1 "$@"
34-do_test $a0 $b1 $c1 $d1 $e1 $f0 $g0 $h0 $i0 $j1 $k1 $l1 $m1 "$@"
35-do_test $a0 $b1 $c1 $d1 $e1 $f1 $g1 $h1 $i1 $j0 $k0 $l0 $m0 "$@"
36-do_test $a1 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0 $j0 "$@"
35+do_test $a2 $b0 $c1 $d1 $e0 $f1 $g1 $h0 $i1 $j0 "$@"
36+do_test $a2 $b1 $c0 $d1 $e0 $f1 $g1 $h1 $i0 $j1 "$@"
37+do_test $a2 $b2 $c0 $d1 $e0 $f0 $g0 $h0 $i1 $j1 "$@"
38+do_test $a2 $b2 $c1 $d0 $e1 $f0 $g1 $h1 $i0 $j0 "$@"
Show on old repository browser