scripts(auto-update): use modified timestamt instead of pkg version

This commit is contained in:
MedzikUser 2022-05-18 21:05:19 +02:00
parent 3684f3315d
commit 452df72173
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
6 changed files with 16 additions and 7 deletions

9
.gitignore vendored
View File

@ -1,2 +1,11 @@
# IDE config
.vscode
# source files
*.tar*
*.zip
*.rar
*.7z
*.pacman
*.deb
*.AppImage

View File

@ -1,6 +1,6 @@
# package from AUR
AUR_NAME="" # e.g. "yay"
AUR_VERSION="" # e.g. "11.1.2-1"
AUR_UPDATED=""
# package from github
GITHUB_REPO="" # e.g. "MedzikUser/imgurs"

View File

@ -1,2 +1,2 @@
AUR_NAME="imgurs"
AUR_VERSION="0.7.2-1"
AUR_UPDATED="1649171291"

View File

@ -1,2 +1,2 @@
AUR_NAME="linux-xanmod"
AUR_VERSION="5.17.8-1"
AUR_UPDATED="1652685900"

View File

@ -10,7 +10,7 @@ SCRIPT_DIR="$(realpath "$(dirname "$0")")"
source "${SCRIPT_DIR}/lib/parse-conf.sh"
aur-version() {
curl --location --silent "https://aur.archlinux.org/rpc/?v=5&type=info&arg=${1}" | jq -r '.results[0].Version'
curl --location --silent "https://aur.archlinux.org/rpc/?v=5&type=info&arg=${1}" | jq -r '.results[0].LastModified'
}
gh-tag-version() {
@ -37,7 +37,7 @@ update-package() {
then
if [ -n "${AUR_NAME}" ]
then
local version="${AUR_VERSION}"
local version="${AUR_UPDATED}"
local latest_version="$(aur-version ${AUR_NAME})"
if [ "${version}" = "${latest_version}" ]
@ -45,7 +45,7 @@ update-package() {
return 0
fi
sed -i "s|^\(AUR_VERSION=\)\(.*\)\$|\1\"${latest_version}\"|g" "${pkgdir}/built.conf"
sed -i "s|^\(AUR_UPDATED=\)\(.*\)\$|\1\"${latest_version}\"|g" "${pkgdir}/built.conf"
if [ "${GIT_COMMIT_PACKAGES}" = "true" ]
then

View File

@ -4,7 +4,7 @@ parse-conf() {
. "${1}/built.conf"
echo "local AUR_NAME=${AUR_NAME}"
echo "local AUR_VERSION=${AUR_VERSION}"
echo "local AUR_UPDATED=${AUR_VERSION}"
echo "local GITHUB_REPO=${GITHUB_REPO}"
echo "local GITHUB_TAG=${GITHUB_TAG}"
echo "local NPM=${NPM}"