aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorRoland Kammerer <roland.kammerer@linbit.com>2016-01-06 16:10:34 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2016-01-06 17:00:37 +0000
commit26b2035220da0aa0e51e2bbfe1e9bb14372214db (patch)
tree10df63c4ff7436b0100e2c602bf900cb70fbb7f2 /testing
parentb71cc024a23fdf12fd5b62d9ceb0cf3c7cca8203 (diff)
downloadaports-26b2035220da0aa0e51e2bbfe1e9bb14372214db.tar.bz2
aports-26b2035220da0aa0e51e2bbfe1e9bb14372214db.tar.xz
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.
Diffstat (limited to 'testing')
-rw-r--r--testing/drbd9-grsec/APKBUILD12
1 files changed, 7 insertions, 5 deletions
diff --git a/testing/drbd9-grsec/APKBUILD b/testing/drbd9-grsec/APKBUILD
index b9922c0b0d..6cf50f9bfa 100644
--- a/testing/drbd9-grsec/APKBUILD
+++ b/testing/drbd9-grsec/APKBUILD
@@ -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"