diff options
Diffstat (limited to 'auto-void-packages/update-package.sh')
-rwxr-xr-x | auto-void-packages/update-package.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/auto-void-packages/update-package.sh b/auto-void-packages/update-package.sh index 8707626..a21dd6c 100755 --- a/auto-void-packages/update-package.sh +++ b/auto-void-packages/update-package.sh @@ -3,15 +3,17 @@ helpy(){ -printf "command: %s <package> <version>\n" "$0" + printf "command: %s <package> <version> [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}" printf "Updating %s to %s.\n" "$PKG" "$VER" pushd ~/workbench/void-packages || exit 1 @@ -28,11 +30,10 @@ sed -i "s/revision=.*/revision=1/g" "srcpkgs/$PKG/template" xgensum -f -i "$PKG" ; xgensum -f -i "$PKG" || exit 1 -ARCHS_FILE="$HOME/workbench/auto-void-packages/architectures.txt" -[ -f "$ARCHS_FILE" ] && rm -v "$ARCHS_FILE" -./xbps-src -a armv7l pkg "$PKG" && echo " - armv7l" >> "$ARCHS_FILE" -./xbps-src -a armv6l-musl pkg "$PKG" && echo " - armv6l-musl" >> "$ARCHS_FILE" -./xbps-src -a aarch64-musl pkg "$PKG" && echo " - aarch64-musl" >> "$ARCHS_FILE" +[ -f "$archs_fp" ] && rm -v "$archs_fp" +./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 xi -S --repository="hostdir/binpkgs/$PKG-update" "$PKG" && $PKG --version |