diff --git a/src/usr/libexec/sbopkg/sqg/functions b/src/usr/libexec/sbopkg/sqg/functions index b885214..3eb3874 100644 --- a/src/usr/libexec/sbopkg/sqg/functions +++ b/src/usr/libexec/sbopkg/sqg/functions @@ -234,3 +234,19 @@ execute_build () { build_queuefile_custom "$QUEUEDIR" "$CUSTOM_QUEUE" "$PKGS" fi } + +# +# Check .info validity +# We only check for PRGNAM for now, but more may be added in the future +# +check_validity() { + local INFO_FILE="$1" + + check_program=`grep PRGNAM $INFO_FILE` + + if [ $? -eq 0 ]; then + return 0 + else + return 1 + fi +} \ No newline at end of file diff --git a/src/usr/libexec/sbopkg/sqg/sqg-build-queuefile b/src/usr/libexec/sbopkg/sqg/sqg-build-queuefile index a3b2d3a..41afcc6 100755 --- a/src/usr/libexec/sbopkg/sqg/sqg-build-queuefile +++ b/src/usr/libexec/sbopkg/sqg/sqg-build-queuefile @@ -9,13 +9,22 @@ INFO="$3" VERBOSE="${4:-no}" CUSTOM_QUEUE="${5:-}" -. $INFO +check_validity $INFO -if [ "$VERBOSE" == "yes" ]; then - INFO_BASENAME=$(basename $INFO .info) - echo "Processing $INFO_BASENAME." -fi +if [ $? -ne 0 ]; then + echo "" + echo "Found invalid .info file: $INFO. Skipping." + echo "" + continue; +else + . $INFO -if [[ ! -z $REQUIRES ]]; then - build_queuefile "$REPO_DIR" "$QUEUEDIR" "$PRGNAM" "$CUSTOM_QUEUE" -fi + if [ "$VERBOSE" == "yes" ]; then + INFO_BASENAME=$(basename $INFO .info) + echo "Processing $INFO_BASENAME." + fi + + if [[ ! -z $REQUIRES ]]; then + build_queuefile "$REPO_DIR" "$QUEUEDIR" "$PRGNAM" "$CUSTOM_QUEUE" + fi +fi \ No newline at end of file