Add showebuild function
Show either installed, newest non-live or newest ebuild in less
This commit is contained in:
parent
6ad16cd497
commit
abf19647c7
9
.config/zsh/completions/_showebuild
Normal file
9
.config/zsh/completions/_showebuild
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#compdef showebuild
|
||||||
|
|
||||||
|
autoload -U _gentoo_packages
|
||||||
|
|
||||||
|
_arguments '*:package:_gentoo_packages available'
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# End:
|
20
.config/zsh/functions/showebuild
Executable file
20
.config/zsh/functions/showebuild
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
# Show either installed, newest non-live or newest ebuild
|
||||||
|
|
||||||
|
setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL
|
||||||
|
|
||||||
|
autoload -U die
|
||||||
|
[[ ${ARGC} -eq 0 ]] && die 1 "Usage: ${0} <PKG>"
|
||||||
|
|
||||||
|
local pkg=${1}
|
||||||
|
|
||||||
|
local ebuild=$(qwhich --vdb --latest ${pkg})
|
||||||
|
if [[ -z ${ebuild} ]]; then
|
||||||
|
for ebuild in $(qwhich --tree ${pkg} | sort --numeric-sort --reverse); do
|
||||||
|
[[ ${ebuild} =~ '9999(-r\d+)?\.ebuild$' ]] || break
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ -z ${ebuild} ]] && die 1 "Package not found"
|
||||||
|
|
||||||
|
less ${ebuild}
|
Loading…
Reference in New Issue
Block a user