1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-25 20:58:37 -06:00

new: Added update-aur-lure.sh

This commit is contained in:
Sayantan Santra 2023-05-29 20:04:37 -05:00
parent bb418302ca
commit f22aa445d7
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
2 changed files with 55 additions and 1 deletions

View file

@ -1,4 +1,4 @@
![Number of scripts](https://img.shields.io/badge/number_of_scripts-36-blue) ![Number of scripts](https://img.shields.io/badge/number_of_scripts-37-blue)
# Random Scripts # Random Scripts
This repository is for random scripts I wrote mostly for personal use. This repository is for random scripts I wrote mostly for personal use.

54
update-aur-lure.sh Normal file
View file

@ -0,0 +1,54 @@
#!/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>"
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..."
[ -d "$1" ] && PKG="$1" || PKG="$1-bin"
cd "$GIT_DIR/AUR/$PKG"
sed -i -E "s/pkgver=[0-9\.]+/pkgver=$VERS/" PKGBUILD
updpkgsums
makepkg --printsrcinfo >.SRCINFO
# Remove downloaded files
ls | grep -v PKGBUILD | xargs -r -I {} rm "{}"
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"
sed -i -E "s/pkgver=[0-9\.]+/pkgver=$VERS/" PKGBUILD
git add .
git commit -m "Bumped $PKG version to $VERS"
git push
# Do the updates for LURE
echo "Updating LURE repo..."
[ -d "$1" ] && PKG="$1" || PKG="$1-bin"
cd "$GIT_DIR/lure-repo/$PKG"
sed -i -E "s/pkgver=[0-9\.]+/pkgver=$VERS/" lure.sh
update-lure-checksums.py
# Remove downloaded files
ls | grep -v lure.sh | xargs -r -I {} rm "{}"
git add .
git commit -m "Bumped $PKG version to $VERS"
git push
echo "Done!"