[pams] improve installation

This commit is contained in:
opfez 2021-08-17 16:02:53 +02:00
parent b1117f3578
commit e9ff6c7efc
2 changed files with 15 additions and 10 deletions

View File

25
pams
View File

@ -24,6 +24,17 @@ err_add_args() {
exit 1
}
audit() {
less "$aur"/"$1"/PKGBUILD
}
download() {
mkdir "$aur" 2>/dev/null
cd "$aur" || exit
echo downloading "$1"
git clone https://aur.archlinux.org/"$1".git 2>/dev/null
audit "$1"
}
# main program
@ -42,29 +53,23 @@ else
-a) if [ $# -ne 2 ]; then
err_add_args
else
less "$aur"/"$2"/PKGBUILD
audit "$2"
fi
;;
-d) if [ $# -ne 2 ]; then
err_add_args
else
originaldir="$(pwd)"
mkdir "$aur" 2>/dev/null
cd "$aur" || exit
git clone https://aur.archlinux.org/"$2".git
less "$aur"/"$2"/PKGBUILD
cd "$originaldir" || exit
download "$2"
fi
;;
-i) if [ $# -ne 2 ]; then
err_add_args
else
originaldir="$(pwd)"
cd "$aur"/"$2" || exit
cd "$aur"/"$2" 2>/dev/null || (echo "package not downloaded" && download "$2")
cd "$aur"/"$2"
makepkg -si
cd "$originaldir" || exit
fi
;;