2023-05-29 20:04:37 -05:00
|
|
|
#!/bin/env bash
|
|
|
|
|
|
|
|
# This is a script to update packages on AUR and LURE
|
|
|
|
# after I publish them.
|
|
|
|
|
|
|
|
# Syntax: update-aur-lure.sh <package-name> <new-version>
|
|
|
|
|
|
|
|
if [ "$#" -ne 2 ]; then
|
|
|
|
echo "Invalid syntax!"
|
|
|
|
echo "Use the following syntax: update-aur-lure.sh <package-name> <new-version>"
|
2023-07-23 18:13:10 -05:00
|
|
|
exit -1
|
2023-05-29 20:04:37 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
# xdg-user-dirs is used to get the directory for the repos
|
|
|
|
GIT_DIR=$(xdg-user-dir DOCUMENTS)/git
|
|
|
|
VERS="$2"
|
|
|
|
|
|
|
|
# Do the updates for AUR
|
|
|
|
echo "Updating AUR..."
|
2023-09-13 18:20:43 -05:00
|
|
|
cd "$GIT_DIR/AUR"
|
2023-05-29 20:04:37 -05:00
|
|
|
[ -d "$1" ] && PKG="$1" || PKG="$1-bin"
|
|
|
|
|
2023-09-13 18:20:43 -05:00
|
|
|
cd "$PKG"
|
2023-05-29 20:04:37 -05:00
|
|
|
sed -i -E "s/pkgver=[0-9\.]+/pkgver=$VERS/" PKGBUILD
|
|
|
|
updpkgsums
|
|
|
|
makepkg --printsrcinfo >.SRCINFO
|
|
|
|
|
|
|
|
# Remove downloaded files
|
2023-07-23 18:22:35 -05:00
|
|
|
ls | grep -v PKGBUILD | xargs -r -I {} rm "{}"
|
2023-05-29 20:04:37 -05:00
|
|
|
git add .
|
|
|
|
git commit -m "Bumped $PKG version to $VERS"
|
|
|
|
git push
|
|
|
|
|
|
|
|
# Update the GitHub backup repo as well
|
|
|
|
echo "Updating AUR backup repo..."
|
|
|
|
cd "$GIT_DIR/AUR Mirror GitHub/$PKG"
|
2023-07-25 01:51:56 -05:00
|
|
|
sed -i -E "s/pkgver=[0-9\.]+/pkgver=$VERS/" PKGBUILD
|
2023-05-29 20:04:37 -05:00
|
|
|
git add .
|
|
|
|
git commit -m "Bumped $PKG version to $VERS"
|
|
|
|
git push
|
|
|
|
|
|
|
|
# Do the updates for LURE
|
|
|
|
echo "Updating LURE repo..."
|
2023-09-13 18:20:43 -05:00
|
|
|
cd "$GIT_DIR/lure-repo"
|
2023-05-29 20:04:37 -05:00
|
|
|
[ -d "$1" ] && PKG="$1" || PKG="$1-bin"
|
2023-07-23 18:22:35 -05:00
|
|
|
cd "$PKG"
|
2023-07-25 01:51:56 -05:00
|
|
|
sed -i -E "s/version=[0-9\.]+/version=$VERS/" lure.sh
|
2023-05-29 20:04:37 -05:00
|
|
|
update-lure-checksums.py
|
|
|
|
|
|
|
|
# Remove downloaded files
|
2023-07-23 18:22:35 -05:00
|
|
|
ls | grep -v lure.sh | xargs -r -I {} rm "{}"
|
2023-05-29 20:04:37 -05:00
|
|
|
git add .
|
|
|
|
git commit -m "Bumped $PKG version to $VERS"
|
|
|
|
git push
|
|
|
|
|
|
|
|
echo "Done!"
|