Skip to content

Commit

Permalink
Merge branch 'micro5k:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git authored Nov 2, 2024
2 parents 556c629 + 02d6100 commit 49bac9b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/scripts-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ jobs:
*) CURRENT_APPLET='ash' ;;
esac
;;
'osh' | 'ysh')
CURRENT_APPLET="${1:?}"
CURRENT_SHELL="${2:?}"
;;
*)
CURRENT_APPLET=''
CURRENT_SHELL=''
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ case "${BUILD_TYPE-}" in
esac

save_last_title
change_title 'Building the flashable OTA zip...'
set_title 'Building the flashable OTA zip...'

# shellcheck source=SCRIPTDIR/conf-1.sh
. "${MAIN_DIR}/conf-1.sh"
Expand All @@ -104,7 +104,7 @@ if test "${OPENSOURCE_ONLY:-false}" = 'false'; then . "${MAIN_DIR}/conf-2.sh"; f
if test "${OPENSOURCE_ONLY:-false}" != 'false'; then
if ! is_oss_only_build_enabled; then
echo 'WARNING: The OSS only build is disabled'
change_title 'OSS only build is disabled'
set_title 'OSS only build is disabled'
# shellcheck disable=SC2317
return 0 2>&- || exit 0
fi
Expand Down Expand Up @@ -285,7 +285,7 @@ cd "${_init_dir:?}" || ui_error 'Failed to change back the folder'

echo ''
echo 'Done.'
change_title 'Done'
set_title 'Done'

set +e

Expand Down
8 changes: 4 additions & 4 deletions includes/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ detect_os_and_other_things()
readonly PLATFORM IS_BUSYBOX PATHSEP CYGPATH SHELL_EXE SHELL_APPLET
}

change_title()
set_title()
{
test "${NO_TITLE:-0}" = '0' || return 0
test "${CI:-false}" = 'false' || return 0
Expand All @@ -203,9 +203,9 @@ change_title()
set_default_title()
{
if is_root; then
change_title "[root] Command-line: ${__TITLE_CMD_PREFIX-}${__TITLE_CMD_0-}${__TITLE_CMD_PARAMS-}"
set_title "[root] Command-line: ${__TITLE_CMD_PREFIX-}${__TITLE_CMD_0-}${__TITLE_CMD_PARAMS-}"
else
change_title "Command-line: ${__TITLE_CMD_PREFIX-}${__TITLE_CMD_0-}${__TITLE_CMD_PARAMS-}"
set_title "Command-line: ${__TITLE_CMD_PREFIX-}${__TITLE_CMD_0-}${__TITLE_CMD_PARAMS-}"
fi
A5K_TITLE_IS_DEFAULT='true'
}
Expand All @@ -224,7 +224,7 @@ restore_saved_title_if_exist()
if test "${A5K_SAVED_TITLE-}" = 'default'; then
set_default_title
elif test -n "${A5K_SAVED_TITLE-}"; then
change_title "${A5K_SAVED_TITLE:?}"
set_title "${A5K_SAVED_TITLE:?}"
fi
A5K_SAVED_TITLE=''
}
Expand Down
2 changes: 1 addition & 1 deletion tools/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOOLS

- zipsigner_ **3.0** => zipsigner.jar
- zipsigner_ **3.0** (Dalvik) => zipsigner-dvk.jar
- `BusyBox for Windows`_ **1.38.0-PRE-5526-gbed407a12 (2024-10-29)** => win/busybox.exe
- `BusyBox for Windows`_ **1.38.0-PRE-5528-g5ad83957f (2024-10-30)** => win/busybox.exe
- `BusyBox legacy for Windows`_ **1.21.0-TIG-931-g7e6a84d (2012-11-29)** => win/busybox-legacy.bin
- Zip_ **3.0** => win/zip.exe
- UnZip_ **6.0** => win/unzip.exe
Expand Down
20 changes: 10 additions & 10 deletions tools/bits-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# shellcheck disable=SC3043 # In POSIX sh, local is undefined

SCRIPT_NAME='Bits info'
SCRIPT_VERSION='1.5.19'
SCRIPT_VERSION='1.5.20'

### CONFIGURATION ###

Expand Down Expand Up @@ -78,7 +78,7 @@ convert_max_unsigned_int_to_bit()
'2147483647') printf '%s\n' "32-bit signed${bug_suffix}" ;; # Bugged unsigned 'printf' of awk (seen on some versions of Bash)
'2147483648') printf '%s\n' "32-bit signed + 1 BB BUG" ;; # Bugged unsigned 'printf' of awk (likely on BusyBox)
'4294967295') printf '%s\n' "32-bit unsigned" ;;
'9223372036854775807') printf '%s\n' "64-bit signed${bug_suffix}" ;; # Bugged unsigned 'printf' (seen on Ksh93 / OSH)
'9223372036854775807') printf '%s\n' "64-bit signed${bug_suffix}" ;; # Bugged unsigned 'printf' (seen on Ksh93 / Oils)
'9223372036854775808') printf '%s\n' "64-bit signed + 1${bug_suffix}" ;; # Bugged unsigned 'printf' (seen on Ksh93)
'18446744073709551614') printf '%s\n' "64-bit unsigned - 1" ;;
'18446744073709551615') printf '%s\n' "64-bit unsigned" ;;
Expand Down Expand Up @@ -652,7 +652,7 @@ get_shell_exe()
elif _gse_tmp_var="$(ps 2> /dev/null -p "${$}" -o 'comm=')" && test -n "${_gse_tmp_var}" && _gse_tmp_var="$(command 2> /dev/null -v "${_gse_tmp_var}")"; then
# On Linux / macOS
# shellcheck disable=SC2230 # Ignore: 'which' is non-standard
case "${_gse_tmp_var}" in *'/'* | *"\\"*) ;; *) _gse_tmp_var="$(which 2> /dev/null "${_gse_tmp_var}")" || return 3 ;; esac # We may not get the full path with "command -v" on some versions of OSH
case "${_gse_tmp_var}" in *'/'* | *"\\"*) ;; *) _gse_tmp_var="$(which 2> /dev/null "${_gse_tmp_var}")" || return 3 ;; esac # We may not get the full path with "command -v" on some versions of Oils
elif _gse_tmp_var="${BASH:-${SHELL-}}" && test -n "${_gse_tmp_var}"; then
if test "${_gse_tmp_var}" = '/bin/sh' && test "$(uname 2> /dev/null || :)" = 'Windows_NT'; then _gse_tmp_var="$(command 2> /dev/null -v 'busybox')" || return 2; fi
if test ! -x "${_gse_tmp_var}" && test -x "${_gse_tmp_var}.exe"; then _gse_tmp_var="${_gse_tmp_var}.exe"; fi # Special fix for broken versions of Bash under Windows
Expand Down Expand Up @@ -687,13 +687,13 @@ get_shell_info()

case "${_shell_exe}" in
*'/bosh/'*'/sh' | *'/bosh/sh') _shell_name='bosh' ;;
*'/oils-for-unix' | *'/oil.ovm') _shell_name='osh' ;;
*'/oils-for-unix' | *'/oil.ovm') _shell_name='oils' ;;
*) ;;
esac

case "${_shell_name}" in
*'ksh'*) _shell_is_ksh='true' ;;
'bash' | 'zsh' | 'yash' | 'osh' | 'bosh' | 'pbosh' | 'obosh' | 'tcsh' | 'fish') _shell_use_ver_opt='true' ;;
'bash' | 'zsh' | 'yash' | 'oils' | 'bosh' | 'pbosh' | 'obosh' | 'tcsh' | 'fish') _shell_use_ver_opt='true' ;;
*'\bash') # For bugged versions of Bash under Windows
_shell_use_ver_opt='true'
_shell_name='bash'
Expand Down Expand Up @@ -751,7 +751,7 @@ get_shell_info()
'busybox') _shell_version="${_shell_version#BusyBox}" ;;
'mksh') _shell_version="${_shell_version#*MIRBSD KSH}" ;;
'pdksh' | 'oksh') _shell_version="${_shell_version#*PD KSH}" ;;
'osh') _shell_version="$(printf '%s\n' "${_shell_version#Oils}" | cut -f '1')" ;;
'oils') _shell_version="$(printf '%s\n' "${_shell_version#Oils}" | cut -f '1')" ;;
'') ;;
*) _shell_version="${_shell_version#"${_shell_name}"}" ;;
esac
Expand Down Expand Up @@ -789,7 +789,7 @@ get_applet_name()
local _shell_cmdline _gan_applet _gan_backup_ifs _gan_sep

case "${1}" in
'busybox' | 'osh')
'busybox' | 'oils')
if test -r "/proc/${$}/cmdline" && _shell_cmdline="$(tr -- '\n\0' ' \n' 0< "/proc/${$}/cmdline")" && test -n "${_shell_cmdline}"; then
_gan_sep="$(printf '\nx')" _gan_sep="${_gan_sep%x}"

Expand Down Expand Up @@ -1014,7 +1014,7 @@ list_available_shells()
fi
}

clean_env()
clear_env()
{
test "${prefer_included_utilities}" != '1' || unset ASH_STANDALONE
if test "${backup_posix}" = 'unset'; then unset POSIXLY_CORRECT; else POSIXLY_CORRECT="${backup_posix}"; fi
Expand Down Expand Up @@ -1170,7 +1170,7 @@ main()
shell_printf_bit="$(convert_max_unsigned_int_to_bit "${tmp_var}" || :)"

_max='-1'
# We hide the errors otherwise it will display an error on old Bash under Windows (or a ValueError on OSH) when an overflow occurs
# We hide the errors otherwise it will display an error on old Bash under Windows (or a ValueError on Oils) when an overflow occurs
for _num in ${limits_u}; do
if tmp_var="$(printf 2> /dev/null "%u\n" "${_num}")" && test "${tmp_var}" = "${_num}"; then
_max="${_num}"
Expand Down Expand Up @@ -1446,5 +1446,5 @@ if test "${execute_script}" = 'true'; then
if test "${backup_path}" = 'unset'; then unset PATH; else PATH="${backup_path}"; fi
fi

clean_env
clear_env
pause_if_needed "${STATUS}"
Binary file modified tools/win/busybox.exe
Binary file not shown.

0 comments on commit 49bac9b

Please sign in to comment.