mirror of
https://github.com/certbot/certbot.git
synced 2026-06-06 23:32:06 -04:00
switch to using packaging.version.parse instead of LooseVersion
This commit is contained in:
parent
bbda2016ed
commit
e3f12df03b
2 changed files with 4 additions and 2 deletions
|
|
@ -10,8 +10,9 @@ cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)
|
|||
# get required certbot version for plugin
|
||||
cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py)
|
||||
|
||||
python3 -c "from distutils.version import LooseVersion; import sys; sys.exit(1) if\
|
||||
LooseVersion('$cb_installed') < LooseVersion('$cb_required') else sys.exit(0)" || exit_code=$?
|
||||
|
||||
python3 -c "import sys; from packaging import version; sys.exit(1) if\
|
||||
version.parse('$cb_installed') < version.parse('$cb_required') else sys.exit(0)" || exit_code=$?
|
||||
if [ "$exit_code" -eq 1 ]; then
|
||||
echo "Certbot is version $cb_installed but needs to be at least $cb_required before" \
|
||||
"this plugin can be updated; will try again on next refresh."
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ parts:
|
|||
plugin: dump
|
||||
source: .
|
||||
stage: [setup.py, certbot-shared]
|
||||
stage-packages: [python3-packaging]
|
||||
override-pull: |
|
||||
snapcraftctl pull
|
||||
mkdir -p $SNAPCRAFT_PART_SRC/certbot-shared
|
||||
|
|
|
|||
Loading…
Reference in a new issue