forked from platformio/platformio-core
Disabled automatic removal of unnecessary development platform packages // Resolve #3708 , Resolve #/3770
This commit is contained in:
@ -15,6 +15,7 @@ PlatformIO Core 5
|
||||
* Improved listing of `multicast DNS services <https://docs.platformio.org/page/core/userguide/device/cmd_list.html>`_
|
||||
* Check for debugging server's "ready_pattern" in "stderr"
|
||||
* Upgraded build engine to the SCons 4.1 (`release notes <https://scons.org/scons-410-is-available.html>`_)
|
||||
* Disabled automatic removal of unnecessary development platform packages (`issue #3708 <https://github.com/platformio/platformio-core/issues/3708>`_, `issue #3770 <https://github.com/platformio/platformio-core/issues/3770>`_)
|
||||
* Fixed a "UnicodeDecodeError: 'utf-8' codec can't decode byte" when using J-Link for firmware uploading on Linux (`issue #3804 <https://github.com/platformio/platformio-core/issues/3804>`_)
|
||||
* Fixed an issue with Python 3.8+ on Windows when a network drive is used (`issue #3417 <https://github.com/platformio/platformio-core/issues/3417>`_)
|
||||
* Fixed an issue when "strict" compatibility mode was not used for a library with custom "platforms" field in `library.json <https://docs.platformio.org/page/librarymanager/config.html>`__ manifest (`issue #3806 <https://github.com/platformio/platformio-core/issues/3806>`_)
|
||||
|
@ -69,7 +69,6 @@ class PlatformPackageManager(BasePackageManager): # pylint: disable=too-many-an
|
||||
)
|
||||
p.install_python_packages()
|
||||
p.on_installed()
|
||||
self.autoremove_packages(list(p.packages))
|
||||
return pkg
|
||||
|
||||
def uninstall(self, spec, silent=False, skip_dependencies=False):
|
||||
@ -83,7 +82,6 @@ class PlatformPackageManager(BasePackageManager): # pylint: disable=too-many-an
|
||||
if not skip_dependencies:
|
||||
p.uninstall_python_packages()
|
||||
p.on_uninstalled()
|
||||
self.autoremove_packages(list(p.packages))
|
||||
return pkg
|
||||
|
||||
def update( # pylint: disable=arguments-differ, too-many-arguments
|
||||
@ -118,8 +116,6 @@ class PlatformPackageManager(BasePackageManager): # pylint: disable=too-many-an
|
||||
)
|
||||
|
||||
p.update_packages(only_check)
|
||||
if not only_check:
|
||||
self.autoremove_packages(list(p.packages))
|
||||
|
||||
if missed_pkgs:
|
||||
p.install_packages(
|
||||
@ -128,34 +124,6 @@ class PlatformPackageManager(BasePackageManager): # pylint: disable=too-many-an
|
||||
|
||||
return new_pkg or pkg
|
||||
|
||||
def autoremove_packages(self, names):
|
||||
self.memcache_reset()
|
||||
required = {}
|
||||
for platform in PlatformPackageManager().get_installed():
|
||||
p = PlatformFactory.new(platform)
|
||||
for pkg in p.get_installed_packages():
|
||||
if pkg.metadata.name not in required:
|
||||
required[pkg.metadata.name] = set()
|
||||
required[pkg.metadata.name].add(pkg.metadata.version)
|
||||
|
||||
pm = ToolPackageManager()
|
||||
for pkg in pm.get_installed():
|
||||
skip_conds = [
|
||||
pkg.metadata.name not in names,
|
||||
pkg.metadata.spec.url,
|
||||
pkg.metadata.name in required
|
||||
and pkg.metadata.version in required[pkg.metadata.name],
|
||||
]
|
||||
if any(skip_conds):
|
||||
continue
|
||||
try:
|
||||
pm.uninstall(pkg.metadata.spec)
|
||||
except UnknownPackageError:
|
||||
pass
|
||||
|
||||
self.memcache_reset()
|
||||
return True
|
||||
|
||||
@util.memoized(expire="5s")
|
||||
def get_installed_boards(self):
|
||||
boards = []
|
||||
|
Reference in New Issue
Block a user