set -e #Stop the script on errors. Also, followed some examples (from robw810?) and sprinkled in some "|| exit 1" throughout. Is this all correct/good idea?
This is overkill. With "set -e
", the script will already exit on any error, so there will be no need for the additional " || exit 1
" to catch errors.
Instead of that, it would
make sense instead to place " || true
" in strategic places.
What this does? Well think of the line where the docs are copied:
cp -a $PDOCS $PKG/usr/doc/$PNAME-$PVERSION
and suppose you are upgrading a package and your newer sources miss one of the doc files that was present in the older release. The file-copy will exit with an error (file not found) and the SlackBuild will abort due to the "set -e".
If you don't want that, you rewrite that line as
cp -a $PDOCS $PKG/usr/doc/$PNAME-$PVERSION || true
in which case the file-copy command will never cause the SlackBuild to abort when a doc file is missing.