forked from platformio/platformio-core
Do not shutdown PIO Home Server for "upgrade" operations // Resolve #2784
This commit is contained in:
@ -10,6 +10,7 @@ PlatformIO 4.0
|
|||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
* Print `debug tool <http://docs.platformio.org/en/latest/plus/debugging.html#tools-debug-probes>`__ name for the active debugging session
|
* Print `debug tool <http://docs.platformio.org/en/latest/plus/debugging.html#tools-debug-probes>`__ name for the active debugging session
|
||||||
|
* Do not shutdown PIO Home Server for "upgrade" operations (`issue #2784 <https://github.com/platformio/platformio-core/issues/2784>`_)
|
||||||
* Fixed an issue with incorrect escaping of Windows slashes when using `PIO Unified Debugger <http://docs.platformio.org/en/latest/plus/debugging.html>`__ and "piped" openOCD
|
* Fixed an issue with incorrect escaping of Windows slashes when using `PIO Unified Debugger <http://docs.platformio.org/en/latest/plus/debugging.html>`__ and "piped" openOCD
|
||||||
|
|
||||||
4.0.0 (2019-07-10)
|
4.0.0 (2019-07-10)
|
||||||
|
@ -21,7 +21,6 @@ import requests
|
|||||||
|
|
||||||
from platformio import VERSION, __version__, exception, util
|
from platformio import VERSION, __version__, exception, util
|
||||||
from platformio.compat import WINDOWS
|
from platformio.compat import WINDOWS
|
||||||
from platformio.managers.core import shutdown_piohome_servers
|
|
||||||
from platformio.proc import exec_command, get_pythonexe_path
|
from platformio.proc import exec_command, get_pythonexe_path
|
||||||
from platformio.project.helpers import get_project_cache_dir
|
from platformio.project.helpers import get_project_cache_dir
|
||||||
|
|
||||||
@ -38,9 +37,6 @@ def cli(dev):
|
|||||||
|
|
||||||
click.secho("Please wait while upgrading PlatformIO ...", fg="yellow")
|
click.secho("Please wait while upgrading PlatformIO ...", fg="yellow")
|
||||||
|
|
||||||
# kill all PIO Home servers, they block `pioplus` binary
|
|
||||||
shutdown_piohome_servers()
|
|
||||||
|
|
||||||
to_develop = dev or not all(c.isdigit() for c in __version__ if c != ".")
|
to_develop = dev or not all(c.isdigit() for c in __version__ if c != ".")
|
||||||
cmds = (["pip", "install", "--upgrade",
|
cmds = (["pip", "install", "--upgrade",
|
||||||
get_pip_package(to_develop)], ["platformio", "--version"])
|
get_pip_package(to_develop)], ["platformio", "--version"])
|
||||||
|
@ -16,9 +16,6 @@ import os
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from os.path import dirname, join
|
from os.path import dirname, join
|
||||||
from time import sleep
|
|
||||||
|
|
||||||
import requests
|
|
||||||
|
|
||||||
from platformio import __version__, exception, util
|
from platformio import __version__, exception, util
|
||||||
from platformio.compat import PY2, WINDOWS
|
from platformio.compat import PY2, WINDOWS
|
||||||
@ -99,25 +96,10 @@ def update_core_packages(only_check=False, silent=False):
|
|||||||
if not pkg_dir:
|
if not pkg_dir:
|
||||||
continue
|
continue
|
||||||
if not silent or pm.outdated(pkg_dir, requirements):
|
if not silent or pm.outdated(pkg_dir, requirements):
|
||||||
if name == "tool-pioplus" and not only_check:
|
|
||||||
shutdown_piohome_servers()
|
|
||||||
if WINDOWS:
|
|
||||||
sleep(1)
|
|
||||||
pm.update(name, requirements, only_check=only_check)
|
pm.update(name, requirements, only_check=only_check)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def shutdown_piohome_servers():
|
|
||||||
port = 8010
|
|
||||||
while port < 8050:
|
|
||||||
try:
|
|
||||||
requests.get("http://127.0.0.1:%d?__shutdown__=1" % port,
|
|
||||||
timeout=0.01)
|
|
||||||
except: # pylint: disable=bare-except
|
|
||||||
pass
|
|
||||||
port += 1
|
|
||||||
|
|
||||||
|
|
||||||
def inject_contrib_pysite():
|
def inject_contrib_pysite():
|
||||||
from site import addsitedir
|
from site import addsitedir
|
||||||
contrib_pysite_dir = get_core_package_dir("contrib-pysite")
|
contrib_pysite_dir = get_core_package_dir("contrib-pysite")
|
||||||
|
Reference in New Issue
Block a user