From 4cbdfbad6f40ac51a00bb2b8547a1ebcc0806dfa Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Thu, 16 Jul 2020 14:44:32 -0700 Subject: [PATCH] find and save certbot version on the certbot side --- certbot-dns-dnsimple/snap/hooks/post-refresh | 2 +- snap/snapcraft.yaml | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/certbot-dns-dnsimple/snap/hooks/post-refresh b/certbot-dns-dnsimple/snap/hooks/post-refresh index 3016e8e29..8a0e0442b 100644 --- a/certbot-dns-dnsimple/snap/hooks/post-refresh +++ b/certbot-dns-dnsimple/snap/hooks/post-refresh @@ -5,7 +5,7 @@ if [ ! -f "$SNAP/certbot-shared/__init__.py" ]; then echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog" exit 0 fi -cb_installed=$(grep -oP "__version__ = '\K.*(?=')" $SNAP/certbot-shared/__init__.py) +cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt) # get required certbot version for plugin cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b47de4658..a54398d44 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -85,9 +85,11 @@ parts: shared-metadata: plugin: dump source: . - stage: [certbot-metadata/__init__.py] - organize: - $SNAPCRAFT_PART_SRC/certbot/certbot/__init__.py: certbot-metadata/__init__.py + override-pull: | + snapcraftctl pull + mkdir -p certbot-metadata + grep -oP "__version__ = '\K.*(?=')" $SNAPCRAFT_PART_SRC/certbot/certbot/__init__.py > certbot-metadata/certbot-version.txt + stage: [certbot-metadata/certbot-version.txt] plugs: plugin: