diff options
author | Patrick Neumann <patrick@neumannsland.de> | 2022-09-13 17:16:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-13 17:16:27 +0300 |
commit | 0326cbf95e48656a0da489f6bba2cd940b06b5d9 (patch) | |
tree | 3475ed8cd38f4cfe4219a065c05f72ce64b859cb | |
parent | 39e8d14e1b221bf37526cc05ecc83beee30a3c57 (diff) |
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).
-rwxr-xr-x | tools/snap/generate_dnsplugins_snapcraft.sh | 2 |
1 files changed, 1 insertions, 1 deletions
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 <<EOF > "${PLUGIN_PATH}/snap/snapcraft.yaml" # This file is generated automatically and should not be edited manually. |