From 0326cbf95e48656a0da489f6bba2cd940b06b5d9 Mon Sep 17 00:00:00 2001 From: Patrick Neumann Date: Tue, 13 Sep 2022 16:16:27 +0200 Subject: [PATCH] Update generate_dnsplugins_snapcraft.sh (#9398) There is no need for two interconneced (pipe) processes. The regular expression in the grep part is not strict enough in some cases (presence of long_description. sed does not seem to support perl regular expressions ("\s"). Some Python developers prefer single quotes to double qoutes. Some even go so far as to adapt generated templates (setup.py). This update will (hopefully) fix this all. This was tested on Ubuntu 20.04.5 LTS (Focal Fossa) and macOS 12.5.1 (Monterey). --- tools/snap/generate_dnsplugins_snapcraft.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/snap/generate_dnsplugins_snapcraft.sh b/tools/snap/generate_dnsplugins_snapcraft.sh index efa647366..43f1b2077 100755 --- a/tools/snap/generate_dnsplugins_snapcraft.sh +++ b/tools/snap/generate_dnsplugins_snapcraft.sh @@ -7,7 +7,7 @@ set -e PLUGIN_PATH=$1 PLUGIN=$(basename "${PLUGIN_PATH}") -DESCRIPTION=$(grep description "${PLUGIN_PATH}/setup.py" | sed -E 's|\s+description="(.*)",|\1|g') +DESCRIPTION=$(sed -E -n "/[[:space:]]+description=/ s/[[:space:]]+description=['\"](.*)['\"],/\1/ p" "${PLUGIN_PATH}/setup.py") mkdir -p "${PLUGIN_PATH}/snap" cat < "${PLUGIN_PATH}/snap/snapcraft.yaml" # This file is generated automatically and should not be edited manually.