abuild: support for variable options

so far only option avaiable is !strip, which disables stripping of binaries.
This commit is contained in:
Natanael Copa 2009-02-05 10:35:29 +00:00
parent b9685a9fc2
commit 0e9c2e708c
1 changed files with 16 additions and 1 deletions

17
abuild
View File

@ -315,7 +315,7 @@ EOF
} }
package() { package() {
stripbin options_has "!strip" || stripbin
package_apk package_apk
} }
@ -558,6 +558,21 @@ subpackages_has() {
return 1 return 1
} }
list_has() {
local needle="$1"
local i
shift
for i in $@; do
[ "$needle" = "$i" ] && return 0
[ "$needle" = "!$i" ] && return 1
done
return 1
}
options_has() {
list_has "$1" $options
}
# install package after build # install package after build
post_add() { post_add() {
local pkgf="$PKGDEST/$1-$pkgver-r$pkgrel.apk" local pkgf="$PKGDEST/$1-$pkgver-r$pkgrel.apk"