summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-06-27 18:44:07 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-06-27 20:59:29 +0000
commit42df5722ee754c25cf4d23be777ab44b9deef571 (patch)
tree7511619c60e9e4a95a4960b633bf1dacf0959ebf /abuild.in
parent12897f2d4c5eb9f15e138e25bab453a2fbfef604 (diff)
downloadabuild-42df5722ee754c25cf4d23be777ab44b9deef571.tar.gz
abuild-42df5722ee754c25cf4d23be777ab44b9deef571.tar.bz2
abuild-42df5722ee754c25cf4d23be777ab44b9deef571.tar.xz
abuild-42df5722ee754c25cf4d23be777ab44b9deef571.zip
abuild: check sanity of install scripts
we check early that suffix is valid and that we have a matching pkgname or subpackage
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in11
1 files changed, 10 insertions, 1 deletions
diff --git a/abuild.in b/abuild.in
index 439b4f5..59d622b 100755
--- a/abuild.in
+++ b/abuild.in
@@ -96,7 +96,7 @@ die() {
# check if apkbuild is basicly sane
sanitycheck() {
- local i suggestion
+ local i= j= suggestion=
msg "Checking sanity of $APKBUILD..."
[ -z "$pkgname" ] && die "Missing pkgname in APKBUILD"
[ -z "${pkgname##* *}" ] && die "pkgname contains spaces"
@@ -121,6 +121,15 @@ sanitycheck() {
[ -z "$CHOST" ] && die "Please set CHOST in /etc/abuild.conf"
for i in $install; do
+ local n=${i%.*}
+ local suff=${i#*.}
+ case "$suff" in
+ pre-install|post-install|pre-upgrade|post-upgrade|pre-deinstall|post-deinstall);;
+ *) die "$i: unknown install script suffix"
+ esac
+ if ! subpackages_has "$n" && [ "$n" != "$pkgname" ]; then
+ die "$i: install script does not match pkgname or any subpackages"
+ fi
[ -e "$startdir/$i" ] || die "install script $startdir/$i is missing"
done