diff --git a/CHANGELOG.md b/CHANGELOG.md index 02ed159..a81c079 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -_No unreleased changes._ +### Deprecated + +- The `zmodule check-dumpfile` action. The [completion] module alone will handle checking the + dumpfile. ## [1.11.2] - 2023-02-16 @@ -321,6 +324,7 @@ Take your time to review the updated [README.md] and the changes listed below. - `ZIM_HOME` is set in .zshenv instead of .zshrc. The issue was that the variable was not available in .zlogin in non-interactive login shells. +[completion]: https://github.com/zimfw/completion [README.md]: https://github.com/zimfw/zimfw/blob/master/README.md [environment]: https://github.com/zimfw/environment [input]: https://github.com/zimfw/input diff --git a/src/stage2/50_zimfw_check_dumpfile.zsh.erb b/src/stage2/50_zimfw_check_dumpfile.zsh.erb index 290f063..b422c41 100644 --- a/src/stage2/50_zimfw_check_dumpfile.zsh.erb +++ b/src/stage2/50_zimfw_check_dumpfile.zsh.erb @@ -1,21 +1,3 @@ _zimfw_check_dumpfile() { - local zdumpfile zfpath zline - zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=<%= home %>/.zcompdump - if [[ -e ${zdumpfile} ]]; then - if (( ${+_zim_dumpfile_fpath} )); then - local -r zcomps=(${^_zim_dumpfile_fpath}/^([^_]*|*~|*.zwc(|.old))(N:t)) - IFS=$' \t' read -rA zline < ${zdumpfile} || return 1 - if [[ ${zline[2]} -eq ${#zcomps} && ${zline[4]} == ${ZSH_VERSION} ]]; then - _zimfw_print -PR "<%= okay %>%B${zdumpfile}:%b Already up to date" - else - _zimfw_print -PR "<%= okay %>%B${zdumpfile}:%b New completion configuration needs to be dumped. Will do %Bclean-dumpfile%b." - _zimfw_clean_dumpfile - fi - else - _zimfw_print -u2 -PR "%F{yellow}<%= warn %>%B${zdumpfile}:%b Unable to check. This only works when the completion module is initialized." - fi - else - _zimfw_print -PR "<%= okay %>%B${zdumpfile}:%b Not found" - fi - _zimfw_print 'Done with check-dumpfile.' + _zimfw_print -u2 -PR '%F{yellow}<%= warn %>Deprecated action. This is now handled by the completion module alone.' } diff --git a/src/stage2/50_zimfw_clean_dumpfile.zsh.erb b/src/stage2/50_zimfw_clean_dumpfile.zsh.erb index 089d70a..c646f29 100644 --- a/src/stage2/50_zimfw_clean_dumpfile.zsh.erb +++ b/src/stage2/50_zimfw_clean_dumpfile.zsh.erb @@ -2,6 +2,6 @@ _zimfw_clean_dumpfile() { local zdumpfile zopt zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=<%= home %>/.zcompdump if (( _zprintlevel > 0 )) zopt=-v - command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old))(N) && \ + command rm -f ${zopt} ${zdumpfile}(|.dat|.zwc(|.old))(N) && \ _zimfw_print -P "<%= done %>Done with clean-dumpfile.${_zrestartmsg}" } diff --git a/src/stage2/80_zimfw.zsh.erb b/src/stage2/80_zimfw.zsh.erb index 896191f..f36a008 100644 --- a/src/stage2/80_zimfw.zsh.erb +++ b/src/stage2/80_zimfw.zsh.erb @@ -4,8 +4,7 @@ zimfw() { Actions: %Bbuild%b Build %B${ZIM_HOME}/init.zsh%b and %B${ZIM_HOME}/login_init.zsh%b. - Also does %Bcheck-dumpfile%b and %Bcompile%b. Use %B-v%b to also see their output. - %Bcheck-dumpfile%b Does %Bclean-dumpfile%b if new completion configuration needs to be dumped. + Also does %Bcompile%b. Use %B-v%b to also see its output. %Bclean%b Clean all. Does both %Bclean-compiled%b and %Bclean-dumpfile%b. %Bclean-compiled%b Clean Zsh compiled files. %Bclean-dumpfile%b Clean completion dumpfile. @@ -15,16 +14,16 @@ Actions: %Blist%b List all modules currently defined in %B${ZIM_CONFIG_FILE:-<%= home %>/.zimrc}%b. Use %B-v%b to also see the modules details. %Binit%b Same as %Binstall%b, but with output tailored to be used at terminal startup. - %Binstall%b Install new modules. Also does %Bbuild%b, %Bcheck-dumpfile%b and %Bcompile%b. Use %B-v%b to - also see their output, any on-pull output, and see skipped modules. + %Binstall%b Install new modules. Also does %Bbuild%b, %Bcompile%b. Use %B-v%b to also see their + output, any on-pull output and skipped modules. %Buninstall%b Delete unused modules. Prompts for confirmation. Use %B-q%b for quiet uninstall. - %Bupdate%b Update current modules. Also does %Bbuild%b, %Bcheck-dumpfile%b and %Bcompile%b. Use %B-v%b - to also see their output, any on-pull output, and see skipped modules. + %Bupdate%b Update current modules. Also does %Bbuild%b, %Bcompile%b. Use %B-v%b to also see their + output, any on-pull output and skipped modules. %Bupgrade%b Upgrade zimfw. Also does %Bcompile%b. Use %B-v%b to also see its output. %Bversion%b Print zimfw version. Options: - %B-q%b Quiet (yes to prompts, and only outputs errors) + %B-q%b Quiet (yes to prompts and only outputs errors) %B-v%b Verbose (outputs more details)" local -Ua _znames _zroot_dirs _zdisabled_root_dirs local -A _zfrozens _ztools _zdirs _zurls _ztypes _zrevs _zsubmodules _zonpulls _zifs @@ -53,9 +52,9 @@ Options: build) _zimfw_source_zimrc 2 && _zimfw_build || return 1 (( _zprintlevel-- )) - _zimfw_check_dumpfile && _zimfw_compile + _zimfw_compile ;; - check-dumpfile) _zimfw_source_zimrc 2 && _zimfw_check_dumpfile ;; + check-dumpfile) _zimfw_check_dumpfile ;; clean) _zimfw_source_zimrc 2 && _zimfw_clean_compiled && _zimfw_clean_dumpfile ;; clean-compiled) _zimfw_source_zimrc 2 && _zimfw_clean_compiled ;; clean-dumpfile) _zimfw_clean_dumpfile ;; @@ -71,13 +70,13 @@ Options: _zimfw_install_update install || return 1 (( _zprintlevel-- )) _zimfw_print -PR "<%= done %>Done with install.${_zrestartmsg}" # Only printed in verbose mode - _zimfw_source_zimrc 2 && _zimfw_build && _zimfw_check_dumpfile && _zimfw_compile + _zimfw_source_zimrc 2 && _zimfw_build && _zimfw_compile ;; install|update) _zimfw_install_update ${1} || return 1 _zimfw_print -PR "<%= done %>Done with ${1}.${_zrestartmsg}" (( _zprintlevel-- )) - _zimfw_source_zimrc 2 && _zimfw_build && _zimfw_check_dumpfile && _zimfw_compile + _zimfw_source_zimrc 2 && _zimfw_build && _zimfw_compile ;; uninstall) _zimfw_source_zimrc 2 && _zimfw_list_unuseds && _zimfw_uninstall ;; upgrade) diff --git a/src/zimfw.zsh.erb b/src/zimfw.zsh.erb index 93d1f75..144bd9f 100644 --- a/src/zimfw.zsh.erb +++ b/src/zimfw.zsh.erb @@ -4,7 +4,7 @@ class Zim :clear_line, :ellipsis, :okay, :warn, :error, :done, :failed def initialize - @version = "1.11.2" + @version = "1.11.3-SNAPSHOT" @home = "${ZDOTDIR:-${HOME}}" @min_zsh_version = "5.2" # Matches {ssh,http,https,git}://{user@,}host/org/repo and {user@,}host:org/repo diff --git a/zimfw.zsh b/zimfw.zsh index 40d6ecf..d1f8825 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -402,25 +402,7 @@ _zimfw_version_check() { } _zimfw_check_dumpfile() { - local zdumpfile zfpath zline - zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=${ZDOTDIR:-${HOME}}/.zcompdump - if [[ -e ${zdumpfile} ]]; then - if (( ${+_zim_dumpfile_fpath} )); then - local -r zcomps=(${^_zim_dumpfile_fpath}/^([^_]*|*~|*.zwc(|.old))(N:t)) - IFS=$' \t' read -rA zline < ${zdumpfile} || return 1 - if [[ ${zline[2]} -eq ${#zcomps} && ${zline[4]} == ${ZSH_VERSION} ]]; then - _zimfw_print -PR "%F{green})%f %B${zdumpfile}:%b Already up to date" - else - _zimfw_print -PR "%F{green})%f %B${zdumpfile}:%b New completion configuration needs to be dumped. Will do %Bclean-dumpfile%b." - _zimfw_clean_dumpfile - fi - else - _zimfw_print -u2 -PR "%F{yellow}! %B${zdumpfile}:%b Unable to check. This only works when the completion module is initialized." - fi - else - _zimfw_print -PR "%F{green})%f %B${zdumpfile}:%b Not found" - fi - _zimfw_print 'Done with check-dumpfile.' + _zimfw_print -u2 -PR '%F{yellow}! Deprecated action. This is now handled by the completion module alone.' } _zimfw_clean_compiled() { @@ -436,7 +418,7 @@ _zimfw_clean_dumpfile() { local zdumpfile zopt zstyle -s ':zim:completion' dumpfile 'zdumpfile' || zdumpfile=${ZDOTDIR:-${HOME}}/.zcompdump if (( _zprintlevel > 0 )) zopt=-v - command rm -f ${zopt} ${zdumpfile}(|.zwc(|.old))(N) && \ + command rm -f ${zopt} ${zdumpfile}(|.dat|.zwc(|.old))(N) && \ _zimfw_print -P "Done with clean-dumpfile.${_zrestartmsg}" } @@ -454,7 +436,7 @@ _zimfw_compile() { } _zimfw_info() { - print -R 'zimfw version: '${_zversion}' (built at 2023-02-16 12:53:12 UTC, previous commit is f71bff5)' + print -R 'zimfw version: '${_zversion}' (built at 2023-02-26 00:01:11 UTC, previous commit is fff151b)' print -R 'OSTYPE: '${OSTYPE} print -R 'TERM: '${TERM} print -R 'TERM_PROGRAM: '${TERM_PROGRAM} @@ -841,12 +823,11 @@ esac zimfw() { builtin emulate -L zsh -o EXTENDED_GLOB - local -r _zversion='1.11.2' zusage="Usage: %B${0}%b [%B-q%b|%B-v%b] + local -r _zversion='1.11.3-SNAPSHOT' zusage="Usage: %B${0}%b [%B-q%b|%B-v%b] Actions: %Bbuild%b Build %B${ZIM_HOME}/init.zsh%b and %B${ZIM_HOME}/login_init.zsh%b. - Also does %Bcheck-dumpfile%b and %Bcompile%b. Use %B-v%b to also see their output. - %Bcheck-dumpfile%b Does %Bclean-dumpfile%b if new completion configuration needs to be dumped. + Also does %Bcompile%b. Use %B-v%b to also see its output. %Bclean%b Clean all. Does both %Bclean-compiled%b and %Bclean-dumpfile%b. %Bclean-compiled%b Clean Zsh compiled files. %Bclean-dumpfile%b Clean completion dumpfile. @@ -856,16 +837,16 @@ Actions: %Blist%b List all modules currently defined in %B${ZIM_CONFIG_FILE:-${ZDOTDIR:-${HOME}}/.zimrc}%b. Use %B-v%b to also see the modules details. %Binit%b Same as %Binstall%b, but with output tailored to be used at terminal startup. - %Binstall%b Install new modules. Also does %Bbuild%b, %Bcheck-dumpfile%b and %Bcompile%b. Use %B-v%b to - also see their output, any on-pull output, and see skipped modules. + %Binstall%b Install new modules. Also does %Bbuild%b, %Bcompile%b. Use %B-v%b to also see their + output, any on-pull output and skipped modules. %Buninstall%b Delete unused modules. Prompts for confirmation. Use %B-q%b for quiet uninstall. - %Bupdate%b Update current modules. Also does %Bbuild%b, %Bcheck-dumpfile%b and %Bcompile%b. Use %B-v%b - to also see their output, any on-pull output, and see skipped modules. + %Bupdate%b Update current modules. Also does %Bbuild%b, %Bcompile%b. Use %B-v%b to also see their + output, any on-pull output and skipped modules. %Bupgrade%b Upgrade zimfw. Also does %Bcompile%b. Use %B-v%b to also see its output. %Bversion%b Print zimfw version. Options: - %B-q%b Quiet (yes to prompts, and only outputs errors) + %B-q%b Quiet (yes to prompts and only outputs errors) %B-v%b Verbose (outputs more details)" local -Ua _znames _zroot_dirs _zdisabled_root_dirs local -A _zfrozens _ztools _zdirs _zurls _ztypes _zrevs _zsubmodules _zonpulls _zifs @@ -894,9 +875,9 @@ Options: build) _zimfw_source_zimrc 2 && _zimfw_build || return 1 (( _zprintlevel-- )) - _zimfw_check_dumpfile && _zimfw_compile + _zimfw_compile ;; - check-dumpfile) _zimfw_source_zimrc 2 && _zimfw_check_dumpfile ;; + check-dumpfile) _zimfw_check_dumpfile ;; clean) _zimfw_source_zimrc 2 && _zimfw_clean_compiled && _zimfw_clean_dumpfile ;; clean-compiled) _zimfw_source_zimrc 2 && _zimfw_clean_compiled ;; clean-dumpfile) _zimfw_clean_dumpfile ;; @@ -912,13 +893,13 @@ Options: _zimfw_install_update install || return 1 (( _zprintlevel-- )) _zimfw_print -PR "Done with install.${_zrestartmsg}" # Only printed in verbose mode - _zimfw_source_zimrc 2 && _zimfw_build && _zimfw_check_dumpfile && _zimfw_compile + _zimfw_source_zimrc 2 && _zimfw_build && _zimfw_compile ;; install|update) _zimfw_install_update ${1} || return 1 _zimfw_print -PR "Done with ${1}.${_zrestartmsg}" (( _zprintlevel-- )) - _zimfw_source_zimrc 2 && _zimfw_build && _zimfw_check_dumpfile && _zimfw_compile + _zimfw_source_zimrc 2 && _zimfw_build && _zimfw_compile ;; uninstall) _zimfw_source_zimrc 2 && _zimfw_list_unuseds && _zimfw_uninstall ;; upgrade)