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
_kpkgrel=2
_usver=9.0.0
_mypkgrel=0
_mypkgrel=1
_kernelver=$_kver-r$_kpkgrel
_abi_release=${_kver}-${_kpkgrel}-${_flavor}
......@@ -33,15 +33,17 @@ _builddir=$srcdir/$_usname-$_usver
prepare() {
local i
# verify the kernel version
(if [ -f ../../main/linux-${_flavor}/APKBUILD ]; then
_name=$pkgname
(cd $startdir
if [ -f ../../main/linux-${_flavor}/APKBUILD ]; then
. ../../main/linux-${_flavor}/APKBUILD
pkgname=$_name
[ "$_kver" != "$pkgver" ] \
&& die "please update _kver to $pkgver"
[ "$_kpkgrel" != "$pkgrel" ] \
&& die "please update _kpkgrel to $pkgrel"
fi) || return 1
else
die "could not determine kernel flavor: linux-${_flavor}"
fi
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