mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-05 22:29:40 +00:00
abuild: set GIT_CEILING_DIRECTORIES before running prepare/build/check/package
This commit is contained in:
parent
4dbf8e3756
commit
33ce0536ef
@ -674,6 +674,8 @@ runpart() {
|
||||
if [ -d "$builddir" ]; then
|
||||
case "$part" in
|
||||
prepare|build|package|check)
|
||||
# exclude aports from git repo discovery
|
||||
export GIT_CEILING_DIRECTORIES="$startdir"
|
||||
cd "$builddir";;
|
||||
esac
|
||||
fi
|
||||
|
@ -21,7 +21,8 @@ init_tests \
|
||||
abuild_invalid_pkgnames \
|
||||
abuild_invalid_subpkgnames \
|
||||
abuild_invalid_subpkg_version \
|
||||
abuild_multiline_license
|
||||
abuild_multiline_license \
|
||||
abuild_git_ceiling
|
||||
|
||||
export ABUILD_SHAREDIR=$(atf_get_srcdir)/..
|
||||
export ABUILD_CONF=/dev/null
|
||||
@ -412,3 +413,33 @@ abuild_multiline_license_body() {
|
||||
atf_check -o match:'^license = MIT AND GPL-3.0-only OR GPL-3.0-or-later AND BSD-Clause-4$' \
|
||||
cat pkg/.control.test-licenses/.PKGINFO
|
||||
}
|
||||
|
||||
abuild_git_ceiling_body() {
|
||||
init_keys
|
||||
git init
|
||||
mkdir git-pkg
|
||||
cd git-pkg
|
||||
cat >APKBUILD<<-EOF
|
||||
# Maintainer: Joe User <juser@example.com>
|
||||
pkgname="git-pkg"
|
||||
pkgver="1.0"
|
||||
pkgrel=0
|
||||
pkgdesc="Dummy test package"
|
||||
url="https://gitlab.alpinelinux.org/alpine/aports"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
prepare() {
|
||||
mkdir -p "\$builddir"
|
||||
}
|
||||
build() {
|
||||
git status
|
||||
}
|
||||
package() {
|
||||
mkdir -p "\$pkgdir"
|
||||
}
|
||||
EOF
|
||||
atf_check -s exit:1 \
|
||||
-e match:"not a git repository" \
|
||||
-e match:"ERROR: git-pkg: build failed" \
|
||||
abuild
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user