Compare commits

..

1 Commits

Author SHA1 Message Date
5905357692 Updated pman to 1.2.0 2025-03-12 21:45:27 +01:00

17
push.sh
View File

@ -3,13 +3,13 @@
# Get version # Get version
oldver=$(grep "pkgver=" PKGBUILD | sed 's/pkgver="//;s/"//') oldver=$(grep "pkgver=" PKGBUILD | sed 's/pkgver="//;s/"//')
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
pkgver="${1}" pkgver="$1"
else else
echo "Old version: ${oldver}" echo "Old version: ${oldver}"
read -p "New version: " pkgver read -p "New version: " pkgver
fi fi
# Check version # Check version
# if [ "${pkgver}" = "${oldver}" ]; then # if [ "$pkgver" = "$oldver" ]; then
# echo >/dev/stderr "Error: same (old) version specified - update aborted" # echo >/dev/stderr "Error: same (old) version specified - update aborted"
# exit 1 # exit 1
# fi # fi
@ -17,7 +17,6 @@ fi
# Get variables from PKGBUILD # Get variables from PKGBUILD
url=$(grep "source=" PKGBUILD | sed 's/source=("//;s/")//') url=$(grep "source=" PKGBUILD | sed 's/source=("//;s/")//')
pkgname=$(grep "_pkgname=" PKGBUILD | sed 's/_pkgname="//;s/"//') pkgname=$(grep "_pkgname=" PKGBUILD | sed 's/_pkgname="//;s/"//')
pkgrel=$(grep "pkgrel=" PKGBUILD | sed 's/pkgrel="//;s/"//')
aur_url=$(grep "pkgname=" PKGBUILD | tail -n 1 | sed 's/pkgname="//;s/"//') aur_url=$(grep "pkgname=" PKGBUILD | tail -n 1 | sed 's/pkgname="//;s/"//')
# Perform variable substitution # Perform variable substitution
archive_url="${url//\$\{_pkgname\}/$pkgname}" archive_url="${url//\$\{_pkgname\}/$pkgname}"
@ -25,13 +24,13 @@ archive_url="${archive_url//\$\{pkgver\}/$pkgver}"
aur_url="ssh://aur@aur.archlinux.org/${aur_url//\$\{_pkgname\}/$pkgname}.git" aur_url="ssh://aur@aur.archlinux.org/${aur_url//\$\{_pkgname\}/$pkgname}.git"
# Download archive # Download archive
wget -O ${pkgname}.tar.gz "${archive_url}" wget -O $pkgname.tar.gz "$archive_url"
# Calculate checksums # Calculate checksums
sha1sum=$(sha1sum ${pkgname}.tar.gz | awk '{print $1}') sha1sum=$(sha1sum $pkgname.tar.gz | awk '{print $1}')
sha256sum=$(sha256sum ${pkgname}.tar.gz | awk '{print $1}') sha256sum=$(sha256sum $pkgname.tar.gz | awk '{print $1}')
md5sum=$(md5sum ${pkgname}.tar.gz | awk '{print $1}') md5sum=$(md5sum $pkgname.tar.gz | awk '{print $1}')
# Yoink the archive - unnecessary anymore # Yoink the archive - unnecessary anymore
rm -f ${pkgname}.tar.gz rm -f $pkgname.tar.gz
# Update PKGBUILD with new values # Update PKGBUILD with new values
sed -i -E "s/^pkgver=\"[^\"]+\"/pkgver=\"$pkgver\"/" PKGBUILD sed -i -E "s/^pkgver=\"[^\"]+\"/pkgver=\"$pkgver\"/" PKGBUILD
@ -44,7 +43,7 @@ makepkg --printsrcinfo > .SRCINFO
# In case of fire, git commit, git push, leave building # In case of fire, git commit, git push, leave building
git add . git add .
git commit -m "Updated ${pkgname} to ${pkgver}-${pkgrel}" git commit -m "Updated $pkgname to $pkgver"
git remote add aur ${aur_url} git remote add aur ${aur_url}
git push origin main git push origin main
git push aur main:master git push aur main:master