mirror of
https://github.com/edu4rdshl/simpleaur.git
synced 2026-07-17 23:24:46 +00:00
Only ask to remove previously compiled packages one time
This commit is contained in:
parent
e3a984eeea
commit
08ede2f134
1 changed files with 14 additions and 11 deletions
25
simpleaur
25
simpleaur
|
|
@ -75,24 +75,27 @@ for ipackage in "$@"; do
|
|||
cd "$ipackage"
|
||||
makepkg -srci
|
||||
if [ "$?" -eq 0 ]; then
|
||||
#Ask to the user if want to remove the directory created for git
|
||||
read -p "Remove build directory? [Y/n]? " yn
|
||||
#Take the answer from the user input and decide what to do.
|
||||
if [ "$yn" = "y" ]; then
|
||||
printf "\n\e[1;32m%-6s\e[m\n%s\n" "Info: Removing build directory..."
|
||||
rm -rf "$basebuilddir/$ipackage"
|
||||
else
|
||||
printf "\n\e[1;32m%-6s\e[m\n%s\n" "Info: Instalation completed."
|
||||
fi
|
||||
cd "$basebuilddir"
|
||||
continue
|
||||
else
|
||||
printf "\n\e[1;31m%-6s\e[m%s\n" "Info: Installation not completed."
|
||||
cd "$basebuilddir"
|
||||
fi
|
||||
cd "$basebuilddir"
|
||||
else
|
||||
printf "\n\e[1;31m%-6s\e[m%s\n" "Error: The PKGBUILD file for [ $ipackage ] does not exist, please check your internet connection and make sure that the AUR package name exists, you can use simplesearch for that."
|
||||
printf "\n\e[1;32m%-6s\e[m\n%s\n" "Info: Removing the failed build directory..."
|
||||
rm -rf "$basebuilddir/$ipackage"
|
||||
fi
|
||||
rm "$lockfile"
|
||||
done
|
||||
|
||||
#Ask to the user if want to remove the directory created for git
|
||||
read -p "Remove previously compiled packages? [Y/n]? " yn
|
||||
#Take the answer from the user input and decide what to do.
|
||||
if [ "$yn" = "y" ]; then
|
||||
printf "\n\e[1;32m%-6s\e[m\n%s\n" "Info: Removing build directory..."
|
||||
rm -rf "$basebuilddir/*"
|
||||
else
|
||||
printf "\n\e[1;32m%-6s\e[m\n%s\n" "Info: Instalation completed."
|
||||
fi
|
||||
rm -f "$lockfile"
|
||||
exit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue