From 992d7afbfea6e7eec4e88e8c43a0b1858fedc6a1 Mon Sep 17 00:00:00 2001 From: probonopd Date: Thu, 26 Sep 2019 18:36:38 +0000 Subject: [PATCH] Handle '#' comments correctly and allow this script to run standalone [ci skip] --- tools/generate-excludelist.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/generate-excludelist.sh b/tools/generate-excludelist.sh index aaed9f5..47df027 100755 --- a/tools/generate-excludelist.sh +++ b/tools/generate-excludelist.sh @@ -2,17 +2,21 @@ set -e -# download excludelist -blacklisted=($(wget --quiet https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist -O - | sort | uniq | grep -v "^#.*" | grep "[^-\s]")) +# Download excludelist +blacklisted=($(wget --quiet https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist -O - | sort | uniq | cut -d '#' -f 1 | grep -v "^#.*" | grep "[^-\s]")) -# sanity check +# Sanity check if [ "$blacklisted" == "" ]; then exit 1; fi +# If the linuxdeployqt source is not available locally, generate the file anyway filename=$(readlink -f $(dirname "$0"))/linuxdeployqt/excludelist.h +if [ ! -e "$filename" ] ; then + filename=$(readlink -f $(dirname "$0"))/linuxdeployqt/excludelist.h +fi -# overwrite existing source file +# Overwrite existing source file cat > "$filename" <