From 1041c6dde9ee8e6475ac206e53184c8f4d5247ba Mon Sep 17 00:00:00 2001 From: Tommie Gannert Date: Sun, 30 Jul 2023 15:36:20 +0200 Subject: [PATCH] Removes the unused addlatest. --- addlatest | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100755 addlatest diff --git a/addlatest b/addlatest deleted file mode 100755 index 0313d1c..0000000 --- a/addlatest +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# -# Downloads upstream releases and uses reprepro to update the -# repository in debian/. This is idempotent and doesn't clobber files -# if the latest releases is already included. -# - -set -e - -release_repo=tonarino/innernet - -has_changes() { - git status --porcelain "$@" | grep -q . -} - -main() { - local tmpd - tmpd="$(mktemp -d tmp.addlatest.XXXXXXXXXX)" - - ( - cd "$tmpd" - - wget -Olatest.json \ - -H'Accept: application/json' \ - "https://api.github.com/repos/$release_repo/releases/latest" - - cat latest.json \ - | jq -r '.assets[] | select(.name | endswith(".deb")) | (.name + " " + .url)' \ - | while read name url; do - wget --header='Accept: application/octet-stream' -O"$name" "$url" - reprepro --export=silent-never -b ../debian includedeb unstable "$name" - done - ) - - if has_changes debian/pool; then - reprepro -b debian export unstable - fi - - if has_changes debian/{db,dists,pool}; then - git add debian/{db,dists,pool} - git \ - -c 'user.email=41898282+github-actions[bot]@users.noreply.github.com' \ - -c 'user.name=github-actions[bot]' \ - commit -m "Included release $release_repo@$(cat "$tmpd/latest.json" | jq -r '.name | ltrimstr("v")')." - else - echo 'No updates to commit.' - fi -} - -main