mirror of
https://github.com/sbopkg/sbopkg
synced 2024-11-12 21:10:21 +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"
|
||||
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}"
|
||||
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
|
Loading…
Reference in New Issue
Block a user