From 7199cd71feb12313f51b90028900b94ad8b3d3c3 Mon Sep 17 00:00:00 2001 From: yyykt <38282449+yyykt@users.noreply.github.com> Date: Sat, 5 Aug 2023 22:15:03 +0900 Subject: [PATCH 1/2] fix the permission issue with 'ziextract' when running it as root --- zinit-install.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zinit-install.zsh b/zinit-install.zsh index 9bb779b95..f99ffc9b8 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -1712,19 +1712,19 @@ ziextract() { →zinit-extract() { →zinit-check unrar "$file" || return 1; command unrar x "$file"; } ;; ((#i)*.tar.bz2|(#i)*.tbz|(#i)*.tbz2) - →zinit-extract() { →zinit-check bzip2 "$file" || return 1; command bzip2 -dc "$file" | command tar -xf -; } + →zinit-extract() { →zinit-check bzip2 "$file" || return 1; command bzip2 -dc "$file" | command tar --no-same-owner -xf -; } ;; ((#i)*.tar.gz|(#i)*.tgz) - →zinit-extract() { →zinit-check gzip "$file" || return 1; command gzip -dc "$file" | command tar -xf -; } + →zinit-extract() { →zinit-check gzip "$file" || return 1; command gzip -dc "$file" | command tar --no-same-owner -xf -; } ;; ((#i)*.tar.xz|(#i)*.txz) - →zinit-extract() { →zinit-check xz "$file" || return 1; command xz -dc "$file" | command tar -xf -; } + →zinit-extract() { →zinit-check xz "$file" || return 1; command xz -dc "$file" | command tar --no-same-owner -xf -; } ;; ((#i)*.tar.7z|(#i)*.t7z) - →zinit-extract() { →zinit-check 7z "$file" || return 1; command 7z x -so "$file" | command tar -xf -; } + →zinit-extract() { →zinit-check 7z "$file" || return 1; command 7z x -so "$file" | command tar --no-same-owner -xf -; } ;; ((#i)*.tar) - →zinit-extract() { →zinit-check tar "$file" || return 1; command tar -xf "$file"; } + →zinit-extract() { →zinit-check tar "$file" || return 1; command tar --no-same-owner -xf "$file"; } ;; ((#i)*.gz|(#i)*.gzip) if [[ $file != (#i)*.gz ]] { From 58a694ba166dad111cb3c9982bdb84d6fed5e4a6 Mon Sep 17 00:00:00 2001 From: vladislav doster <10052309+vladdoster@users.noreply.github.com> Date: Sat, 12 Aug 2023 07:10:17 -0500 Subject: [PATCH 2/2] 545 bug bad math expression in zinit plugins on ubuntu 2204wsl2 (#559) Co-authored-by: GitHub Actions --- doc/zsdoc/zinit-autoload.zsh.adoc | 2 +- doc/zsdoc/zinit.zsh.adoc | 2 +- tests/commands.zunit | 9 +++++++++ zinit-autoload.zsh | 10 +++++----- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/doc/zsdoc/zinit-autoload.zsh.adoc b/doc/zsdoc/zinit-autoload.zsh.adoc index f92ec7486..e4762f84c 100644 --- a/doc/zsdoc/zinit-autoload.zsh.adoc +++ b/doc/zsdoc/zinit-autoload.zsh.adoc @@ -842,7 +842,7 @@ ____ Has 21 line(s). Calls functions: .zinit-list-plugins - `-- zinit.zsh/+zinit-message + `-- zinit.zsh/+zi-log Uses feature(s): _setopt_ diff --git a/doc/zsdoc/zinit.zsh.adoc b/doc/zsdoc/zinit.zsh.adoc index e880a8ae6..0c8c55ac5 100644 --- a/doc/zsdoc/zinit.zsh.adoc +++ b/doc/zsdoc/zinit.zsh.adoc @@ -232,6 +232,7 @@ Called by: zinit-additional.zsh/.zinit-debug-status zinit-additional.zsh/.zinit-debug-stop zinit-additional.zsh/:zinit-tmp-subst-source + zinit-autoload.zsh/.zinit-list-plugins zinit-autoload.zsh/.zinit-unload ==== +zinit-deploy-message @@ -281,7 +282,6 @@ Called by: zinit-autoload.zsh/.zinit-confirm zinit-autoload.zsh/.zinit-delete zinit-autoload.zsh/.zinit-glance - zinit-autoload.zsh/.zinit-list-plugins zinit-autoload.zsh/.zinit-self-update zinit-autoload.zsh/.zinit-show-zstatus zinit-autoload.zsh/.zinit-uninstall-completions diff --git a/tests/commands.zunit b/tests/commands.zunit index 41041e55c..560794abf 100644 --- a/tests/commands.zunit +++ b/tests/commands.zunit @@ -10,6 +10,7 @@ @setup { ZBIN="${ZPFX}/bin" } + @test 'delete --help' { run zinit delete --help assert $output contains 'zinit delete [options] [plugins...]' @@ -35,4 +36,12 @@ assert $state equals 0 } +@test 'plugins' { + run zinit plugins + assert $output contains 'Plugins' + assert $output contains 'Unloaded: ' + assert $output contains 'Loaded: ' + assert $state equals 0 +} + # vim:ft=zsh:sw=2:sts=2:et:foldmarker={,}:foldmethod=marker diff --git a/zinit-autoload.zsh b/zinit-autoload.zsh index c78fb59fc..2b470afb0 100644 --- a/zinit-autoload.zsh +++ b/zinit-autoload.zsh @@ -1554,20 +1554,20 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}" keyword="${keyword## ##}" keyword="${keyword%% ##}" if [[ -n "$keyword" ]]; then - +zinit-message "{i} Installed plugins matching {info}$keyword{rst}:" + +zi-log "{i} Installed plugins matching {info}$keyword{rst}:" filtered=( "${(M)ZINIT[@]:#STATES__*$keyword*}" ) else filtered=(${${(M)${(k)ZINIT[@]}:##STATES__*}//[A-Z]*__/}) fi local i - +zinit-message '{m} {b}Plugins{rst}' + +zi-log '{m} {b}Plugins{rst}' for i in "${(o)filtered[@]}"; do [[ "$i" = "local/zinit" ]] && continue local is_loaded='{error}U' - (( "ZINIT[STATES__$i]" )) && is_loaded="{happy}L" - +zinit-message -C2 -- $is_loaded{rst} $i + (( ZINIT[STATES__${i}] )) && is_loaded="{happy}L" + +zi-log -C2 -- $is_loaded{rst} $i done - +zinit-message -- '{nl}Loaded: {happy}L{rst} | Unloaded: {error}U{rst}' + +zi-log -- '{nl}Loaded: {happy}L{rst} | Unloaded: {error}U{rst}' } # ]]] # FUNCTION: .zinit-list-snippets [[[ .zinit-list-snippets() {