Move version bumping into scripts/bump-version.sh, rename the ebuild per release, reset the Void checksum, and add make pkg-checksums to fill it after the release.
24 lines
963 B
Bash
Executable File
24 lines
963 B
Bash
Executable File
#!/bin/sh
|
|
# Usage: scripts/bump-version.sh X.Y.Z
|
|
# Updates the version in source and every package definition.
|
|
# Run from the repo root. Void checksum is reset: fill it with
|
|
# scripts/update-checksums.sh once the release tarball exists.
|
|
set -eu
|
|
|
|
VER="${1:?usage: $0 X.Y.Z}"
|
|
EBUILD_DIR=pkg/gentoo/app-containers/unitdore
|
|
|
|
sed -i "s/^var version = .*/var version = \"$VER\"/" cmd/root.go
|
|
sed -i "s/^pkgver=.*/pkgver=$VER/" pkg/arch/PKGBUILD
|
|
sed -i "s/^Version:.*/Version: $VER/" pkg/centos/unitdore.spec
|
|
|
|
# Gentoo: the version lives in the ebuild file name
|
|
OLD_EBUILD=$(ls "$EBUILD_DIR"/unitdore-*.ebuild | head -n1)
|
|
NEW_EBUILD="$EBUILD_DIR/unitdore-$VER.ebuild"
|
|
[ "$OLD_EBUILD" = "$NEW_EBUILD" ] || git mv "$OLD_EBUILD" "$NEW_EBUILD"
|
|
|
|
# Void: version bump invalidates the checksum
|
|
sed -i -e "s/^version=.*/version=$VER/" \
|
|
-e "s/^revision=.*/revision=1/" \
|
|
-e "s/^checksum=.*/checksum=UPDATE_AFTER_RELEASE/" pkg/void/srcpkgs/unitdore/template
|