mirror of
https://github.com/sbopkg/sbopkg
synced 2024-11-09 19:50:25 +03:00
sqg: Check for invalid .info files before processing.
Fixed #46. Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
parent
1bba4609d7
commit
35ceb9ce32
@ -234,3 +234,19 @@ execute_build () {
|
|||||||
build_queuefile_custom "$QUEUEDIR" "$CUSTOM_QUEUE" "$PKGS"
|
build_queuefile_custom "$QUEUEDIR" "$CUSTOM_QUEUE" "$PKGS"
|
||||||
fi
|
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
|
||||||
|
}
|
@ -9,13 +9,22 @@ INFO="$3"
|
|||||||
VERBOSE="${4:-no}"
|
VERBOSE="${4:-no}"
|
||||||
CUSTOM_QUEUE="${5:-}"
|
CUSTOM_QUEUE="${5:-}"
|
||||||
|
|
||||||
. $INFO
|
check_validity $INFO
|
||||||
|
|
||||||
if [ "$VERBOSE" == "yes" ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
echo ""
|
||||||
|
echo "Found invalid .info file: $INFO. Skipping."
|
||||||
|
echo ""
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
. $INFO
|
||||||
|
|
||||||
|
if [ "$VERBOSE" == "yes" ]; then
|
||||||
INFO_BASENAME=$(basename $INFO .info)
|
INFO_BASENAME=$(basename $INFO .info)
|
||||||
echo "Processing $INFO_BASENAME."
|
echo "Processing $INFO_BASENAME."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -z $REQUIRES ]]; then
|
if [[ ! -z $REQUIRES ]]; then
|
||||||
build_queuefile "$REPO_DIR" "$QUEUEDIR" "$PRGNAM" "$CUSTOM_QUEUE"
|
build_queuefile "$REPO_DIR" "$QUEUEDIR" "$PRGNAM" "$CUSTOM_QUEUE"
|
||||||
|
fi
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue
Block a user