Fixed an issue when pio package pack ignores some folders // Resolve #3730

This commit is contained in:
Ivan Kravets
2020-11-12 16:06:54 +02:00
parent 9ff3c758eb
commit 2817408db3
2 changed files with 11 additions and 5 deletions

View File

@ -11,11 +11,12 @@ PlatformIO Core 5
5.0.3 (2020-??-??)
~~~~~~~~~~~~~~~~~~
- Added an error selector for `Sublime Text <https://docs.platformio.org/en/latest/integration/ide/sublimetext.html>`__ build runner (`issue #3733 <https://github.com/platformio/platformio-core/issues/3733>`_)
- Added an error selector for `Sublime Text <https://docs.platformio.org/page/integration/ide/sublimetext.html>`__ build runner (`issue #3733 <https://github.com/platformio/platformio-core/issues/3733>`_)
- Generate a working "projectEnvName" for PlatformIO IDE's debugger for VSCode
- Force VSCode's intelliSenseMode to "gcc-x64" when GCC toolchain is used
- Print ignored test suites and environments in the test summary report only in verbose mode (`issue #3726 <https://github.com/platformio/platformio-core/issues/3726>`_)
- Fixed an issue when the package manager tries to install a built-in library from the registry (`issue #3662 <https://github.com/platformio/platformio-core/issues/3662>`_)
- Fixed an issue when `pio package pack <https://docs.platformio.org/page/core/userguide/package/cmd_pack.html>`__ ignores some folders (`issue #3730 <https://github.com/platformio/platformio-core/issues/3730>`_)
5.0.2 (2020-10-30)
~~~~~~~~~~~~~~~~~~

View File

@ -46,6 +46,8 @@ class PackagePacker(object):
".git/",
".hg/",
".svn/",
]
EXCLUDE_EXTRA = [
# Tests
"tests?",
# Docs
@ -120,7 +122,6 @@ class PackagePacker(object):
src = tmp_dir
src = self.find_source_root(src)
manifest = self.load_manifest(src)
filename = self.get_archive_name(
manifest["name"],
@ -188,7 +189,7 @@ class PackagePacker(object):
return dst
def compute_src_filters(self, src, include, exclude):
exclude_default = self.EXCLUDE_DEFAULT[:]
exclude_extra = self.EXCLUDE_EXTRA[:]
# extend with library extra filters
if any(
os.path.isfile(os.path.join(src, name))
@ -198,11 +199,15 @@ class PackagePacker(object):
ManifestFileType.MODULE_JSON,
)
):
exclude_default.extend(self.EXCLUDE_LIBRARY_EXTRA)
exclude_extra.extend(self.EXCLUDE_LIBRARY_EXTRA)
result = ["+<%s>" % p for p in include or ["*", ".*"]]
result += ["-<%s>" % p for p in self.EXCLUDE_DEFAULT]
# exclude items declared in manifest
result += ["-<%s>" % p for p in exclude or []]
result += ["-<%s>" % p for p in exclude_default]
# apply extra excludes if no custom "export" field in manifest
if not include and not exclude:
result += ["-<%s>" % p for p in exclude_extra]
# automatically include manifests
result += ["+<%s>" % p for p in self.INCLUDE_DEFAULT]
return result