diff --git a/moonraker/plugins/update_manager.py b/moonraker/plugins/update_manager.py index c056523..180cf0f 100644 --- a/moonraker/plugins/update_manager.py +++ b/moonraker/plugins/update_manager.py @@ -4,6 +4,7 @@ # # This file may be distributed under the terms of the GNU GPLv3 license. import os +import glob import re import logging import json @@ -439,12 +440,15 @@ class GitUpdater: if p.strip()] self.python_dist_path = os.path.abspath( config.get('python_dist_path')) - if not os.path.exists(self.python_dist_path): - raise config.error( - "Invalid path for option 'python_dist_path'") - self.env_package_path = os.path.abspath(os.path.join( + env_package_path = os.path.abspath(os.path.join( os.path.dirname(self.env), "..", config.get('env_package_path'))) + matches = glob.glob(env_package_path) + if len(matches) == 1: + self.env_package_path = matches[0] + else: + raise config.error("No match for 'env_package_path': %s" + % (env_package_path,)) for opt in ["repo_path", "env", "python_reqs", "install_script", "python_dist_path", "env_package_path"]: val = getattr(self, opt) diff --git a/scripts/update_manager.conf b/scripts/update_manager.conf index 181a2d4..d686165 100644 --- a/scripts/update_manager.conf +++ b/scripts/update_manager.conf @@ -7,7 +7,7 @@ requirements: scripts/moonraker-requirements.txt venv_args: -p python3 install_script: scripts/install-moonraker.sh python_dist_path: /usr/lib/python3/dist-packages -env_package_path: lib/python3.7/site-packages +env_package_path: lib/python*/site-packages python_dist_packages: gpiod @@ -17,4 +17,4 @@ requirements: scripts/klippy-requirements.txt venv_args: -p python2 install_script: scripts/install-octopi.sh python_dist_path: /usr/lib/python2.7/dist-packages -env_package_path: lib/python2.7/site-packages +env_package_path: lib/python*/site-packages