mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-02 20:42:43 +00:00
abuild: add an option to keep all directories
This is mainly needed for alpine-baselayout which creates all directories, and most of them are empty. The code in question would remove directories we explicitly want alpine-baselayout to create and own.
This commit is contained in:
parent
8588378efa
commit
ec11f495cd
@ -1788,12 +1788,14 @@ human_size() {
|
||||
create_apks() {
|
||||
local file= dir= name= ver= apk= datadir= size=
|
||||
local gzip=$(command -v pigz || echo gzip)
|
||||
if ! options_has "keepdirs"; then
|
||||
rmdir "$pkgdir"/usr/lib \
|
||||
"$pkgdir"/usr/bin \
|
||||
"$pkgdir"/usr/share \
|
||||
"$pkgdir"/usr \
|
||||
"$pkgdir"/etc/ \
|
||||
2>/dev/null || :
|
||||
fi
|
||||
if ! options_has "!tracedeps"; then
|
||||
for file in "$pkgbasedir"/.control.*/.PKGINFO; do
|
||||
dir="${file%/.PKGINFO}"
|
||||
|
@ -32,6 +32,7 @@ init_tests \
|
||||
abuild_git_ceiling \
|
||||
abuild_package_size_zero \
|
||||
abuild_package_size_nonzero \
|
||||
abuild_keepdirs \
|
||||
abuild_amove \
|
||||
abuild_doc \
|
||||
abuild_dev \
|
||||
@ -619,6 +620,32 @@ abuild_package_size_nonzero_body() {
|
||||
cat pkg/.control.test-size/.PKGINFO
|
||||
}
|
||||
|
||||
abuild_keepdirs_body() {
|
||||
init_keys
|
||||
mkdir -p test-amove
|
||||
|
||||
cd test-amove
|
||||
cat > APKBUILD <<-EOF
|
||||
# Maintainer: Test User 123 <123@example.com>
|
||||
|
||||
# test package
|
||||
pkgname="test-keepdirs"
|
||||
pkgver="1.0"
|
||||
pkgrel=0
|
||||
pkgdesc='Dummy test package - keepdirs'
|
||||
url='https://gitlab.alpinelinux.org/alpine/aports'
|
||||
arch='noarch'
|
||||
license='MIT'
|
||||
options='keepdirs'
|
||||
|
||||
package() {
|
||||
mkdir -p "\$pkgdir"/usr/bin
|
||||
}
|
||||
EOF
|
||||
abuild rootpkg || atf_fail "abuild rootpkg failed"
|
||||
test -d pkg/test-keepdirs/usr/bin || atf_fail "$i failed"
|
||||
}
|
||||
|
||||
abuild_amove_body() {
|
||||
init_keys
|
||||
mkdir -p test-amove
|
||||
|
Loading…
Reference in New Issue
Block a user