mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-23 07:22:53 +00:00
abump: check version before we build
This commit is contained in:
parent
1510dbf6fb
commit
fe2aca3b7d
3
abump.in
3
abump.in
@ -51,6 +51,9 @@ do_bump() {
|
||||
|| die "APKBUILD has different \$pkgname for $name"
|
||||
type package | grep -q function \
|
||||
|| die "missing package() for $name"
|
||||
if [ "$pkgver" = "$ver" ] && git diff-index --quiet HEAD -- APKBUILD; then
|
||||
die "version is already $ver"
|
||||
fi
|
||||
|
||||
cd "${a%/*}"
|
||||
section=${PWD%/*}
|
||||
|
@ -83,3 +83,33 @@ teardown() {
|
||||
run $ABUMP foo-1.0
|
||||
[ $status -ne 0 ]
|
||||
}
|
||||
|
||||
@test "abump: test bumping same version which is not in git" {
|
||||
mkdir -p "$tmpdir"/main/foo
|
||||
cd "$tmpdir"/main/foo
|
||||
echo "first" > foo-1.0.txt
|
||||
echo "second" > foo-1.1.txt
|
||||
cat > APKBUILD <<-EOF
|
||||
# Maintainer: Test user <user@example.com>
|
||||
pkgname="foo"
|
||||
pkgver=1.0
|
||||
pkgrel=0
|
||||
pkgdesc="dummy package for test"
|
||||
url="https://alpinelinux.org"
|
||||
license="MIT"
|
||||
arch="noarch"
|
||||
source="foo-\$pkgver.txt"
|
||||
options="!check"
|
||||
package() {
|
||||
install -D "\$srcdir"/foo-\$pkgver.txt "\$pkgdir"/foo
|
||||
}
|
||||
EOF
|
||||
$ABUILD checksum
|
||||
$ABUILD
|
||||
git add APKBUILD foo-1.0.txt
|
||||
git commit -m "test commit"
|
||||
|
||||
sed -i -e 's/pkgver=.*/pkgver=1.1/' APKBUILD
|
||||
|
||||
$ABUMP foo-1.1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user