From 4c4ede3cef7a6f36d358ab43c61a5d6a231d8a23 Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Fri, 10 Apr 2026 20:08:43 +0200 Subject: Add update-packer-to + update-packages is now build-packages --- auto-void-packages/auto-build-all-orphans.sh | 2 +- auto-void-packages/build-package.sh | 50 ++++++++++++++++++++++++++++ auto-void-packages/update-package.sh | 50 ---------------------------- bin/update-packer-to | 15 +++++++++ 4 files changed, 66 insertions(+), 51 deletions(-) create mode 100755 auto-void-packages/build-package.sh delete mode 100755 auto-void-packages/update-package.sh create mode 100755 bin/update-packer-to diff --git a/auto-void-packages/auto-build-all-orphans.sh b/auto-void-packages/auto-build-all-orphans.sh index 8c4c8cf..746739a 100755 --- a/auto-void-packages/auto-build-all-orphans.sh +++ b/auto-void-packages/auto-build-all-orphans.sh @@ -140,7 +140,7 @@ for package in "${!pkgs_to_update[@]}"; do auto_build_archs_path="$HOME/workbench/auto-void-packages/auto-build/archs-${package}-${latest_version}.txt" echo ">>>[$package - $latest_version]>>>" - ./update-package.sh "$package" "$latest_version" "$auto_build_archs_path" + ./build-package.sh "$package" "$latest_version" "$auto_build_archs_path" echo "<<<[$package - $latest_version]<<<" diff --git a/auto-void-packages/build-package.sh b/auto-void-packages/build-package.sh new file mode 100755 index 0000000..5b62af0 --- /dev/null +++ b/auto-void-packages/build-package.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# Clyhtsuriva + + +helpy(){ + printf "command: %s [path]\n" "$0" +printf "package: package name\n" +printf "version: version update\n" +printf "path (optional): path of architectures file, defaults to '\$HOME/workbench/auto-void-packages/architectures.txt'\n" +} + + +[ -z "$1" ] || [ -z "$2" ] && helpy && exit 1 +PKG="$1" +VER="$2" +archs_fp="${3:-$HOME/workbench/auto-void-packages/architectures.txt}" +template_path="srcpkgs/$PKG/template" +printf "Updating %s to %s.\n" "$PKG" "$VER" + +pushd ~/workbench/void-packages || exit 1 + +./xbps-src binary-bootstrap && ./xbps-src clean-repocache + +git checkout master +git checkout -b "$PKG-update" || ( \ + git checkout master &&\ + git branch -D "$PKG-update" && \ + git checkout -b "$PKG-update" ) || \ + exit 1 + +sed -i "s/version=.*/version=$VER/g" "$template_path" +sed -i "s/revision=.*/revision=1/g" "$template_path" + +xgensum -f -i "$PKG" ; xgensum -f -i "$PKG" || exit 1 + +xlint "$template_path" || exit 1 + +[ -f "$archs_fp" ] && rm -v "$archs_fp" + +./xbps-src clean "$PKG" +./xbps-src -a armv7l pkg "$PKG" && echo " - armv7l" >> "$archs_fp" +./xbps-src -a armv6l-musl pkg "$PKG" && echo " - armv6l-musl" >> "$archs_fp" +./xbps-src -a aarch64-musl pkg "$PKG" && echo " - aarch64-musl" >> "$archs_fp" +./xbps-src pkg "$PKG" || exit 1 + +./xbps-src check "$PKG" || exit 1 + +sudo xbps-install -S --repository="hostdir/binpkgs/$PKG-update" "$PKG" && $PKG --version + +popd || exit 1 diff --git a/auto-void-packages/update-package.sh b/auto-void-packages/update-package.sh deleted file mode 100755 index 11345ef..0000000 --- a/auto-void-packages/update-package.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash -#Clyhtsuriva - - -helpy(){ - printf "command: %s [path]\n" "$0" -printf "package: package name\n" -printf "version: version update\n" -printf "path (optional): path of architectures file, defaults to '\$HOME/workbench/auto-void-packages/architectures.txt'\n" -} - - -[ -z "$1" ] || [ -z "$2" ] && helpy && exit 1 -PKG="$1" -VER="$2" -archs_fp="${3:-$HOME/workbench/auto-void-packages/architectures.txt}" -template_path="srcpkgs/$PKG/template" -printf "Updating %s to %s.\n" "$PKG" "$VER" - -pushd ~/workbench/void-packages || exit 1 - -./xbps-src binary-bootstrap && ./xbps-src clean-repocache - -git checkout master -git checkout -b "$PKG-update" || ( \ - git checkout master &&\ - git branch -D "$PKG-update" && \ - git checkout -b "$PKG-update" ) || \ - exit 1 - -sed -i "s/version=.*/version=$VER/g" "$template_path" -sed -i "s/revision=.*/revision=1/g" "$template_path" - -xgensum -f -i "$PKG" ; xgensum -f -i "$PKG" || exit 1 - -xlint "$template_path" || exit 1 - -[ -f "$archs_fp" ] && rm -v "$archs_fp" - -./xbps-src clean "$PKG" -./xbps-src -a armv7l pkg "$PKG" && echo " - armv7l" >> "$archs_fp" -./xbps-src -a armv6l-musl pkg "$PKG" && echo " - armv6l-musl" >> "$archs_fp" -./xbps-src -a aarch64-musl pkg "$PKG" && echo " - aarch64-musl" >> "$archs_fp" -./xbps-src pkg "$PKG" || exit 1 - -./xbps-src check "$PKG" || exit 1 - -sudo xbps-install -S --repository="hostdir/binpkgs/$PKG-update" "$PKG" && $PKG --version - -popd || exit 1 diff --git a/bin/update-packer-to b/bin/update-packer-to new file mode 100755 index 0000000..622f139 --- /dev/null +++ b/bin/update-packer-to @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# clyhtsuriva + +VER=$1 + +pushd /tmp/ || exit + +curl -LO "https://releases.hashicorp.com/packer/${VER}/packer_${VER}_linux_amd64.zip" && \ +unzip "packer_${VER}_linux_amd64.zip" && \ +rm LICENSE.txt && \ +mv packer ~/.local/bin/packer && \ +packer -v && \ +rm "packer_${VER}_linux_amd64.zip" + +popd || exit -- cgit v1.2.3