Commit graph

124 commits

Author SHA1 Message Date
Treehugger Robot
7569b29092 Merge "switch to soong" 2017-10-22 07:38:51 +00:00
Jiyong Park
6709053dbb switch to soong
sh is converted to Android.bp

Bug: 66914194
Test: build. sh is found in both /system/bin and /vendor/bin

Change-Id: Iee59e7f2a60c3855c76935e64b8100b7f8eb4802
2017-10-20 11:04:56 +09:00
Chih-hung Hsieh
9da7e0f318 Merge "Use -Werror in external/mksh" 2017-10-12 20:33:07 +00:00
Chih-Hung Hsieh
f52e721264 Use -Werror in external/mksh
* Suppress existing warnings.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I8e8e88745daaf2fbaef2a8ba373d6de1039fe030
2017-10-11 13:12:45 -07:00
Elliott Hughes
5677920e65 Merge "Stop setting $HOSTNAME in mkshrc." 2017-10-03 21:57:49 +00:00
Elliott Hughes
1255a78d21 Stop setting $HOSTNAME in mkshrc.
bash sets this itself. mksh doesn't, but we can set it in adbd instead.

Bug: N/A
Test: `adb shell printenv` and `adb shell`, `printenv`
Change-Id: I3967681c9c6f7bf9b1365f8361e4960e40e4f916
2017-10-03 08:42:27 -07:00
Elliott Hughes
a1899ee519 Merge "Upgrade to mksh R56b." 2017-09-25 19:37:27 +00:00
Elliott Hughes
23925bb36e Upgrade to mksh R56b.
R56b is a bugfix-only release everyone should upgrade to:

[tg] Reference the FAQ webpage
[panpo, Riviera] Fix documentation bug wrt. Esc+Ctrl-L
[tg, Larry Hynes] Fix “0” movement in vi mode
[tg] Replace broken libcs’ offsetof macro with MirBSD’s

R56 is a bugfix release with some experimental fixes:

[tg, Seb] Do not apply alias name restrictions to hash/tilde tracking
[tg] Restore ‘.’, ‘:’ and ‘[’ in alias names (“[[” is still forbidden)
[tg] Fix accidentally defanged $PATHSEP test
[tg] On ^C (INTR and QUIT edchars), shove edit line into history
[iSKUNK, tg] Begin porting to z/OS using EBCDIC encoding, incomplete
[tg] Redo fast character classes code, adding POSIX and other helpers
[tg] bind parses backslash-escaped ‘^’ (and ‘\’) as escaped
[tg] Building with -DMKSH_ASSUME_UTF8=0 no longer causes a known failure in the testsuite
[tg] New test.sh option -U to pass a UTF-8 locale to use in the tests
[tg] re_format(7) BSD: [[ $x = *[[:\<:]]foo[[:\>:]]* ]]
[tg, iSKUNK] Use Config in check.pl only if it exists
[tg] New matching code for bracket expressions, full POSIX (8bit)
[komh] Exclude FAT/HPFS/NTFS-unsafe tests on OS/2 (and Cygwin/MSYS)
[tg] Update to Unicode 10.0.0
[tg, selk] Make readonly idempotent
[tg, multiplexd] When truncating the persistent history, do not change the underlying file, do all operations on the locked one; do not stop using the history at all if it has been truncated
[tg, Jörg] Turn off UTF-8 mode upon turning on POSIX mode
[Martijn Dekker, Geoff Clare, many on the Austin list, tg] In POSIX mode, make the exec builtin force a $PATH search plus execve
[tg] Fix GCC 7, Coverity Scan warnings
[tg, Michal Hlavinka] Track background process PIDs even interactive
[tg] Always expose mksh’s hexdump shell function; speed it up by working on the input in chunks; use character classes to make it EBCDIC safe
[tg] Revamp dot.mkshrc default editor selection mechanism

Bug: N/A
Test: builds and boots
Change-Id: I35d624c4352c1b7c1ee499f9680712a30c64323b
2017-09-22 16:21:10 -07:00
padarshr
8547d5a6a9 Merge "Build vendor shell unconditionally."
am: bba8f4a328

Change-Id: Icf13f5feb51106fd9b373517ae082018dfe7bab9
2017-06-27 18:57:15 +00:00
Treehugger Robot
bba8f4a328 Merge "Build vendor shell unconditionally." 2017-06-27 18:47:31 +00:00
padarshr
8749a1ed1f Build vendor shell unconditionally.
Always build vendor shell irrespective of whether
PRODUCT_FULL_TREBLE is enabled or not, as even on Non-Full
treble builds this can be useful to start vendor scripts.

Change-Id: I93e514760cfcfd4f7f4ce401eae50d839638c51c
2017-06-23 23:21:47 +05:30
Yifan Hong
140506d9d2 Merge "sh_vendor link to libc as a shared library." am: 02aa26d9ab
am: 17d120feef

Change-Id: I690fa32795488aa9678dcce1bc4fb0df6f92ff08
2017-06-22 19:22:47 +00:00
Yifan Hong
17d120feef Merge "sh_vendor link to libc as a shared library."
am: 02aa26d9ab

Change-Id: If97c273883223e2a516bd788df2d58f25681666c
2017-06-22 19:18:11 +00:00
Treehugger Robot
02aa26d9ab Merge "sh_vendor link to libc as a shared library." 2017-06-22 19:14:23 +00:00
Yifan Hong
5c1d501b91 sh_vendor link to libc as a shared library.
Test: BOARD_VNDK_VERSION m -j -k
Test: m -j -k and boots

Bug: 33241851
Change-Id: Ica98c551892ff83b7e9e661d2ddfa4bac7d2c6f4
Merged-In: Ica98c551892ff83b7e9e661d2ddfa4bac7d2c6f4
2017-06-21 17:31:43 -07:00
Sandeep Patil
632282bc91 Merge "install copy of shell in vendor partition" am: ee224ea092
am: 5a6144a098  -s ours

Change-Id: I05b9d8ad63a5b69fec0c7a4dc768d1fcade3a8a6
2017-06-21 23:04:59 +00:00
Sandeep Patil
5a6144a098 Merge "install copy of shell in vendor partition"
am: ee224ea092

Change-Id: Id919730d78760daefef01bba45b64556658cf8a5
2017-06-21 23:01:42 +00:00
Sandeep Patil
ee224ea092 Merge "install copy of shell in vendor partition" 2017-06-21 22:58:33 +00:00
Sandeep Patil
f3308fef45 install copy of shell in vendor partition
This is to be used by vendor processes. Particularly, vendor shell
scripts that get launched as init services. The shell is restricted from
running as interactive mode in SEPolicy. Unless it is launched from rooted
system shell. The change also adds the ability to override the default
$PATH regardless of the environment.

Bug: 36463595
Test: Boot sailfish with new shell and ensure all init services exit
      with status 0

Merged-In: I1eaf2c8a8f6905caf00d53e067add67eaea00e09
Change-Id: I1eaf2c8a8f6905caf00d53e067add67eaea00e09
Signed-off-by: Sandeep Patil <sspatil@google.com>
(cherry picked from commit c203611510)
2017-06-21 14:21:30 -07:00
Sandeep Patil
5bfe1ea22e install copy of shell in vendor partition
am: c203611510

Change-Id: I6a1da672c65522768647550df8768f9cd3285b23
2017-04-14 21:01:07 +00:00
Elliott Hughes
651a7bb8b8 Merge "Upgrade to mksh R55." am: 693c2ea1e4 am: e0d2df7f07
am: 0d2db5fba1

Change-Id: I14e66c15ea92f0ae7b282245bb07f911dfccf935
2017-04-14 06:07:26 +00:00
Elliott Hughes
0d2db5fba1 Merge "Upgrade to mksh R55." am: 693c2ea1e4
am: e0d2df7f07

Change-Id: I2e1ef7d4911a211b3dc58e3cab8e6c6e0ad2778a
2017-04-14 06:00:07 +00:00
Elliott Hughes
e0d2df7f07 Merge "Upgrade to mksh R55."
am: 693c2ea1e4

Change-Id: If722a24bb137ba653d1374814397c705f3b10af2
2017-04-14 05:53:42 +00:00
Elliott Hughes
693c2ea1e4 Merge "Upgrade to mksh R55." 2017-04-14 05:43:06 +00:00
Sandeep Patil
c203611510 install copy of shell in vendor partition
This is to be used by vendor processes. Particularly, vendor shell
scripts that get launched as init services. The shell is restricted from
running as interactive mode in SEPolicy. Unless it is launched from rooted
system shell. The change also adds the ability to override the default
$PATH regardless of the environment.

Bug: 36463595
Test: Boot sailfish with new shell and ensure all init services exit
      with status 0

Change-Id: I1eaf2c8a8f6905caf00d53e067add67eaea00e09
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-04-13 14:55:59 -07:00
Elliott Hughes
a3c3f96fb8 Upgrade to mksh R55.
R55 is mostly a feature release with summary bugfixes:

[komh] Fix OS/2 search_access() and UNC path logic
[tg] Undocument printf(1) to avoid user confusion
[Jean Delvare, tg] Fix printf builtin -R option
[tg] Make ${var@x}, unknown x, fail (thanks izabera)
[tg] ${var=x} must evaluate x in scalar context (10x Martijn Dekker)
[tg] Fixup relation between lksh and mksh, reduce delta
[tg] Improve manpage display; add OS/2 $PATH FAQ
[Jean Delvare] Fix bugs in manpage
[tg] Review tilde expansion, removing “odd use of KEEPASN” and introduce POSIX “declaration utility” concept; wait isn’t one
[tg] Add \builtin utility, declaration utility forwarder
[tg] Make $'\xz' expand to xz, not \0
[tg] Use fixed string pooling (requires the above change in host mksh)
[tg] POSIX declaration commands can have varassign and redirections
[Martijn Dekker] Add typeset -g, replacing homegrown “global”
[Harvey-OS] Disable NOPROSPECTOFWORK, APEX is reportedly fixed now
[tg] Display ulimit -a output with flags; improve Haiku
[tg] Drop old let] hack, use \builtin internally
[tg] Fix padding in Lb64encode in dot.mkshrc
[tg] Move FAQ content to a separate, new FAQ section in the manpage
[tg] Add new standard variable PATHSEP (‘:’, ‘;’ on OS/2)
[Martijn Dekker] Fix LINENO in eval and alias
[komh] Fix “\builtin” on OS/2
[tg] Improve (internal) character classes code for speed
[tg] Fix: the underscore is no drive letter
[tg] No longer hard-disable persistent history support in lksh
[tg] Introduce build flag -T for enabling “textmode” on OS/2 (supporting CR+LF line endings, but incompatible with mksh proper)
[tg] Merge mksh-os2
[tg] Permit changing $OS2_SHELL during a running shell
[tg] Fix multibyte handling in ^R (Emacs search-history)
[tg] Allow “typeset -p arrname[2]” to work
[tg] Make some error messages more consistent
[tg, komh] Disable UTF-8 detection code for OS/2 as unrealistic
[tg, sdaoden] Limit alias name chars to POSIX plus non-leading ‘-’
[tg, Martijn Dekker] Expand aliases at COMSUB parse time
[tg] Make “typeset -f” output alias-resistent
[tg, Martijn Dekker] Permit “eval break” and “eval continue”
[tg] Make -masm=intel safe on i386
[tg] Disambiguate $((…)) vs. $((…)…) in “typeset -f” output
[Jean Delvare] Clarify the effect of exit and return in a subshell
[tg] Simplify compile-time asserts and make them actually compile-time
[tg] Fix ^O in Emacs mode if the line was modified (LP#1675842)
[tg] Address Coverity Scan… stuff… now that it builds again
[Martijn Dekker, tg] Add test -v
[tg] Document set -o posix/sh completely

Bug: N/A
Test: manual
Change-Id: Ifce1d879933a5773e98b4f34f4a9bb86a6bdff3b
2017-04-12 16:52:30 -07:00
Elliott Hughes
206a07da41 Merge "Restore the "print" builtin." am: ad7a062c12 am: be32749ec0 am: 57198a7ef7
am: 2ad3638506

Change-Id: I56028e1c1930f472e39a6d2b6097d8bff89df144
2016-12-22 01:49:59 +00:00
Elliott Hughes
2ad3638506 Merge "Restore the "print" builtin." am: ad7a062c12 am: be32749ec0
am: 57198a7ef7

Change-Id: Ia1ce7e6b20ffe477b92220e515d6922c8cd7eb9e
2016-12-22 01:44:58 +00:00
Elliott Hughes
57198a7ef7 Merge "Restore the "print" builtin." am: ad7a062c12
am: be32749ec0

Change-Id: I2632c14de0896ff3d43b8af4b8fa6c5d978d8215
2016-12-22 01:39:28 +00:00
Elliott Hughes
be32749ec0 Merge "Restore the "print" builtin."
am: ad7a062c12

Change-Id: Ie3efc027233d111d15546e70da7d94c9798b752d
2016-12-22 01:33:27 +00:00
Treehugger Robot
ad7a062c12 Merge "Restore the "print" builtin." 2016-12-22 01:25:54 +00:00
Elliott Hughes
3d9915284b Restore the "print" builtin.
otapreopt_script is currently using this. We should probably move it onto
the more portable echo or printf, but for now I'm assuming there's a reason
why print is being used --- the use of -u implies isn't not just a typo for
printf.

(Even if we can switch to echo or printf, I'm tempted to just leave print be
anyway, since unlike the other disabled mksh builtins, it's not shadowing a
better implementation, so it's not causing confusion about why the "same"
command in different contexts behaves differently. The worst it will do is
cause portability problems if we move away from mksh, and in the meantime
print is documented on the mksh man page for users sophisticated enough to
know that we're using mksh, so it's arguably more surprising for it to be
missing.)

Bug: http://b/33761687
Test: manual
Change-Id: I440d759a3c4ef6fa24fd496ea832093e18b7060e
2016-12-21 10:59:39 -08:00
Elliott Hughes
bf7d94027a Merge "Upgrade to mksh R40." am: ceb0b57de2 am: caf111e450 am: 7fba070015
am: 6e9f7fbc73

Change-Id: Ic9e97307012402b0c0f4b5565d1849400dbccc56
2016-12-09 02:25:18 +00:00
Elliott Hughes
6e9f7fbc73 Merge "Upgrade to mksh R40." am: ceb0b57de2 am: caf111e450
am: 7fba070015

Change-Id: I880307b7a52a252c9d7f56b8a6be684da6f6b471
2016-12-09 02:20:36 +00:00
Elliott Hughes
7fba070015 Merge "Upgrade to mksh R40." am: ceb0b57de2
am: caf111e450

Change-Id: I1c004b01a61d85022defd2c461a12c5db8778307
2016-12-09 02:15:36 +00:00
Elliott Hughes
caf111e450 Merge "Upgrade to mksh R40."
am: ceb0b57de2

Change-Id: Ib164451b87d9653f15c276c8ecd441a05ff6253e
2016-12-09 02:10:35 +00:00
Treehugger Robot
ceb0b57de2 Merge "Upgrade to mksh R40." 2016-12-09 02:06:26 +00:00
Elliott Hughes
966dd55b23 Upgrade to mksh R40.
From the release notes...

R54 is a bugfix release with moderate new features:

[tg] Simplify and improve code and manual page
[tg] Try GCC 5’s new -malign-data=abi
[tg] Allow interrupting builtin cat even on fast devices (LP#1616692)
[tg] Update to Unicode 9.0.0
[Andreas Buschka] Correct English spelling
[tg] Handle set -e-related error propagation in || and && constructs correctly
[tg] Initialise memory for RNG even when not targeting Valgrind
[tg] Shrink binary size
[Brian Callahan] Improve support for the contemporary pcc compiler
[tg] Fix side effects with lazy evaluation; spotted by ormaaj
[tg] New flags -c (columnise), -l, -N for the print builtin
[Larry Hynes] Fix English, spelling mistakes, typos in the manpage
[tg, ormaah] Return 128+SIGALRM if read -t times out, like GNU bash
[Martijn Dekker] Install both manpages from Build.sh
[Martijn Dekker] Document case changes are ASCII-only
[Ronald G. Minnich, Elbing Miss, Álvaro Jurado, tg] Begin porting to Harvey-OS and APEX (similar to Plan 9 and APE)
[KO Myung-Hun] More infrastructure for the OS/2 (EMX, KLIBC) port

I've continued to disable the cat, realpath, and sleep builtins,
and added print to the list (now I've realized it's unrelated to
the print on the desktop).

Bug: N/A
Test: manual
Change-Id: Iead4c1b572c6f288b2ab2b884125dcb606f1e356
2016-12-08 15:59:56 -08:00
Elliott Hughes
caf9a1dc45 Merge "Restore some of the mksh builtins." am: cd79a34d28 am: b48d5773d8 am: 10787a6eee
am: ff0f07eb15

Change-Id: Ie3e81fdba2724ab3a1551819c2a34f1414267b87
2016-08-27 03:20:39 +00:00
Elliott Hughes
ff0f07eb15 Merge "Restore some of the mksh builtins." am: cd79a34d28 am: b48d5773d8
am: 10787a6eee

Change-Id: I49b1c553ffc8749c9c3e15e73cf036b08a3d18dd
2016-08-27 02:50:44 +00:00
Elliott Hughes
10787a6eee Merge "Restore some of the mksh builtins." am: cd79a34d28
am: b48d5773d8

Change-Id: I8c6a2f2b317fda8699b33990eb33af61d8e48211
2016-08-27 02:47:14 +00:00
Elliott Hughes
b48d5773d8 Merge "Restore some of the mksh builtins."
am: cd79a34d28

Change-Id: I4916f190dc300a629f7266d0409d34a8bbfd3bf4
2016-08-27 02:44:16 +00:00
Treehugger Robot
cd79a34d28 Merge "Restore some of the mksh builtins." 2016-08-27 02:36:56 +00:00
Elliott Hughes
520cf3e8ac Restore some of the mksh builtins.
This makes us match bash in terms of what is/isn't a builtin.

Bug: http://b/20720875
Change-Id: Id90aeb115cf5e5217084bc1c5f382e14033b7d49
2016-08-26 18:10:18 -07:00
Elliott Hughes
77b30fef08 Merge "Disable various mksh builtins." am: bf92a24781 am: 28c041f5a3 am: b894dff617
am: 93d7921fa0

Change-Id: I6a1e5bb6c469d96a31a42f16969e264ecf4a012c
2016-08-25 20:16:55 +00:00
Elliott Hughes
93d7921fa0 Merge "Disable various mksh builtins." am: bf92a24781 am: 28c041f5a3
am: b894dff617

Change-Id: Ia9862beb35b52782b4e77d48bac80d038e500ad7
2016-08-25 19:56:30 +00:00
Elliott Hughes
b894dff617 Merge "Disable various mksh builtins." am: bf92a24781
am: 28c041f5a3

Change-Id: I4ba944ff459b419d316f0a97f901fa1290428036
2016-08-25 19:53:29 +00:00
Elliott Hughes
28c041f5a3 Merge "Disable various mksh builtins."
am: bf92a24781

Change-Id: I8de5f26b5b9c7fe338c9402bc5b39eb00bee90a7
2016-08-25 19:50:31 +00:00
Treehugger Robot
bf92a24781 Merge "Disable various mksh builtins." 2016-08-25 19:41:32 +00:00
Elliott Hughes
bd2d15844c Disable various mksh builtins.
They're buggy and/or lacking in functionality. Disable them and use toybox
instead.

Bug: http://b/27064311
Bug: http://b/20720875
Change-Id: Ie57efffd7b98f172eafe9d4bd5ddf723811b6f29
2016-08-24 17:18:10 -07:00