#!/bin/sh
set -e
if [ -d "$1" ]; then
./mpkg.sh $1
exit 0
fi
git clone "$2"
#rm -rf $1/.git
#rm -rf $1/keys
#echo $1 >> order
if ARCHLINE=$(grep "arch=" $1/PKGBUILD); then
if echo "$ARCHLINE" | grep -q armv7h; then
true
elif echo "$ARCHLINE" | grep -q any; then
true
else
sed -i -e "/^arch=/s/[)]/ \'armv7h\'\)/" $1/PKGBUILD
fi
fi
nano $1/PKGBUILD
echo "Enter to build, Ctrl-C to Abort."
read dummy
chown -R builder:builder $1
./mpkg.sh $1