mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-23 15:33:28 +00:00
Set non-zero size if there are any files in the package
If there are only empty files in the pkgdir, on some filesystems (discovered on btrfs), du might return 0 for the sum size of the files. But apk-tools considers packages with size = 0 to be virtual and skips extraction of any files contained. To work around that (until it is resolved in apk-tools 3), settings the size to 1 when it is zero AND some files are present should work fine.
This commit is contained in:
parent
5f15ae8360
commit
29557a4a54
@ -1061,6 +1061,13 @@ prepare_metafiles() {
|
||||
esac
|
||||
|
||||
local size=$(du -sk | awk '{print $1 * 1024}')
|
||||
# If package contains only empty files, the size might be 0. But due to
|
||||
# apk-tools 2 considering packages with size = 0 virtual, nothing is
|
||||
# extracted. That will be solved in apk-tools 3. As a workaround we can
|
||||
# set the size to 1 if any files are present.
|
||||
if [ "$size" -eq 0 ] && [ -n "$(find . ! -name .)" ]; then
|
||||
size=1
|
||||
fi
|
||||
|
||||
if [ "$arch" != "$apkbuild_arch" ]; then
|
||||
local msg="Split function set arch=\"$arch\" for $name, use subpackages=pkg:split:arch format instead"
|
||||
|
Loading…
Reference in New Issue
Block a user