aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2006-10-24 21:54:46 +0000
committerrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2006-10-24 21:54:46 +0000
commit2b4c218eab9dc564a3785093edd2873bd199bd17 (patch)
tree8bab9dce260b98826ab1d85e6b1556abf25e3071
parent78c3c90ce2a01600f45f00af3180d477d8ef200e (diff)
downloadslackbuilds-2b4c218eab9dc564a3785093edd2873bd199bd17.tar.gz
slackbuilds-2b4c218eab9dc564a3785093edd2873bd199bd17.tar.bz2
kernel-ratten: now with error handling
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@511 370017ae-e619-0410-ac65-c121f96126d4
-rwxr-xr-xkernel-ratten/kernel-ratten.SlackBuild26
1 files changed, 16 insertions, 10 deletions
diff --git a/kernel-ratten/kernel-ratten.SlackBuild b/kernel-ratten/kernel-ratten.SlackBuild
index 57d14f53..43ce22d4 100755
--- a/kernel-ratten/kernel-ratten.SlackBuild
+++ b/kernel-ratten/kernel-ratten.SlackBuild
@@ -39,6 +39,12 @@ SRC_DIR=${SRC:=$CWD}
SPLASH="/etc/bootsplash/themes/Slack-Black-Tux/config/bootsplash-1024x768.cfg"
REPOS=${REPOS:=$TMP}
+# ------- error codes for createpkg --------------
+ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33
+ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36
+ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39
+ERROR_PATCH=40
+
if [ ! -f "$SPLASH" ]; then
echo error: file not found: $SPLASH
exit 1
@@ -61,12 +67,12 @@ if [ "$RTOOL" == "wget" ]; then
if [ ! -f "$SRC_DIR/$KERNEL" ]; then
rm -f $SRC_DIR/$KERNEL.sign
- wget "$KERNEL_URL" -O "$SRC_DIR/$KERNEL"
- wget "$KERNEL_URL.sign" -O "$SRC_DIR/$KERNEL.sign"
+ wget "$KERNEL_URL" -O "$SRC_DIR/$KERNEL" || exit $ERROR_WGET
+ wget "$KERNEL_URL.sign" -O "$SRC_DIR/$KERNEL.sign" || exit $ERROR_WGET
fi
if [ ! -f "$SRC_DIR/$PATCH" ]; then
- wget "$PATCH_URL" -O "$SRC_DIR/$PATCH"
+ wget "$PATCH_URL" -O "$SRC_DIR/$PATCH" || exit $ERROR_WGET
fi
fi
@@ -76,7 +82,7 @@ mkdir -p $TMP
cd $TMP
rm -rf linux-$KERNEL_VERSION*
-tar jxvf $SRC_DIR/$KERNEL
+tar jxvf $SRC_DIR/$KERNEL || exit $ERROR_TAR
if [ ! -z "$PATCHSET" ]; then
mv linux-$KERNEL_VERSION linux-$KERNEL_VERSION-$PATCHSET
@@ -93,17 +99,17 @@ elif [ ! -z "$PATCHSET" ]; then
fi
mv Makefile.tmp Makefile
-patch -p1 < $CWD/$REALTIME_PATCH
-patch -p1 < $SRC_DIR/$PATCH
+patch -p1 < $CWD/$REALTIME_PATCH || exit $ERROR_PATCH
+patch -p1 < $SRC_DIR/$PATCH || exit $ERROR_TAR
-make oldconfig
-time make
+make oldconfig || exit $ERROR_MAKE
+time make || exit $ERROR_MAKE
if [ -d "/lib/modules/$KERNEL_VERSION" ]; then
( cd /lib/modules && mv $KERNEL_VERSION $KERNEL_VERSION.old )
fi
-make modules_install
+make modules_install || exit $ERROR_INSTALL
# make the package
@@ -155,7 +161,7 @@ cd $PKG
( cd boot && ln -s config-$KERNEL_VERSION config )
( cd boot && ln -s System.map-$KERNEL_VERSION System.map )
-makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz
+makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG
if [ "$CLEANUP" == "yes" ]; then
rm -rf $TMP