summaryrefslogtreecommitdiffstats
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-01-04 09:05:54 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2011-01-04 09:05:54 +0000
commit0472849c0c03803418d57db7750dc8d829f9ee55 (patch)
tree77eca377d4e4d403d1ba1b0dcbb0d96b4c614c62 /abuild.in
parentf580e6657a17c5afeba8afa479020986dce239c9 (diff)
downloadabuild-0472849c0c03803418d57db7750dc8d829f9ee55.tar.bz2
abuild-0472849c0c03803418d57db7750dc8d829f9ee55.tar.xz
abuild: implement initdcheck
this check verifies that the *.initd scripts are #!/sbin/runscript
Diffstat (limited to 'abuild.in')
-rwxr-xr-xabuild.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/abuild.in b/abuild.in
index b5d716d..ae2dd84 100755
--- a/abuild.in
+++ b/abuild.in
@@ -254,11 +254,27 @@ fetch() {
default_fetch
}
+# verify that all init.d scripts are openrc runscripts
+initdcheck() {
+ local i
+ for i in $source; do
+ case $i in
+ *.initd)
+ head -n 1 "$srcdir"/$i | grep -q '/sbin/runscript' \
+ && continue
+ error "$i is not an openrc #!/sbin/runscript"
+ return 1
+ ;;
+ esac
+ done
+}
+
# unpack the sources
default_unpack() {
local u
if [ -z "$force" ]; then
md5check || return 1
+ initdcheck || return 1
fi
mkdir -p "$srcdir"
for u in $source; do