From b23d395ffd9b960922eac088f684f922008b6f61 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 12:56:51 -0600 Subject: [PATCH 01/26] initial commit --- README.md | 19 +++++++++++++++++++ compilation.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 README.md create mode 100755 compilation.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..29a2640 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# Polycat build + +- Builds polycat and places it in `$COMPILED_DIR/polycat/polycat.tar.zst` +- Version file at `$COMPILED_DIR/polycat/version` + +## Archive details + +``` +. +├── polycat +└── polycat.ttf +``` + +Recommended: + +| File | Location | Permissions | +| --------------- | -------------------------------------- | ----------- | +| `./polycat` | `/usr/bin/polycat` | 755 | +| `./polycat.ttf` | `/usr/share/fonts/polycat/polycat.ttf` | 644 | diff --git a/compilation.sh b/compilation.sh new file mode 100755 index 0000000..f5cc296 --- /dev/null +++ b/compilation.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -euo pipefail + +# prep +dnf install git cmake g++ -y +workdir=$(mktemp -d) +built_dir=${COMPILED_DIR:-/compiled}/polycat +mkdir -p $built_dir +version_file=$built_dir/version +touch $version_file + +# clone and check whether it's up-to-date +cd $workdir +git clone --recursive https://github.com/2IMT/polycat.git --depth 1 --shallow-submodules +cd ./polycat/ +# check version +version=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)") +if grep -q $version $version_file; then + echo "already up to date, exiting" + exit +fi + +# compilation +cd $workdir/polycat/ +cmake -DCMAKE_BUILD_TYPE=RELEASE . +cmake --build . + +# build .tar.zst archive +cd $workdir +mkdir ./polycat-built +mv ./polycat/polycat ./polycat-built/ +mv ./polycat/res/polycat.ttf ./polycat-built/ +mkdir -p ${COMPILED_DIR:-/compiled}/polycat/ +cd $workdir/polycat-built/ +tar --zstd -cf $built_dir/polycat.tar.zst . +echo $version >$version_file + +echo "polycat updated to $version" From 42c6e183cae29bb208c63cd71de76bf052148b2c Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 13:05:08 -0600 Subject: [PATCH 02/26] fix version being incorrect --- compilation.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compilation.sh b/compilation.sh index f5cc296..723692f 100755 --- a/compilation.sh +++ b/compilation.sh @@ -11,7 +11,7 @@ touch $version_file # clone and check whether it's up-to-date cd $workdir -git clone --recursive https://github.com/2IMT/polycat.git --depth 1 --shallow-submodules +git clone https://github.com/2IMT/polycat.git cd ./polycat/ # check version version=$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)") @@ -19,6 +19,9 @@ if grep -q $version $version_file; then echo "already up to date, exiting" exit fi +# get the submodules since it needs to be updated +git submodule update --init --depth 1 + # compilation cd $workdir/polycat/ From d33c8ee9700dc4365168145622754a627b8fd511 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 13:29:50 -0600 Subject: [PATCH 03/26] add drone config --- .drone.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..fb86308 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +kind: pipeline +type: docker +name: default + +steps: + - name: Build polycat + image: fedora + commands: + - '/drone/src/compilation.sh' + volumes: + - name: program-archives + path: /program-archives + +volumes: + - name: program-archives + host: + path: /mnt/user/files/repos/archives From b8f2b6ffcfd2cfa3ce416c9ede7c9b99c1a8f743 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 13:34:29 -0600 Subject: [PATCH 04/26] tad more efficient now --- compilation.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compilation.sh b/compilation.sh index 723692f..2f45d00 100755 --- a/compilation.sh +++ b/compilation.sh @@ -2,7 +2,7 @@ set -euo pipefail # prep -dnf install git cmake g++ -y +dnf install git -y workdir=$(mktemp -d) built_dir=${COMPILED_DIR:-/compiled}/polycat mkdir -p $built_dir @@ -19,7 +19,9 @@ if grep -q $version $version_file; then echo "already up to date, exiting" exit fi -# get the submodules since it needs to be updated +# get build deps +cmake g++ +# get submodules git submodule update --init --depth 1 From acad61f9006887162d7edaf2579db6c666b2d536 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 13:37:20 -0600 Subject: [PATCH 05/26] fix volume --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index fb86308..b59e87f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,7 +9,7 @@ steps: - '/drone/src/compilation.sh' volumes: - name: program-archives - path: /program-archives + path: /compiled volumes: - name: program-archives From 0cdf04d1d9b47416002d446378b1dd2fd8aa1e34 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 13:38:55 -0600 Subject: [PATCH 06/26] i cant type lol --- compilation.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compilation.sh b/compilation.sh index 2f45d00..26fabcf 100755 --- a/compilation.sh +++ b/compilation.sh @@ -20,7 +20,7 @@ if grep -q $version $version_file; then exit fi # get build deps -cmake g++ +dnf install cmake g++ -y # get submodules git submodule update --init --depth 1 From d75df22d8c3909fa2b7cea09dee298e1429f3610 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 20:19:59 -0600 Subject: [PATCH 07/26] initial commit --- README.md | 7 +++++++ polycat.spec | 31 +++++++++++++++++++++++++++++++ run.sh | 25 +++++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 README.md create mode 100644 polycat.spec create mode 100755 run.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..b5cb264 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Polycat (fedora) + +TODO: Add proper changelog updates + +## Environment variables + +**REQUIRED**: RPM packager name (`RPM_PACKAGER_NAME`), RPM packager email (`RPM_PACKAGER_EMAIL`) \ No newline at end of file diff --git a/polycat.spec b/polycat.spec new file mode 100644 index 0000000..97c3564 --- /dev/null +++ b/polycat.spec @@ -0,0 +1,31 @@ +Name: polycat +Version: r93.0c836d5 +Release: %autorelease +Summary: runcat module for polybar (or waybar) + +License: MIT +URL: https://github.com/2IMT/polycat + +BuildRequires: tar +Requires: glibc + +%description +A runcat module for polybar (or waybar) written in C++ + +%prep +tar --zstd -xf ${COMPILED_DIR:-/compiled}/polycat/polycat.tar.gz + +%install +cd ./polycat/ +mkdir -p %{buildroot}%{_bindir} +install -Dm755 ./polycat %{buildroot}%{_bindir}/polycat +mkdir -p %{buildroot}%{datadir}/fonts/polycat/ +install -Dm644 ./polycat.ttf %{buildroot}%{_datadir}/fonts/polycat/polycat.ttf + +%files +%{_bindir}/polycat +%{_datadir}/fonts/polycat/polycat.ttf + +%changelog +* DATE_HERE RPM_PACKAGER_NAME <RPM_PACKAGER_EMAIL> +- CHANGELOG_MESSAGE_HERE diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..be1dda8 --- /dev/null +++ b/run.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -euo pipefail + +# prep +dnf install fedora-packager rpmdevtools -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 +sed -i "s/DATE_HERE/$(date '+%a %b %d %Y')/g" polycat.spec +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 +rpmbuild -bb polycat.spec + +# remove old versions +cd $repo_dir +rm $(ls polycat-*.rpm | sort --version-sort | sed '$d') + +echo "package is at $repo_dir/$(ls polycat-*.rpm)" From 574b24911859709bae10b128462fe1b8649dd768 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 20:22:15 -0600 Subject: [PATCH 08/26] add drone config --- .drone.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..44d8dfc --- /dev/null +++ b/.drone.yml @@ -0,0 +1,21 @@ +kind: pipeline +type: docker +name: default + +environment: + RPM_PACKAGER_NAME: "askiiart" + RPM_PACKAGER_EMAIL: "rpm@askiiart.net" + +steps: + - name: Build polycat fedora package + image: fedora + commands: + - '/drone/src/run.sh' + volumes: + - name: fedora-repo + path: /repo + +volumes: + - name: program-archives + host: + path: /mnt/user/files/repos/fedora/ \ No newline at end of file From df6a1ae6816d9d9d0b54fd009ca1f19f8d706cc9 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 20:23:28 -0600 Subject: [PATCH 09/26] chore: format --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 44d8dfc..9cca8ae 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,8 +3,8 @@ type: docker name: default environment: - RPM_PACKAGER_NAME: "askiiart" - RPM_PACKAGER_EMAIL: "rpm@askiiart.net" + RPM_PACKAGER_NAME: 'askiiart' + RPM_PACKAGER_EMAIL: 'rpm@askiiart.net' steps: - name: Build polycat fedora package @@ -18,4 +18,4 @@ steps: volumes: - name: program-archives host: - path: /mnt/user/files/repos/fedora/ \ No newline at end of file + path: /mnt/user/files/repos/fedora/ From d72fdd8007ff5aceff659473c1179dddbb399a9a Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 20:36:05 -0600 Subject: [PATCH 10/26] fix volumes --- .drone.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.drone.yml b/.drone.yml index 9cca8ae..5789213 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,10 +12,15 @@ steps: commands: - '/drone/src/run.sh' volumes: + - name: program-archives + path: /compiled - name: fedora-repo path: /repo volumes: - name: program-archives + host: + path: /mnt/user/files/repos/archives + - name: fedora-repo host: path: /mnt/user/files/repos/fedora/ From a9457504e60f4cd55ef348d44ff357260dfa5653 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 23:47:25 -0600 Subject: [PATCH 11/26] fix wrong file [extension] --- polycat.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polycat.spec b/polycat.spec index 97c3564..49fe870 100644 --- a/polycat.spec +++ b/polycat.spec @@ -13,7 +13,7 @@ Requires: glibc A runcat module for polybar (or waybar) written in C++ %prep -tar --zstd -xf ${COMPILED_DIR:-/compiled}/polycat/polycat.tar.gz +tar --zstd -xf ${COMPILED_DIR:-/compiled}/polycat/polycat.tar.zst %install cd ./polycat/ From 9ced8304caebc8c5ee10887f1f0874f257ebab42 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 23:49:46 -0600 Subject: [PATCH 12/26] update repo and fix repo path --- .drone.yml | 4 ++-- run.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5789213..67c6edd 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,7 +20,7 @@ steps: volumes: - name: program-archives host: - path: /mnt/user/files/repos/archives + path: /mnt/user/files/repos/archives/ - name: fedora-repo host: - path: /mnt/user/files/repos/fedora/ + path: /mnt/user/files/repos/fedora/x86_64/ diff --git a/run.sh b/run.sh index be1dda8..9503cf8 100755 --- a/run.sh +++ b/run.sh @@ -2,7 +2,7 @@ set -euo pipefail # prep -dnf install fedora-packager rpmdevtools -y +dnf install fedora-packager rpmdevtools createrepo_c -y rpmdev-setuptree built_dir=${COMPILED_DIR:-/compiled}/polycat version=$(cat $built_dir/version) @@ -22,4 +22,7 @@ rpmbuild -bb polycat.spec cd $repo_dir rm $(ls polycat-*.rpm | sort --version-sort | sed '$d') +# update repo +createrepo_c . + echo "package is at $repo_dir/$(ls polycat-*.rpm)" From d32a943e478ec4df452347edf3b9fb14132f9a8f Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Tue, 25 Feb 2025 23:53:11 -0600 Subject: [PATCH 13/26] update readme --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b5cb264..d263f91 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,7 @@ TODO: Add proper changelog updates ## Environment variables -**REQUIRED**: RPM packager name (`RPM_PACKAGER_NAME`), RPM packager email (`RPM_PACKAGER_EMAIL`) \ No newline at end of file +**REQUIRED** + +- RPM packager name - `RPM_PACKAGER_NAME` +- RPM packager email - `RPM_PACKAGER_EMAIL` From 8b3eba1d812b49a73d3acc927c770f49af6b913b Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Wed, 26 Feb 2025 00:13:42 -0600 Subject: [PATCH 14/26] 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 From 08ab65f488f6bb77b8b5da4b55426ad7efe1b31d Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Wed, 26 Feb 2025 00:19:41 -0600 Subject: [PATCH 15/26] this might work --- run.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 4ce1f8a..bd4296f 100755 --- a/run.sh +++ b/run.sh @@ -6,10 +6,14 @@ version=$(cat $built_dir/version) repo_dir=${REPO_DIR:-/repo} # skip if already up-to-date -if $(ls polycat-* | grep -q "$version"); then +# this is the easiest way to make sure it doesn't just fail because no polycat-* exists +touch polycat-tmp +if $(ls $repo_dir/polycat-* | grep -q "$version"); then + rm polycat-tmp echo "package is already up to date, exiting" exit fi +rm polycat-tmp # prep dnf install fedora-packager rpmdevtools createrepo_c -y From 02bd17a94ac357cebe94c9bab80e27059b893e69 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Wed, 26 Feb 2025 00:22:02 -0600 Subject: [PATCH 16/26] Revert "this might work" This reverts commit 08ab65f488f6bb77b8b5da4b55426ad7efe1b31d. --- run.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/run.sh b/run.sh index bd4296f..4ce1f8a 100755 --- a/run.sh +++ b/run.sh @@ -6,14 +6,10 @@ version=$(cat $built_dir/version) repo_dir=${REPO_DIR:-/repo} # skip if already up-to-date -# this is the easiest way to make sure it doesn't just fail because no polycat-* exists -touch polycat-tmp -if $(ls $repo_dir/polycat-* | grep -q "$version"); then - rm polycat-tmp +if $(ls polycat-* | grep -q "$version"); then echo "package is already up to date, exiting" exit fi -rm polycat-tmp # prep dnf install fedora-packager rpmdevtools createrepo_c -y From d657ed2f42429aba0a600b33c0748060af36f11c Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Wed, 26 Feb 2025 00:28:05 -0600 Subject: [PATCH 17/26] add tmp file to make it not fail this is bad lol --- run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/run.sh b/run.sh index 4ce1f8a..5a4bd1e 100755 --- a/run.sh +++ b/run.sh @@ -28,7 +28,11 @@ mv ~/rpmbuild/RPMS/x86_64/polycat-$version-* $repo_dir/ # remove old versions cd $repo_dir +# this is the easiest way to make sure it doesn't just fail because no polycat-* exists +# (which only happens on first run) +touch polycat-tmp.rpm rm $(ls polycat-*.rpm | sort --version-sort | sed '$d') +rm polycat-tmp.rpm # update repo createrepo_c . From 736420f6b1b98df82985901f1b97d4a42aaeda6f Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Wed, 26 Feb 2025 00:31:29 -0600 Subject: [PATCH 18/26] add todo --- run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/run.sh b/run.sh index 5a4bd1e..0c60b21 100755 --- a/run.sh +++ b/run.sh @@ -6,6 +6,7 @@ version=$(cat $built_dir/version) repo_dir=${REPO_DIR:-/repo} # skip if already up-to-date +# TODO: use the repo instead and check the version with dnf if $(ls polycat-* | grep -q "$version"); then echo "package is already up to date, exiting" exit From 8aef7b88862d1d55ff17448c222cc4f5242cec92 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Wed, 26 Feb 2025 00:38:59 -0600 Subject: [PATCH 19/26] testttt --- run.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index 0c60b21..c814e9c 100755 --- a/run.sh +++ b/run.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -euo pipefail +set -euxo pipefail built_dir=${COMPILED_DIR:-/compiled}/polycat version=$(cat $built_dir/version) @@ -27,6 +27,8 @@ sed -i "s/RPM_PACKAGER_EMAIL/$RPM_PACKAGER_EMAIL/g" polycat.spec rpmbuild -bb polycat.spec mv ~/rpmbuild/RPMS/x86_64/polycat-$version-* $repo_dir/ +ls ~/rpmbuild/RPMS/x86_64/ +exit # remove old versions cd $repo_dir # this is the easiest way to make sure it doesn't just fail because no polycat-* exists @@ -38,4 +40,4 @@ rm polycat-tmp.rpm # update repo createrepo_c . -echo "package is at $repo_dir/$(ls polycat-*.rpm)" +echo "package is at $repo_dir/$(ls $repo_dir/polycat-*.rpm)" From e2bdbd91587c2f690afe9e24ec5c66ae7e1543c3 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Wed, 26 Feb 2025 00:47:05 -0600 Subject: [PATCH 20/26] fix... stuff idek anymore --- run.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/run.sh b/run.sh index c814e9c..df42ff7 100755 --- a/run.sh +++ b/run.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -euxo pipefail +set -euo pipefail built_dir=${COMPILED_DIR:-/compiled}/polycat version=$(cat $built_dir/version) @@ -27,15 +27,13 @@ sed -i "s/RPM_PACKAGER_EMAIL/$RPM_PACKAGER_EMAIL/g" polycat.spec rpmbuild -bb polycat.spec mv ~/rpmbuild/RPMS/x86_64/polycat-$version-* $repo_dir/ -ls ~/rpmbuild/RPMS/x86_64/ -exit # remove old versions cd $repo_dir # this is the easiest way to make sure it doesn't just fail because no polycat-* exists # (which only happens on first run) -touch polycat-tmp.rpm +touch polycat-aaaaaa.rpm rm $(ls polycat-*.rpm | sort --version-sort | sed '$d') -rm polycat-tmp.rpm +rm polycat-aaaaaa.rpm # update repo createrepo_c . From 895e8345a84ac2c9a57757c4eb11b2d78425990e Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Wed, 26 Feb 2025 00:49:04 -0600 Subject: [PATCH 21/26] fix wildcard failing --- run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/run.sh b/run.sh index df42ff7..d50b070 100755 --- a/run.sh +++ b/run.sh @@ -7,10 +7,14 @@ repo_dir=${REPO_DIR:-/repo} # skip if already up-to-date # TODO: use the repo instead and check the version with dnf +# yeah this is bad; see also the polycat-aaaaaa thing below +touch polycat-tmp if $(ls polycat-* | grep -q "$version"); then + rm polycat-tmp echo "package is already up to date, exiting" exit fi +rm polycat-tmp # prep dnf install fedora-packager rpmdevtools createrepo_c -y From d79ff88d3337a379a528675da6a20e51b68726d9 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Wed, 26 Feb 2025 00:50:46 -0600 Subject: [PATCH 22/26] oops wrong path --- run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.sh b/run.sh index d50b070..c88d294 100755 --- a/run.sh +++ b/run.sh @@ -9,7 +9,7 @@ repo_dir=${REPO_DIR:-/repo} # TODO: use the repo instead and check the version with dnf # yeah this is bad; see also the polycat-aaaaaa thing below touch polycat-tmp -if $(ls polycat-* | grep -q "$version"); then +if $(ls $repo_dir/polycat-* | grep -q "$version"); then rm polycat-tmp echo "package is already up to date, exiting" exit From b1d8b3fca3898b2c3f061e56df1cec07adb1fd3f Mon Sep 17 00:00:00 2001 From: askiiart <askiiart@noreply.localhost> Date: Thu, 6 Mar 2025 19:25:09 +0000 Subject: [PATCH 23/26] zstd is required for build too --- polycat.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polycat.spec b/polycat.spec index 67be631..42de7eb 100644 --- a/polycat.spec +++ b/polycat.spec @@ -6,7 +6,7 @@ Summary: runcat module for polybar (or waybar) License: MIT URL: https://github.com/2IMT/polycat -BuildRequires: tar +BuildRequires: tar zstd Requires: glibc %description From 8d0f2ecdd25996eb49a02976aa30ac37bf86b98d Mon Sep 17 00:00:00 2001 From: askiiart <askiiart@noreply.localhost> Date: Thu, 6 Mar 2025 19:34:19 +0000 Subject: [PATCH 24/26] fix not prefixing with the dir or whatever --- run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index c88d294..b554c4b 100755 --- a/run.sh +++ b/run.sh @@ -8,13 +8,13 @@ repo_dir=${REPO_DIR:-/repo} # skip if already up-to-date # TODO: use the repo instead and check the version with dnf # yeah this is bad; see also the polycat-aaaaaa thing below -touch polycat-tmp +touch $repo_dir/polycat-tmp if $(ls $repo_dir/polycat-* | grep -q "$version"); then - rm polycat-tmp + rm $repo_dir/polycat-tmp echo "package is already up to date, exiting" exit fi -rm polycat-tmp +rm polycat_tmp # prep dnf install fedora-packager rpmdevtools createrepo_c -y From 72ad18e6be2319bed6926fa9d7a9442c1da447a9 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Thu, 6 Mar 2025 19:40:04 -0600 Subject: [PATCH 25/26] fix logic for first run --- run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index b554c4b..3081899 100755 --- a/run.sh +++ b/run.sh @@ -35,9 +35,9 @@ mv ~/rpmbuild/RPMS/x86_64/polycat-$version-* $repo_dir/ cd $repo_dir # this is the easiest way to make sure it doesn't just fail because no polycat-* exists # (which only happens on first run) -touch polycat-aaaaaa.rpm +touch polycat-r0.rpm rm $(ls polycat-*.rpm | sort --version-sort | sed '$d') -rm polycat-aaaaaa.rpm +rm polycat-r0.rpm || true # update repo createrepo_c . From ac066e4bdc36c6d6eac0c8af7294efa5632fbc18 Mon Sep 17 00:00:00 2001 From: askiiart <dev@askiiart.net> Date: Thu, 6 Mar 2025 19:44:38 -0600 Subject: [PATCH 26/26] fix typo --- run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 3081899..7ff1047 100755 --- a/run.sh +++ b/run.sh @@ -14,7 +14,7 @@ if $(ls $repo_dir/polycat-* | grep -q "$version"); then echo "package is already up to date, exiting" exit fi -rm polycat_tmp +rm $repo_dir/polycat-tmp # prep dnf install fedora-packager rpmdevtools createrepo_c -y