From 0ace28e63563c10c0c0cddd520d1082e01051941 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 26 Sep 2022 00:48:17 +0200 Subject: [PATCH 01/10] Log grantlee5 plugins directory --- grantlee5/linuxdeploy-plugin-grantlee5.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index 809761c..7183653 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -91,6 +91,8 @@ EOF popd &>/dev/null fi +echo "GRANTLEE5_PLUGINS_DIR=$\GRANTLEE5_PLUGINS_DIR" + if [[ ! -d "$GRANTLEE5_PLUGINS_DIR" ]]; then echo "Error: grantlee5 plugins directory does not exist or could not be found" exit 2 From 106e0a76113c294edf9748cf8fec82f9ca965988 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 26 Sep 2022 00:56:47 +0200 Subject: [PATCH 02/10] Fix logging of grantlee5 plugins directory --- grantlee5/linuxdeploy-plugin-grantlee5.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index 7183653..35f1bb7 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -91,7 +91,7 @@ EOF popd &>/dev/null fi -echo "GRANTLEE5_PLUGINS_DIR=$\GRANTLEE5_PLUGINS_DIR" +echo "\$GRANTLEE5_PLUGINS_DIR=$GRANTLEE5_PLUGINS_DIR" if [[ ! -d "$GRANTLEE5_PLUGINS_DIR" ]]; then echo "Error: grantlee5 plugins directory does not exist or could not be found" From 1135557d0fd1298a5d8309b182fc3c0bdca75000 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 26 Sep 2022 00:57:24 +0200 Subject: [PATCH 03/10] Make auto-detection work on openSUSE Leap 15.2 --- grantlee5/linuxdeploy-plugin-grantlee5.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index 35f1bb7..a18b52b 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -68,6 +68,20 @@ set(imported_target "Grantlee5::defaultfilters") message(STATUS "Fetching imported location for target ${imported_target}") +foreach(property_name IMPORTED_LOCATION_NONE IMPORTED_LOCATION_RELWITHDEBINFO) + get_property(imported_location TARGET "${imported_target}" PROPERTY "${property_name}") + + message(STATUS "Property ${property_name} value: \"${imported_location}\"") + + if(NOT "${imported_location}" STREQUAL "") + break() + endif() +endforeach() + +if("${imported_location}" STREQUAL "") + message(FATAL_ERROR "Could not find location with CMake") +endif() + get_property(imported_location TARGET "${imported_target}" PROPERTY IMPORTED_LOCATION_NONE) message(STATUS "Imported location: ${imported_location}") From 2e110439a56fbfc0a1bbcf4a5c82494d7d1f3799 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 26 Sep 2022 01:17:56 +0200 Subject: [PATCH 04/10] Allow user to display CMake log manually --- grantlee5/linuxdeploy-plugin-grantlee5.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index a18b52b..6a1aaad 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -91,7 +91,7 @@ EOF cmake . &>cmake.log # clean up log if everything worked, otherwise it would be printed by the cleanup handler - rm cmake.log + [[ "$VERBOSE" != "" ]] && rm cmake.log imported_location="$(cat imported-location)" @@ -100,8 +100,6 @@ EOF exit 2 fi - GRANTLEE5_PLUGINS_DIR="$(dirname "$imported_location")" - popd &>/dev/null fi From 0b12f2a7a0c4a0f3743876f6fd28cb9102bcee33 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 26 Sep 2022 01:53:17 +0200 Subject: [PATCH 05/10] Actually use path found by CMake --- grantlee5/linuxdeploy-plugin-grantlee5.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index 6a1aaad..51e0777 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -100,6 +100,8 @@ EOF exit 2 fi + GRANTLEE5_PLUGINS_DIR="$(dirname "$imported_location")" + popd &>/dev/null fi From dc440efc8d63eb3690c31d74a2941c57efb939a2 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 26 Sep 2022 03:26:42 +0200 Subject: [PATCH 06/10] Fix print of CMake logging --- grantlee5/linuxdeploy-plugin-grantlee5.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index 51e0777..8c11bad 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -90,8 +90,12 @@ EOF cmake . &>cmake.log + if [[ "$VERBOSE" != "" ]]; then + cat cmake.log + fi + # clean up log if everything worked, otherwise it would be printed by the cleanup handler - [[ "$VERBOSE" != "" ]] && rm cmake.log + rm cmake.log imported_location="$(cat imported-location)" From b3df5f628c89887ef0b49b8ab266522a312f2262 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 26 Sep 2022 03:36:49 +0200 Subject: [PATCH 07/10] Fix obsolete command breaking openSUSE --- grantlee5/linuxdeploy-plugin-grantlee5.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index 8c11bad..9c2fdcf 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -82,7 +82,6 @@ if("${imported_location}" STREQUAL "") message(FATAL_ERROR "Could not find location with CMake") endif() -get_property(imported_location TARGET "${imported_target}" PROPERTY IMPORTED_LOCATION_NONE) message(STATUS "Imported location: ${imported_location}") file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/imported-location" "${imported_location}") From 2253147acdf6c8e2cdbc52e3aea29fa0fd627f91 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 24 Oct 2022 22:21:59 +0200 Subject: [PATCH 08/10] Detect detection failures --- grantlee5/linuxdeploy-plugin-grantlee5.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index 9c2fdcf..05bd9d0 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -119,6 +119,11 @@ fi # this should always be the last component, as the plugins need to be stored in a directory like .../grantlee//grantlee*.so grantlee5_version="$(echo "$GRANTLEE5_PLUGINS_DIR" | rev | cut -d/ -f1 | rev)" +if [[ "$grantlee5_version" == "" ]]; then + echo "Error: failed to detect grantlee5 version" + exit 2 +fi + target_dir="$appdir"/usr/plugins/grantlee/"$grantlee5_version" echo "Copying plugins from $GRANTLEE5_PLUGINS_DIR to $target_dir" From a777b9ee3f56e508022236898974f3138bd7efd9 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 24 Oct 2022 23:03:02 +0200 Subject: [PATCH 09/10] Fix trailing slashes in detected path Trailing slashes cause the detection of the grantlee5 version to fail with an empty string, causing deployment to go to the wrong directory (the parent dir of the actual directory). --- grantlee5/linuxdeploy-plugin-grantlee5.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grantlee5/linuxdeploy-plugin-grantlee5.sh b/grantlee5/linuxdeploy-plugin-grantlee5.sh index 05bd9d0..af4c70a 100755 --- a/grantlee5/linuxdeploy-plugin-grantlee5.sh +++ b/grantlee5/linuxdeploy-plugin-grantlee5.sh @@ -117,7 +117,7 @@ fi # guess grantlee version from the plugin path # this should always be the last component, as the plugins need to be stored in a directory like .../grantlee//grantlee*.so -grantlee5_version="$(echo "$GRANTLEE5_PLUGINS_DIR" | rev | cut -d/ -f1 | rev)" +grantlee5_version="$(echo "$GRANTLEE5_PLUGINS_DIR" | sed -e 's|/*$||' | rev | cut -d/ -f1 | rev)" if [[ "$grantlee5_version" == "" ]]; then echo "Error: failed to detect grantlee5 version" From 8afa07f04b5507ab2a9b7c56cddd485a9baf39dc Mon Sep 17 00:00:00 2001 From: The Tumultuous Unicorn Of Darkness Date: Wed, 26 Jul 2023 18:34:12 +0200 Subject: [PATCH 10/10] [test-plugins] follow external files when linting plugins --- tests/test-plugins.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-plugins.sh b/tests/test-plugins.sh index f010835..3130b35 100755 --- a/tests/test-plugins.sh +++ b/tests/test-plugins.sh @@ -58,7 +58,7 @@ while IFS= read -r -d '' plugin; do echo -e "\033[1mTesting plugin $name...\033[0m" printf "%-60s" " - lint plugin" - run_valid_command shellcheck "$plugin" + run_valid_command shellcheck --external-sources "$plugin" printf "%-60s" " - run with wrong usage" run_invalid_command bash "$plugin"