1
1
Fork 0

zshrc: Several changes

* Make i a local variable
* Make flgrep more reliable
* Switch MorphOS cross-compiler to GCC 11
This commit is contained in:
Jonathan Schleifer 2022-10-22 20:17:10 +00:00
parent d92eb2cc0e
commit bb49c3b2e8

15
zshrc
View file

@ -67,6 +67,7 @@ compinit -C
zstyle ':completion:*' matcher-list 'm:{A-Z}={a-z} m:{a-z}={A-Z}' zstyle ':completion:*' matcher-list 'm:{A-Z}={a-z} m:{a-z}={A-Z}'
__has_command() { __has_command() {
local i
for i in $@; do for i in $@; do
which $i &>/dev/null && return 0 which $i &>/dev/null && return 0
done done
@ -263,7 +264,7 @@ if __has_command fossil; then
flgrep() { flgrep() {
local ret=1 local ret=1
fossil changes --all . | sed 's/^.* //' | while read file; do fossil changes --all . | awk '{print $2}' | while read file; do
grep -H "$@" "$file" && ret=0 grep -H "$@" "$file" && ret=0
[ $? -gt 1 ] && return $? [ $? -gt 1 ] && return $?
done done
@ -526,7 +527,7 @@ cross() {
export PATH="$prefix/cross/$cross_host/bin:$PATH" export PATH="$prefix/cross/$cross_host/bin:$PATH"
;; ;;
morphos) morphos)
local pkg="ppc-morphos-gcc-10" local pkg="ppc-morphos-gcc-11"
local prefix="$(pkg_info -qp $pkg 2>/dev/null | local prefix="$(pkg_info -qp $pkg 2>/dev/null |
awk '/^@cwd/ { print $2; exit }')" awk '/^@cwd/ { print $2; exit }')"
if [ -z "$prefix" ]; then if [ -z "$prefix" ]; then
@ -535,8 +536,8 @@ cross() {
fi fi
export PATH="$prefix/gg/bin:$PATH" export PATH="$prefix/gg/bin:$PATH"
export CC="ppc-morphos-gcc-10" export CC="ppc-morphos-gcc-11"
export CXX="ppc-morphos-g++-10" export CXX="ppc-morphos-g++-11"
export OBJC="$CC" export OBJC="$CC"
export OBJCXX="$CXX" export OBJCXX="$CXX"
export cross_host="ppc-morphos" export cross_host="ppc-morphos"
@ -546,14 +547,14 @@ cross() {
echo "Please set DEVKITPRO!" echo "Please set DEVKITPRO!"
return 1 return 1
fi fi
if [ -z "$DEVKITA64" ]; then if [ -z $"DEVKITA64" ]; then
echo "Please set DEVKITA64!" echo "Please set DEVKITA64!"
return 1 return 1
fi fi
export PATH="$DEVKITA64/bin:$DEVKITPRO/tools/bin:$PATH" export PATH="$DEVKITA64/bin:$PATH"
export cross_host="aarch64-none-elf" export cross_host="aarch64-none-elf"
export objfw_configure_flags="--with-nintendo-switch" export objfw_configure_flags="--with-$1"
;; ;;
wii | wii-u) wii | wii-u)
if [ -z "$DEVKITPRO" ]; then if [ -z "$DEVKITPRO" ]; then