Force local zsh emulation options

so the code is not broken by unexpected option changes, like

    setopt RC_EXPAND_PARAM

which breaks

    print -R 'fpath=('${${_zfpaths#${~zpre}}:A}' ${fpath})'

in the _zimfw_build_init function, for example.

See #444.
pull/450/head
Eric Nielsen 2 years ago
parent de685e8ef3
commit a5fb148ccf
No known key found for this signature in database
GPG Key ID: 47D1DBFA0765A1FB
  1. 1
      src/stage2/30_zmodule.zsh.erb
  2. 1
      src/stage2/40_zimfw_version_check.zsh.erb
  3. 2
      src/stage2/80_zimfw.zsh.erb
  4. 3
      src/templates/login_init.zsh.erb
  5. 3
      src/tools/degit.zsh.erb
  6. 1
      src/tools/git.zsh.erb
  7. 13
      zimfw.zsh

@ -50,7 +50,6 @@ Initialization options:
_zfailed=1
return 2
fi
setopt LOCAL_OPTIONS CASE_GLOB EXTENDED_GLOB
local zurl=${1} zmodule=${1:t} ztool zdir ztype zrev zarg
local -i zdisabled=0 zfrozen=0
local -a zfpaths zfunctions zcmds

@ -1,6 +1,5 @@
_zimfw_version_check() {
if (( _zprintlevel > 0 )); then
setopt LOCAL_OPTIONS EXTENDED_GLOB
local -r ztarget=${ZIM_HOME}/.latest_version
# If .latest_version does not exist or was not modified in the last 30 days
if [[ -w ${ztarget:h} && ! -f ${ztarget}(#qNm-30) ]]; then

@ -1,4 +1,6 @@
zimfw() {
builtin emulate -L zsh
setopt EXTENDED_GLOB
local -r _zversion='<%= version %>' zusage="Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
Actions:

@ -1,5 +1,6 @@
() {
setopt LOCAL_OPTIONS CASE_GLOB EXTENDED_GLOB
builtin emulate -L zsh
setopt EXTENDED_GLOB
autoload -Uz zrecompile
local zdumpfile zfile

@ -1,4 +1,6 @@
# This runs in a new shell
builtin emulate -L zsh
setopt EXTENDED_GLOB
readonly -i PRINTLEVEL=${1}
readonly ACTION=${2} MODULE=${3} DIR=${4} URL=${5} REV=${7} TEMP=.zdegit_${RANDOM}
readonly TARBALL_TARGET=${DIR}/${TEMP}_tarball.tar.gz INFO_TARGET=${DIR}/.zdegit
@ -19,7 +21,6 @@ print_okay() {
}
download_tarball() {
setopt LOCAL_OPTIONS EXTENDED_GLOB
local host repo
if [[ ${URL} =~ <%= url_regex %> ]]; then
host=${match[3]}

@ -1,4 +1,5 @@
# This runs in a new shell
builtin emulate -L zsh
readonly -i PRINTLEVEL=${1}
readonly ACTION=${2} MODULE=${3} DIR=${4} URL=${5} TYPE=${6:=branch} SUBMODULES=1
REV=${7}

@ -78,7 +78,8 @@ _zimfw_build_login_init() {
fi
_zimfw_mv =(
print -nR "() {
setopt LOCAL_OPTIONS CASE_GLOB EXTENDED_GLOB
builtin emulate -L zsh
setopt EXTENDED_GLOB
autoload -Uz zrecompile
local zdumpfile zfile
@ -160,7 +161,6 @@ Initialization options:
_zfailed=1
return 2
fi
setopt LOCAL_OPTIONS CASE_GLOB EXTENDED_GLOB
local zurl=${1} zmodule=${1:t} ztool zdir ztype zrev zarg
local -i zdisabled=0 zfrozen=0
local -a zfpaths zfunctions zcmds
@ -330,7 +330,6 @@ _zimfw_list_unuseds() {
_zimfw_version_check() {
if (( _zprintlevel > 0 )); then
setopt LOCAL_OPTIONS EXTENDED_GLOB
local -r ztarget=${ZIM_HOME}/.latest_version
# If .latest_version does not exist or was not modified in the last 30 days
if [[ -w ${ztarget:h} && ! -f ${ztarget}(#qNm-30) ]]; then
@ -373,7 +372,7 @@ _zimfw_compile() {
}
_zimfw_info() {
print -R 'zimfw version: '${_zversion}' (built at 2021-11-15 16:43:17 UTC, previous commit is e060934)'
print -R 'zimfw version: '${_zversion}' (built at 2021-11-21 19:26:56 UTC, previous commit is de685e8)'
print -R 'ZIM_HOME: '${ZIM_HOME}
print -R 'Zsh version: '${ZSH_VERSION}
print -R 'System info: '$(command uname -a)
@ -483,6 +482,8 @@ _zimfw_run_tool() {
local zcmd
case ${ztool} in
degit) zcmd="# This runs in a new shell
builtin emulate -L zsh
setopt EXTENDED_GLOB
readonly -i PRINTLEVEL=\${1}
readonly ACTION=\${2} MODULE=\${3} DIR=\${4} URL=\${5} REV=\${7} TEMP=.zdegit_\${RANDOM}
readonly TARBALL_TARGET=\${DIR}/\${TEMP}_tarball.tar.gz INFO_TARGET=\${DIR}/.zdegit
@ -503,7 +504,6 @@ print_okay() {
}
download_tarball() {
setopt LOCAL_OPTIONS EXTENDED_GLOB
local host repo
if [[ \${URL} =~ ^([^:@/]+://)?([^@]+@)?([^:/]+)[:/]([^/]+/[^/]+)/?\$ ]]; then
host=\${match[3]}
@ -625,6 +625,7 @@ case \${ACTION} in
esac
" ;;
git) zcmd="# This runs in a new shell
builtin emulate -L zsh
readonly -i PRINTLEVEL=\${1}
readonly ACTION=\${2} MODULE=\${3} DIR=\${4} URL=\${5} TYPE=\${6:=branch} SUBMODULES=1
REV=\${7}
@ -718,6 +719,8 @@ esac
}
zimfw() {
builtin emulate -L zsh
setopt EXTENDED_GLOB
local -r _zversion='1.6.2-SNAPSHOT' zusage="Usage: %B${0}%b <action> [%B-q%b|%B-v%b]
Actions:

Loading…
Cancel
Save