1
0

zsh: openwrt-related goodies

listing archives with apk-tools 3.0.0_pre20250606 is PITA
This commit is contained in:
2025-07-08 12:15:36 +03:00
parent c58b27fe29
commit 3b6c18395b
2 changed files with 15 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
!/.config/zsh/alias/k8s.zsh
!/.config/zsh/alias/kconfig.zsh
!/.config/zsh/alias/ls.zsh
!/.config/zsh/alias/openwrt.zsh
!/.config/zsh/alias/quilt.zsh
!/.config/zsh/alias/sbuild.zsh
!/.config/zsh/alias/sudo.zsh

View File

@@ -0,0 +1,14 @@
#!/bin/zsh
openwrt-apk-list() {
local i w
w=$(mktemp -d) ; : "${w:?}"
for i ; do
[ -n "$i" ] || continue
find "$w/" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
find "$w/" -mindepth 1 -maxdepth 1 -exec rm -rf {} + || return
openwrt-apk extract --no-cache --no-logfile --no-network --no-check-certificate --allow-untrusted --no-chown --destination "$w" "$i"
env -C "$w" find ./ -mindepth 1 -exec ls -ldgG --color {} +
done
rm -rf "$w"
}