Commit 26b20352 authored by Roland Kammerer's avatar Roland Kammerer Committed by Natanael Copa

testing/drbd9-grsec: fix prepare logic

- $PWD is already at $srcdir => first cd to $startdir.
- If we don't find an APKBUILD for the kernel flavor, error out.
- We are in a sub-shell, we do not have to protect $pkgname.
- Return 0 in case we did not "die", otherwise in the positive case
  where the last check succeeds, it sets the sub-shell return value
  to 1, which then triggers the failure path.
parent b71cc024
......@@ -9,7 +9,7 @@ _kver=4.1.15
......@@ -33,15 +33,17 @@ _builddir=$srcdir/$_usname-$_usver
prepare() {
local i
# verify the kernel version
(if [ -f ../../main/linux-${_flavor}/APKBUILD ]; then
(cd $startdir
if [ -f ../../main/linux-${_flavor}/APKBUILD ]; then
. ../../main/linux-${_flavor}/APKBUILD
[ "$_kver" != "$pkgver" ] \
&& die "please update _kver to $pkgver"
[ "$_kpkgrel" != "$pkgrel" ] \
&& die "please update _kpkgrel to $pkgrel"
fi) || return 1
die "could not determine kernel flavor: linux-${_flavor}"
return 0) || return 1
cd "$_builddir"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment