Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 84 lines (68 sloc) 2.15 KB
#!/usr/bin/env bash
pushd . >& /dev/null
cd /tmp
newpkgver="$1"
# Link of SHA1SUMS file
sha="ftp://ftp.mozilla.org/pub/firefox/releases/$newpkgver/SHA1SUMS"
curr_ver=`cower -i firefox-beta-bin | grep Version | awk 'BEGIN { FS = " : " } ; { print $2 }'`
echo "Current version: " $curr_ver
echo "Checking if new version exists..."
if [ -f SHA1SUMS ]; then rm SHA1SUMS; fi
wget $sha >& /dev/null
if [ -f SHA1SUMS ]; then
echo "Version $newpkgver exists. Starting build process."
echo "Dowloading firefox-beta-bin from AUR..."
cower -df firefox-beta-bin -t /tmp
cd /tmp/firefox-beta-bin
cp /tmp/SHA1SUMS .
echo 'Striping SHA1SUM from downloaded file...'
newsha64=`grep -w "linux-x86_64/en-US/firefox-$newpkgver.tar.bz2" SHA1SUMS | awk 'NR==1{print $1}'`
newsha32=`grep -w "linux-i686/en-US/firefox-$newpkgver.tar.bz2" SHA1SUMS | awk 'NR==1{print $1}'`
echo 'Append old SHA1SUMS to variables...'
oldsha64=`grep sha1sums PKGBUILD | head -n1 | cut -c 12-51`
oldsha32=`grep sha1sums PKGBUILD | tail -n1 | cut -c 42-81`
# Old package version
oldpkgver=`grep pkgver PKGBUILD | head -n1 | cut -c 8-13`
echo $oldpkgver
echo "Changing pkgver..."
sed -i "s/$oldpkgver/$newpkgver/" PKGBUILD
echo "# old pkgver: $oldpkgver"
echo "# new pkgver: $newpkgver "
sleep 1
echo
echo "Changing x86_64 sha1sums..."
sed -i "s/$oldsha64/$newsha64/" PKGBUILD
echo "# old sha1sum firefox-x86_64: $oldsha64 "
echo "# new sha1sum firefox-x86_64: $newsha64 "
sleep 1
echo
echo "Changing i686 sha1sums..."
sed -i "s/$oldsha32/$newsha32/" PKGBUILD
echo "# old sha1sum firefox-i686: $oldsha32 "
echo "# new sha1sum firefox-i686: $newsha32 "
sleep 1
echo
echo "Making source package..."
makepkg -f --source
source PKGBUILD
echo
echo "Uploading to AUR in 5 ..."
sleep 1
echo "Uploading to AUR in 4 ..."
sleep 1
echo "Uploading to AUR in 3 ..."
sleep 1
echo "Uploading to AUR in 2 ..."
sleep 1
echo "Uploading to AUR in 1 ..."
sleep 1
burp $(echo ${pkgname}-${newpkgver}-${pkgrel}.src.tar.gz)
echo
echo "Upload complete."
echo "Removing firefox-beta-bin folder"
rm -r /tmp/firefox-beta-bin
popd >& /dev/null
sleep 1
else
echo "Version $newpkgver does not exist or you already have the latest build."
fi # end of first if