Update with improvements

Now we use auracle instead of cower to serach packages and find AUR updates

We deleted the simplesearch and simplecheck scripts and the code was added to simpleaur script
This commit is contained in:
Eduard Tolosa 2018-12-25 16:50:25 -05:00
parent a85fa8d6ee
commit 85616efdfe
4 changed files with 27 additions and 23 deletions

View file

@ -1,5 +1,5 @@
# simpleaur # simpleaur
A script for install packages from AUR that doesn't require extra dependences, only requires git installed. cower is only needed if you want to run simplesearch for find package names/updates in AUR (recommended). simpleaur does NOT have automatic dependency resolution. It support PKGBUILDs download and other minor options (execute simpleaur -h). A script for install packages from AUR that doesn't require extra dependences, only requires git installed. auracle is only needed if you want to search package names/updates in AUR (recommended). simpleaur does NOT have automatic dependency resolution. It support PKGBUILDs download and other minor options (execute simpleaur -h).
# Instalation # Instalation
`git clone https://gitlab.com/edu4rdshl/simpleaur.git` `git clone https://gitlab.com/edu4rdshl/simpleaur.git`
@ -23,6 +23,8 @@ Usage:
--purge, -p Delete all compiled packages in /home/sechacklabs/.simpleaur/Build. --purge, -p Delete all compiled packages in /home/sechacklabs/.simpleaur/Build.
--download, -d Download all PKGBUILDS of packages passed as arguments in /home/sechacklabs/.simpleaur/pkgbuilds. --download, -d Download all PKGBUILDS of packages passed as arguments in /home/sechacklabs/.simpleaur/pkgbuilds.
--purgepkg, -pp Delete all downloaded PKGBUILDS in /home/sechacklabs/.simpleaur/pkgbuilds. --purgepkg, -pp Delete all downloaded PKGBUILDS in /home/sechacklabs/.simpleaur/pkgbuilds.
--search, -s Search for packages in AUR.
--check, -c Check available updates for packages installed from AUR.
``` ```
You are free to move the scripts to /usr/bin and then use it's from everywhere. If you are using ArchLinux, install the <b>simpleaur-git</b> package from the AUR. You are free to move the scripts to /usr/bin and then use it's from everywhere. If you are using ArchLinux, install the <b>simpleaur-git</b> package from the AUR.

View file

@ -3,6 +3,7 @@
basebuilddir="$HOME/.simpleaur/Build" basebuilddir="$HOME/.simpleaur/Build"
pkgdown="$HOME/.simpleaur/pkgbuilds" pkgdown="$HOME/.simpleaur/pkgbuilds"
lockfile="$basebuilddir/simpleaur.lock" lockfile="$basebuilddir/simpleaur.lock"
PKGDEST="$HOME/.simpleaur/Build/pkg"
# prefer terminal safe colored and bold text when tput is supported - /usr/share/makepkg/util/message.sh # prefer terminal safe colored and bold text when tput is supported - /usr/share/makepkg/util/message.sh
if tput setaf 0 &>/dev/null; then if tput setaf 0 &>/dev/null; then
@ -28,7 +29,9 @@ function usage(){
--help, -h Show it dialog. --help, -h Show it dialog.
--purge, -p Delete all compiled packages in $basebuilddir. --purge, -p Delete all compiled packages in $basebuilddir.
--download, -d Download all PKGBUILDS of packages passed as arguments in $pkgdown. --download, -d Download all PKGBUILDS of packages passed as arguments in $pkgdown.
--purgepkg, -pp Delete all downloaded PKGBUILDS in $pkgdown.${ALL_OFF}\n" --purgepkg, -pp Delete all downloaded PKGBUILDS in $pkgdown.
--search, -s Search for packages in AUR.
--check, -c Check available updates for packages installed from AUR.\n${ALL_OFF}"
} }
ctrl_c() { ctrl_c() {
@ -57,6 +60,7 @@ elif [ "$1" == "--purge" ] || [ "$1" == "-p" ]; then
elif [ "$1" == "--purgepkg" ] || [ "$1" == "-pp" ]; then elif [ "$1" == "--purgepkg" ] || [ "$1" == "-pp" ]; then
rm -rf "$pkgdown"/* rm -rf "$pkgdown"/*
exit exit
# The next 11 lines allow users to download PKGBUILDs from AUR # The next 11 lines allow users to download PKGBUILDs from AUR
elif [ "$1" == "--download" ] || [ "$1" == "-d" ]; then elif [ "$1" == "--download" ] || [ "$1" == "-d" ]; then
for pkgname in "${@:2}"; do for pkgname in "${@:2}"; do
@ -69,6 +73,25 @@ elif [ "$1" == "--download" ] || [ "$1" == "-d" ]; then
done done
printf "\n${GREEN}All done, leaving.${ALL_OFF}\n" printf "\n${GREEN}All done, leaving.${ALL_OFF}\n"
exit exit
# The following lines add support for search packages only if auracle is installed https://aur.archlinux.org/packages/auracle-git
elif [ "$1" == "--search" ] || [ "$1" == "-s" ]; then
if command -v auracle > /dev/null; then
auracle search "${@:2}"
else
printf "${RED}You need to install auracle ${YELLOW}(https://aur.archlinux.org/packages/auracle-git)${RED} to use it option. You can install it running in your terminal: simpleaur auracle-git or installing it manually.\n${ALL_OFF}"
fi
exit
# Lines for check package updates from AUR only if auracle is installed https://aur.archlinux.org/packages/auracle-git
elif [ "$1" == "--check" ] || [ "$1" == "-c" ]; then
if command -v auracle > /dev/null; then
printf '\e[1;32m%-6s\e[m\n' 'The following packages are availables for update, you can update them using: simpleaur package1 package2 package3'
auracle sync
else
printf "${RED}You need to install auracle ${YELLOW}(https://aur.archlinux.org/packages/auracle-git)${RED} to use it option. You can install it running in your terminal: simpleaur auracle-git or installing it manually.\n${ALL_OFF}"
fi
exit
else else
cd "$basebuilddir" || exit cd "$basebuilddir" || exit
fi fi

View file

@ -1,10 +0,0 @@
#!/usr/bin/bash
# Script for check package updates from AUR
cowerinstalled=$(command -v cower 2> /dev/null)
if [ -x "$cowerinstalled" ]; then
printf '\e[1;32m%-6s\e[m\n' 'The following packages are availables for update, you can update them using: simpleaur package1 package2 package3'
cower -u
else
printf '\e[1;31m%-6s\e[m\n' 'Please, install cower first running in your terminal: gpg --recv-keys 1EB2638FF56C0C53 && simpleaur cower'
fi

View file

@ -1,11 +0,0 @@
#!/usr/bin/bash
# Script for search packages from AUR
cowerinstalled=$(command -v cower 2> /dev/null)
spackage=( "$@" )
if [ ! -x "$cowerinstalled" ]; then
printf '\e[1;31m%-6s\e[m\n' 'Please, install cower first running in your terminal: gpg --recv-keys 1EB2638FF56C0C53 && simpleaur cower'
else
if [ "${#spackage[@]}" -ge 0 ]; then
cower -sc "${spackage[@]}"
fi
fi