Improved error detection

This commit is contained in:
2025-09-21 15:47:43 +01:00
parent e8926d8c86
commit ae90a8ac9c

View File

@@ -20,6 +20,7 @@ OS="${OSNAME}-${OSVER}"
OPT_INSTALL=0 OPT_INSTALL=0
OPT_RECURSE=0 OPT_RECURSE=0
OPT_FORCE=0 OPT_FORCE=0
OPT_CLEAN=0
@@ -36,13 +37,14 @@ hook() {
set -- `getopt ifs $*` set -- `getopt icfs $*`
for i in $* for i in $*
do do
case $i in case $i in
-f) OPT_FORCE=1; shift;; -f) OPT_FORCE=1; shift;;
-i) OPT_INSTALL=1; shift;; -i) OPT_INSTALL=1; shift;;
-s) OPT_RECURSE=1; shift;; -s) OPT_RECURSE=1; shift;;
-c) OPT_CLEAN=1; shift;;
--) shift; break;; --) shift; break;;
esac esac
done done
@@ -57,7 +59,7 @@ fi
if [ -z "$URL" ]; then if [ -z "$URL" ]; then
echo "URL missing from PKGCONF." echo "URL missing from PKGCONF."
exit 10 exit 11
fi fi
HERE=`pwd` HERE=`pwd`
@@ -98,7 +100,12 @@ download() {
git clone --depth 1 --branch "$T" https:$H "${SRCDIR}/${PACKAGE}-${VERSION}" git clone --depth 1 --branch "$T" https:$H "${SRCDIR}/${PACKAGE}-${VERSION}"
hook git_clone_post hook git_clone_post
;; ;;
*)
echo "Unknown dowload protocol: ${URL_PROTO}"
return 15
;;
esac esac
return 0
} }
@@ -165,7 +172,13 @@ package() {
runonce() { runonce() {
FUNC=$1 FUNC=$1
if [ ! -f "${HERE}/.${FUNC}" ]; then if [ ! -f "${HERE}/.${FUNC}" ]; then
$1 "$2" "$3" "$4" "$5" "$6" || exit 10 echo "*** STAGE: ${FUNC}"
if $1 "$2" "$3" "$4" "$5" "$6" ; then
printf ""
else
echo "Failed $!"
exit 12
fi
fi fi
touch "${HERE}/.${FUNC}" touch "${HERE}/.${FUNC}"
} }
@@ -196,7 +209,7 @@ checkdepend() {
fi fi
done done
if [ "$FAIL" = "1" ]; then if [ "$FAIL" = "1" ]; then
exit 10 exit 13
fi fi
fi fi
} }
@@ -212,12 +225,17 @@ patchsrc() {
} }
checkdepend
if [ "${OPT_FORCE}" = "1" ]; then if [ "${OPT_FORCE}" = "1" ]; then
cleanup cleanup
fi fi
if [ "${OPT_CLEAN}" = "1" ]; then
cleanup
exit 0
fi
checkdepend
mkdir -p "${DISTFILES}" mkdir -p "${DISTFILES}"