45 lines
1.0 KiB
Bash
45 lines
1.0 KiB
Bash
#!/bin/bash
|
|
# Client version
|
|
VERSION=1.0.0
|
|
# $PKGCACHE is what zaura uses to determine where your packages will be stored.
|
|
PKGCACHE=~/.local/share/zaura_test_client
|
|
# Make sure that $PKGCACHE exists
|
|
mkdir -p "$PKGCACHE"
|
|
# Source the zaura library
|
|
source /usr/share/zaura/zaura
|
|
# $MAKEPKGARGS can be used to pass some arguments to makepkg.
|
|
# MAKEPKGARGS="--skipinteg --needed"
|
|
|
|
# Prints version of client and zaura
|
|
version(){
|
|
printf "test client version ${VERSION} - zaura ${ZAURA_VERSION}\n"
|
|
}
|
|
|
|
# Installs AUR packages by cloning and then installing
|
|
install(){
|
|
zaura.aur.clone $@
|
|
zaura.aur.install $@
|
|
}
|
|
|
|
# Makes zaura search the AUR and then caches the results into variables
|
|
search(){
|
|
zaura.aur.webrpc.search $1
|
|
}
|
|
|
|
# This function will be used by zaura to print search results.
|
|
zaura.aur.webrpc.search.print(){
|
|
printf "Package name: %s\n" "$zaura_webrpc_packageName"
|
|
}
|
|
|
|
# Update AUR packages in $PKGCACHE
|
|
update(){
|
|
zaura.aur.update
|
|
}
|
|
|
|
# Commands
|
|
case $1 in
|
|
-i) install ${@:2};;
|
|
-v) version ;;
|
|
-s) search $2 ;;
|
|
-u) update ;;
|
|
esac |