diff --git a/CHANGES.md b/CHANGES.md index bfa2721..32f57b7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -29,6 +29,8 @@ * Fix under py2, a hachoir config value, without 'readline' sys.module, using the `--daemon` SG startup option, fails * Change remove pycryptodome from recommended.txt as only used for removed py7z * Add to config/General, "Package updates" > include in 'Check for Updates' menu action +* Change startup to update packages only if package auto update is enabled or via notification +* Change don't check direct reference specification updates if user mode ### 0.23.9 (2021-01-28 19:45:00 UTC) diff --git a/recommended.txt b/recommended.txt index 2c908fe..cb4ea08 100644 --- a/recommended.txt +++ b/recommended.txt @@ -3,14 +3,15 @@ cryptography <= 3.2.1; '3.0' > python_version lxml >= 4.6.1 pip >= 20.0.0; '3.7' <= python_version pip <= 19.3.1; '3.0' > python_version -python-Levenshtein >= 0.12.0 +python-Levenshtein >= 0.12.0; '3.7' <= python_version python-Levenshtein@https://raw.githubusercontent.com/wiki/SickGear/SickGear/packages/python_Levenshtein-0.12.0-cp39-cp39-win_amd64.whl ; '3.9' == python_version and 'Windows' == platform_system and ('AMD64' == platform_machine or 'x86_64' == platform_machine) python-Levenshtein@https://raw.githubusercontent.com/wiki/SickGear/SickGear/packages/python_Levenshtein-0.12.0-cp38-cp38-win_amd64.whl ; '3.8' == python_version and 'Windows' == platform_system and ('AMD64' == platform_machine or 'x86_64' == platform_machine) python-Levenshtein@https://raw.githubusercontent.com/wiki/SickGear/SickGear/packages/python_Levenshtein-0.12.0-cp37-cp37m-win_amd64.whl ; '3.7' == python_version and 'Windows' == platform_system and ('AMD64' == platform_machine or 'x86_64' == platform_machine) -python-Levenshtein@https://raw.githubusercontent.com/wiki/SickGear/SickGear/packages/python_Levenshtein-0.12.0-cp27-cp27m-win_amd64.whl ; '2.7' == python_version and 'Windows' == platform_system and ('AMD64' == platform_machine or 'x86_64' == platform_machine) python-Levenshtein@https://raw.githubusercontent.com/wiki/SickGear/SickGear/packages/python_Levenshtein-0.12.0-cp39-cp39-win32.whl ; '3.9' == python_version and 'Windows' == platform_system and ('AMD64' != platform_machine and 'x86_64' != platform_machine) python-Levenshtein@https://raw.githubusercontent.com/wiki/SickGear/SickGear/packages/python_Levenshtein-0.12.0-cp38-cp38-win32.whl ; '3.8' == python_version and 'Windows' == platform_system and ('AMD64' != platform_machine and 'x86_64' != platform_machine) python-Levenshtein@https://raw.githubusercontent.com/wiki/SickGear/SickGear/packages/python_Levenshtein-0.12.0-cp37-cp37m-win32.whl ; '3.7' == python_version and 'Windows' == platform_system and ('AMD64' != platform_machine and 'x86_64' != platform_machine) +python-Levenshtein == 0.12.0; '3.0' > python_version +python-Levenshtein@https://raw.githubusercontent.com/wiki/SickGear/SickGear/packages/python_Levenshtein-0.12.0-cp27-cp27m-win_amd64.whl ; '2.7' == python_version and 'Windows' == platform_system and ('AMD64' == platform_machine or 'x86_64' == platform_machine) python-Levenshtein@https://raw.githubusercontent.com/wiki/SickGear/SickGear/packages/python_Levenshtein-0.12.0-cp27-cp27m-win32.whl ; '2.7' == python_version and 'Windows' == platform_system and ('AMD64' != platform_machine and 'x86_64' != platform_machine) regex >= 2020.11.1; '3.7' <= python_version regex <= 2020.10.28; '3.0' > python_version diff --git a/sickbeard/__init__.py b/sickbeard/__init__.py index 0d4f8ca..1706b6e 100755 --- a/sickbeard/__init__.py +++ b/sickbeard/__init__.py @@ -1712,9 +1712,12 @@ def start(): started = True -def restart(soft=True): +def restart(soft=True, update_pkg=None): if not soft: + if update_pkg: + MY_ARGS.append('--update-pkg') + events.put(events.SystemEvent.RESTART) else: diff --git a/sickbeard/piper.py b/sickbeard/piper.py index 2edbc4e..551fa20 100644 --- a/sickbeard/piper.py +++ b/sickbeard/piper.py @@ -241,6 +241,15 @@ def _check_pip_env(pip_outdated=False, reset_fails=False): to_update = set(filter_list( lambda name: name in specifiers and names_outdated[name]['latest_version'] in specifiers[name], set(names_reco).intersection(set(names_outdated)))) + + # check whether to ignore direct reference specification updates if not dev mode + if not int(os.environ.get('CHK_URL_SPECIFIERS', 0)): + to_remove = set() + for cur_name in to_update: + if '@' in output_reco[cur_name] and cur_name in specifiers: + # direct reference spec update, is for a package met in the env, so remove update + to_remove.add(cur_name) + to_update = to_update.difference(to_remove) except (BaseException, Exception): pass diff --git a/sickbeard/version_checker.py b/sickbeard/version_checker.py index 1c32056..87cc710 100644 --- a/sickbeard/version_checker.py +++ b/sickbeard/version_checker.py @@ -88,7 +88,7 @@ class PackagesUpdater(object): if not sickbeard.UPDATE_PACKAGES_AUTO: msg = '%s available — Update Now' % ( - self.install_type, '%s/home/restart/?pid=%s' % (sickbeard.WEB_ROOT, sickbeard.PID)) + self.install_type, '%s/home/restart/?update_pkg=1&pid=%s' % (sickbeard.WEB_ROOT, sickbeard.PID)) if None is sickbeard.NEWEST_VERSION_STRING: sickbeard.NEWEST_VERSION_STRING = '' if msg not in sickbeard.NEWEST_VERSION_STRING: diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index ef5575a..9e11d2c 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1884,7 +1884,7 @@ class Home(MainHandler): return t.respond() - def restart(self, pid=None): + def restart(self, update_pkg=None, pid=None): if str(pid) != str(sickbeard.PID): return self.redirect('/home/') @@ -1892,7 +1892,7 @@ class Home(MainHandler): t = PageTemplate(web_handler=self, file='restart.tmpl') t.shutdown = False - sickbeard.restart(soft=False) + sickbeard.restart(soft=False, update_pkg=bool(helpers.try_int(update_pkg))) return t.respond() diff --git a/sickgear.py b/sickgear.py index 8e66934..a6c4dee 100755 --- a/sickgear.py +++ b/sickgear.py @@ -214,7 +214,7 @@ class SickGear(object): try: opts, args = getopt.getopt(sys.argv[1:], 'hfqdsp::', ['help', 'forceupdate', 'quiet', 'nolaunch', 'daemon', 'systemd', 'pidfile=', - 'port=', 'datadir=', 'config=', 'noresize', 'update-restart']) + 'port=', 'datadir=', 'config=', 'noresize', 'update-restart', 'update-pkg']) except getopt.GetoptError: sys.exit(self.help_message()) @@ -503,12 +503,17 @@ class SickGear(object): logger.log_error_and_exit(u'Restore FAILED!') update_arg = '--update-restart' - if update_arg not in sickbeard.MY_ARGS and sickbeard.UPDATES_TODO: + manual_update_arg = '--update-pkg' + if update_arg not in sickbeard.MY_ARGS and sickbeard.UPDATES_TODO \ + and (manual_update_arg in sickbeard.MY_ARGS or sickbeard.UPDATE_PACKAGES_AUTO): sickbeard.MEMCACHE['update_restart'] = piper.pip_update( sickbeard.classes.loading_msg, sickbeard.UPDATES_TODO, sickbeard.DATA_DIR) sickbeard.UPDATES_TODO = dict() sickbeard.save_config() + if manual_update_arg in sickbeard.MY_ARGS: + sickbeard.MY_ARGS.remove(manual_update_arg) + if not sickbeard.MEMCACHE.get('update_restart'): # Build from the DB to start with sickbeard.classes.loading_msg.message = 'Loading shows from db'