add some checks if opkg or extracting the tarball fails (most likely due
authorNils Kneuper <crazy-ivanovic@gmx.net>
Tue, 14 Feb 2012 13:37:29 +0000 (14:37 +0100)
committerNils Kneuper <crazy-ivanovic@gmx.net>
Tue, 14 Feb 2012 13:37:29 +0000 (14:37 +0100)
to "out of diskspace")

sdk_installer/openpandora_toolchain.sh

index b939992..4f0f73d 100755 (executable)
@@ -171,6 +171,16 @@ check_wget_error()
 }
 
 
 }
 
 
+check_error()
+{
+       if [ "$?" -ne "0" ];
+       then
+               cecho "ERROR: Sorry, some error occured. Stopping this script now. Please check for the error message above (eg. 'not enough space left') and fix them before retrying the script." $red
+               exit 1
+       fi
+}
+
+
 check_md5sum()
 {
        LOCAL_ARCHIV=${1}
 check_md5sum()
 {
        LOCAL_ARCHIV=${1}
@@ -231,6 +241,7 @@ install_codesourcery_toolchain()
        echo -e
        cecho "Extracting codesourcery toolchain to $PNDSDK_DIR" $green
        tar -xjf $TMPDIR/$TOOLCHAIN_TARBALL_NAME -C $PNDSDK_DIR
        echo -e
        cecho "Extracting codesourcery toolchain to $PNDSDK_DIR" $green
        tar -xjf $TMPDIR/$TOOLCHAIN_TARBALL_NAME -C $PNDSDK_DIR
+       check_error
 
        #move libstdc++ files that are going to just hurt to some place where they should not be a bother...
        #the version later on installed by the libstdc++ package should be perfectly fine!
 
        #move libstdc++ files that are going to just hurt to some place where they should not be a bother...
        #the version later on installed by the libstdc++ package should be perfectly fine!
@@ -452,12 +463,14 @@ install_libs_via_opkg()
        cecho "Updating opkg package feeds" $green
        #update repository against latest version
        $PNDSDK/bin/opkg-cl --conf=$PNDSDK/opkg.conf --offline-root=$PNDSDK update
        cecho "Updating opkg package feeds" $green
        #update repository against latest version
        $PNDSDK/bin/opkg-cl --conf=$PNDSDK/opkg.conf --offline-root=$PNDSDK update
+       check_error
 
        echo -e
        cecho "Installing all libs, based on $TMPDIR/packages.txt" $green
        cecho "Error messages from opkg about missing dependencies can be ignored!" $cyan
        #install all possible dev packages adding their deps, too
        $PNDSDK/bin/opkg-cl --conf=$PNDSDK/opkg.conf --cache=$TMPDIR --offline-root=$PNDSDK install `cat $TMPDIR/packages.txt | cut -f 1 -d " " | xargs echo`
 
        echo -e
        cecho "Installing all libs, based on $TMPDIR/packages.txt" $green
        cecho "Error messages from opkg about missing dependencies can be ignored!" $cyan
        #install all possible dev packages adding their deps, too
        $PNDSDK/bin/opkg-cl --conf=$PNDSDK/opkg.conf --cache=$TMPDIR --offline-root=$PNDSDK install `cat $TMPDIR/packages.txt | cut -f 1 -d " " | xargs echo`
+       check_error
        cecho "The error messages from opkg about missing dependencies can be ignored!" $cyan
 
        echo -e
        cecho "The error messages from opkg about missing dependencies can be ignored!" $cyan
 
        echo -e