ccextractor/package_creators/arch.sh

31 lines
797 B
Bash
Raw Normal View History

#!/bin/bash
2017-03-29 14:22:22 +00:00
./tarball.sh
retval=$?
if [ $retval -ne 0 ]; then
echo "Sorry, the package could not be created as the tarball building process failed with return code $retval"
rm -f ./*.tar.gz
exit $retval
fi
2017-03-29 14:22:22 +00:00
makepkg -g >> PKGBUILD
makepkg -sc
retval=$?
if [ $retval -ne 0 ]; then
2017-04-10 06:20:57 +00:00
echo "Sorry, the package could not be created as makepkg failed with return code $retval"
rm -rf ./*.tar.gz src
sed -i '$ d' PKGBUILD
exit $retval
fi
rm -f ./*.tar.gz
2017-03-29 14:22:22 +00:00
sed -i '$ d' PKGBUILD
read -p "Do you wish to install ccextractor? [y/N] " yn
case $yn in
[Yy]* ) if [ -x "$(command -v sudo)" ]; then
sudo pacman -U ./*.pkg.tar.xz;
else
su -c "pacman -U ./*.pkg.tar.xz";
fi
rm -f ./*.pkg.tar.xz;;
* ) exit;;
esac