From 8b3eba1d812b49a73d3acc927c770f49af6b913b Mon Sep 17 00:00:00 2001 From: askiiart Date: Wed, 26 Feb 2025 00:13:42 -0600 Subject: [PATCH] fix path, put rpm in repo, and skip if already updated --- polycat.spec | 2 ++ run.sh | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/polycat.spec b/polycat.spec index 49fe870..67be631 100644 --- a/polycat.spec +++ b/polycat.spec @@ -13,6 +13,8 @@ Requires: glibc A runcat module for polybar (or waybar) written in C++ %prep +mkdir ./polycat/ +cd ./polycat/ tar --zstd -xf ${COMPILED_DIR:-/compiled}/polycat/polycat.tar.zst %install diff --git a/run.sh b/run.sh index 9503cf8..4ce1f8a 100755 --- a/run.sh +++ b/run.sh @@ -1,12 +1,19 @@ #!/usr/bin/env bash set -euo pipefail +built_dir=${COMPILED_DIR:-/compiled}/polycat +version=$(cat $built_dir/version) +repo_dir=${REPO_DIR:-/repo} + +# skip if already up-to-date +if $(ls polycat-* | grep -q "$version"); then + echo "package is already up to date, exiting" + exit +fi + # prep dnf install fedora-packager rpmdevtools createrepo_c -y rpmdev-setuptree -built_dir=${COMPILED_DIR:-/compiled}/polycat -version=$(cat $built_dir/version) -repo_dir=${REPO_DIR:-/repo} # update spec file sed -i "s/Version:.*/Version: $version/g" polycat.spec @@ -15,8 +22,9 @@ sed -i "s/CHANGELOG_MESSAGE_HERE/Update to $version/g" polycat.spec sed -i "s/RPM_PACKAGER_NAME/$RPM_PACKAGER_NAME/g" polycat.spec sed -i "s/RPM_PACKAGER_EMAIL/$RPM_PACKAGER_EMAIL/g" polycat.spec -# build package +# build package and move to the repo rpmbuild -bb polycat.spec +mv ~/rpmbuild/RPMS/x86_64/polycat-$version-* $repo_dir/ # remove old versions cd $repo_dir