mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2026-09-10 07:36:38 -04:00
fix: gh-r logic ignores [36]86 assets (#235)
Changes:
- Reduce zunit verbosity with `--tap` flag
- `gh-r` tests now use `lbin` instead of `sbin`. `lbin` has smarter
logic when looking for executables to use in creating a shim
- Add gh-r tests for `rust-analyzer`, `docker-compose`, `neovim` binary &
appimage, and `kopia`
- Condense gh-r test logic to halve LOC (i.e., 1000+ -> ~500)
- Update gh-r logic to discard 32 bit binaries, improve 64 bit
selection, and linux-{gnu,musl} patterns
Closes #225, #246, #247
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
parent
5c70f5a4a7
commit
d60638f221
18
.github/workflows/delete-old-workflows.yml
vendored
18
.github/workflows/delete-old-workflows.yml
vendored
|
|
@ -1,18 +0,0 @@
|
|||
name: Delete old workflow runs
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
delete_old_runs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Delete old workflow runs
|
||||
uses: Mattraks/delete-workflow-runs@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
repository: ${{ github.repository }}
|
||||
retain_days: 14
|
||||
keep_minimum_runs: 50
|
||||
13
.github/workflows/documentation.yaml
vendored
13
.github/workflows/documentation.yaml
vendored
|
|
@ -4,30 +4,27 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'zinit*.zsh'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
zshelldoc:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: check out repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: generate zsd
|
||||
run: |
|
||||
make doc-container
|
||||
make doc/container
|
||||
sudo chown -R "$(id -u):$(id -g)" .
|
||||
|
||||
- name: check for out-of-date documentation
|
||||
run: |
|
||||
if git --no-pager diff --exit-code; then
|
||||
echo "zshelldocs are up to date"
|
||||
else
|
||||
echo "zshelldocs in the repo are not up to date"
|
||||
exit 1
|
||||
if ! git --no-pager diff --exit-code; then
|
||||
echo "::set-output zshelldocs are out-of-date, run 'make doc'"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ directories:
|
|||
tests: tests
|
||||
output: tests/_output
|
||||
support: tests/_support
|
||||
fail_fast: true
|
||||
fail_fast: false
|
||||
verbose: true
|
||||
|
|
|
|||
7
Makefile
7
Makefile
|
|
@ -1,13 +1,14 @@
|
|||
.EXPORT_ALL_VARIABLES:
|
||||
|
||||
ZSH := $(shell command -v zsh 2> /dev/null)
|
||||
SRC := zinit.zsh zinit-side.zsh zinit-install.zsh zinit-autoload.zsh
|
||||
SRC := zinit{'','-autoload','-install','-side'}.zsh
|
||||
# zinit.zsh zinit-side.zsh zinit-install.zsh zinit-autoload.zsh
|
||||
DOC_SRC := $(foreach wrd,$(SRC),../$(wrd))
|
||||
|
||||
zwc:
|
||||
$(or $(ZSH),:) -fc 'for f in *.zsh; do zcompile -R -- $$f.zwc $$f || exit; done'
|
||||
|
||||
doc-container:
|
||||
doc/container:
|
||||
./scripts/docker-run.sh --docs --debug
|
||||
|
||||
doc: clean
|
||||
|
|
@ -19,4 +20,4 @@ test:
|
|||
clean:
|
||||
rm -rvf *.zwc doc/zsdoc/zinit{'','-autoload','-install','-side'}.zsh.adoc doc/zsdoc/data/
|
||||
|
||||
.PHONY: all test clean doc doc-container
|
||||
.PHONY: all clean doc doc/container test
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ ____
|
|||
package. Connects to Github releases page.
|
||||
____
|
||||
|
||||
Has 110 line(s). Calls functions:
|
||||
Has 130 line(s). Calls functions:
|
||||
|
||||
.zinit-get-latest-gh-r-url-part
|
||||
`-- zinit.zsh/+zinit-message
|
||||
|
|
|
|||
|
|
@ -40,7 +40,10 @@ source $ZINIT[BIN_DIR]/zinit.zsh \
|
|||
# ]]]
|
||||
# Install Annexes [[[
|
||||
info 'installing test dependencies'
|
||||
zinit light-mode for zdharma-continuum/zinit-annex-{'bin-gem-node','default-ice'}
|
||||
# ver'fix/improve-lbin-logic' \
|
||||
zinit light-mode for \
|
||||
zdharma-continuum/zinit-annex-binary-symlink \
|
||||
zdharma-continuum/zinit-annex-{'bin-gem-node','default-ice'}
|
||||
# ]]]
|
||||
|
||||
# vim:ft=zsh:sw=2:sts=2:et:foldmarker=[[[,]]]:foldmethod=marker
|
||||
|
|
|
|||
894
tests/gh-r.zunit
894
tests/gh-r.zunit
File diff suppressed because it is too large
Load diff
|
|
@ -1440,19 +1440,18 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
|
|||
}
|
||||
|
||||
local -A matchstr
|
||||
# aarch64 '((arm|(^(amd|x86)))64|aarch64)*^*(amd|x86_64)'
|
||||
matchstr=(
|
||||
android '(apk|android)'
|
||||
amd64 '*((amd64|x86_64)|)*~*(aarch64|arm64|armv[0-9]|[-_]arm|[i-_]686)*'
|
||||
x86_64 '*((amd64|x86_64)|)*~*(aarch64|arm64|armv[0-9]|[-_]arm|[i-_]686)*'
|
||||
darwin '(darwin*|osx|mac|macos)*~*(386)*'
|
||||
linux-gnu '*((#s)|/)*linux(([-_](musl|gnu))?|musl|gnu|)*((#e)|/)*'
|
||||
linux-musl '*((#s)|/)*linux(([-_](musl))?|musl|)*((#e)|/)*'
|
||||
aarch64 '(arm64|aarch64|arm[v]?8)'
|
||||
arm64 '(arm64|aarch64|arm[v]?8)'
|
||||
armv5 'armv?5'
|
||||
armv6 'armv?6'
|
||||
armv7 'armv?7'
|
||||
android '(apk|android|linux-android)'
|
||||
amd64 '(amd64|x86_64|x64)'
|
||||
x86_64 '(amd64|x86_64|x64)'
|
||||
darwin '*((#s)|/)*(darwin|mac|macos|osx)*((#e)|/)*'
|
||||
linux-gnu '(linux|linux-gnu|linux-musl)'
|
||||
linux-musl '(linux|linux-musl)*~*linux-gnu*'
|
||||
aarch64 '(arm64|aarch64|arm[?v]8)'
|
||||
arm64 '(arm64|aarch64|arm[?v]8)'
|
||||
armv5 'arm[?v]5'
|
||||
armv6 'arm[?v]6'
|
||||
armv7 'armv[?v]7'
|
||||
cygwin '(cyg|-|_|)win(dows|32|64|))'
|
||||
msys '(cyg|-|_|)win(dows|32|64|))'
|
||||
windows '(cyg|-|_|)win(dows|32|64|))'
|
||||
|
|
@ -1473,35 +1472,31 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
|
|||
for bpick ( "${bpicks[@]}" ) {
|
||||
list=( $init_list )
|
||||
|
||||
if [[ -n $bpick ]] {
|
||||
list=( ${(M)list[@]:#(#i)*/$~bpick} )
|
||||
}
|
||||
if [[ -n $bpick ]] { list=( ${(M)list[@]:#(#i)*/$~bpick} ) }
|
||||
|
||||
list=( ${list[@]:#*(a(ccoutrements|ppimage.[a-z]*)|s(ha256sum|ig)|manifest|.sh|(sha1|md5)sums|sha256|md5|pkg|txt)(#e)} )
|
||||
|
||||
# filter .deb packages if dpkg-deb present
|
||||
if (( $#list < 1 && ${+commands[dpkg-deb]} == 1 )) {
|
||||
list2=( ${(M)list[@]:#*\.deb*} )
|
||||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
} else {
|
||||
list2=( ${list[@]:#*\.deb*} )
|
||||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
}
|
||||
|
||||
# filter .rpm packages if redhat package manager present
|
||||
if (( $#list < 1 && ${+commands[rpm]} == 1 )) {
|
||||
list2=( ${(M)list[@]:#*\.rpm*} )
|
||||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
} else {
|
||||
list2=( ${list[@]:#*\.rpm*} )
|
||||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
}
|
||||
# Remove artifacts that shouldn't be considered
|
||||
list=( ${list[@]:#*(a(ccoutrements|ppimage.[a-z]*)|[3-6]86*|manifest|(md5|sha1)sums|.s(ha256sum|ig)|.md5|.pkg|.sh|.sha256|.txt|.vsix)(#e)} )
|
||||
|
||||
# filter .apk packages if anbox present
|
||||
if (( $#list > 1 && ${+commands[anbox]} == 1 )) {
|
||||
+zinit-message "{pre}gh-r:{msg2} found {cmd}anbox{info2} -- looking for {obj}.apk{info2} packages {rst}"
|
||||
list2=( ${(M)list[@]:#(#i)*${~matchstr[android]}*} )
|
||||
} else { list2=( ${list[@]:#(#i)*${~matchstr[android]}*} ) }
|
||||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
|
||||
# filter .deb packages if dpkg-deb present
|
||||
if (( $#list > 1 && ${+commands[dpkg-deb]} == 1 )) {
|
||||
list2=( ${list[@]:#(#i)*(?64)*deb(#e)} )
|
||||
} else {
|
||||
list2=( ${list[@]:#(#i)*${~matchstr[android]}*} )
|
||||
list2=( ${list[@]:#*deb(#e)} )
|
||||
}
|
||||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
|
||||
# filter .rpm packages if redhat package manager present
|
||||
if (( $#list > 1 && ${+commands[rpm]} == 1 )) {
|
||||
list2=( ${list[@]:#(#i)*(?64)*rpm(#e)} )
|
||||
} else {
|
||||
list2=( ${list[@]:#*rpm(#e)} )
|
||||
}
|
||||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
|
||||
|
|
@ -1521,23 +1516,22 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
|
|||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
}
|
||||
|
||||
# filter urls by os (e.g., darwin, linux, windows)
|
||||
# filter urls by OS (e.g., darwin, linux, windows)
|
||||
if (( $#list > 1 )) {
|
||||
list2=( ${(M)list[@]:#(#i)*${~matchstr[${OSTYPE//[0-9.]/}]}*} )
|
||||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
}
|
||||
|
||||
# filter urls by newest (i.e., highest number)
|
||||
if (( $#list > 1 )) {
|
||||
list2=( ${list[@]:#(#i)*.(sha[[:digit:]]#|asc)} )
|
||||
(( $#list2 > 0 )) && list=( ${list2[@]} )
|
||||
}
|
||||
|
||||
if (( !$#list )) {
|
||||
+zinit-message -n "{error}Didn't find correct Github" \
|
||||
"release-file to download"
|
||||
+zinit-message -n "{pre}gh-r:{error} failed to find the correct GitHub release asset to download"
|
||||
if [[ -n $bpick ]] {
|
||||
+zinit-message -n ", try adapting {obj}bpick{error}-ICE" \
|
||||
"(the current bpick is{error}: {file}${bpick}{error})."
|
||||
+zinit-message -n ", modify {obj}bpick{error}-ICE (current bpick{error}: {file}${bpick}{error})."
|
||||
} else {
|
||||
+zinit-message -n .
|
||||
}
|
||||
|
|
@ -1547,7 +1541,7 @@ builtin source "${ZINIT[BIN_DIR]}/zinit-side.zsh" || {
|
|||
|
||||
reply+=( $list[1] )
|
||||
}
|
||||
[[ -n $reply ]] # testable
|
||||
[[ -n $reply ]]
|
||||
} # ]]]
|
||||
# FUNCTION: ziextract [[[
|
||||
# If the file is an archive, it is extracted by this function.
|
||||
|
|
|
|||
Loading…
Reference in a new issue