Changeset View
Changeset View
Standalone View
Standalone View
swh/core/tarball.py
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | def compress(tarpath, nature, dirpath_or_files): | ||||
return tarpath | return tarpath | ||||
# Additional uncompression archive format support | # Additional uncompression archive format support | ||||
ADDITIONAL_ARCHIVE_FORMATS = [ | ADDITIONAL_ARCHIVE_FORMATS = [ | ||||
# name, extensions, function | # name, extensions, function | ||||
("tar.Z|x", [".tar.Z", ".tar.x"], _unpack_tar), | ("tar.Z|x", [".tar.Z", ".tar.x"], _unpack_tar), | ||||
("jar", [".jar"], _unpack_jar), | ("jar|war", [".jar", ".war"], _unpack_jar), | ||||
( | |||||
"love|oxt|pak|vsix|VSIXPAckage|war|whl", | |||||
[".love", ".oxt", ".pak", ".vsix", ".VSIXPavkage"], | |||||
_unpack_zip, | |||||
), | |||||
anlambert: Those can be removed as mime type is used as last resort to guess tarball format (check… | |||||
ardumontAuthorUnsubmitted Done Inline Actionsyes, thanks, i have it locally. ardumont: yes, thanks, i have it locally.
I'm just trying to get why the build fails prior to update the… | |||||
ardumontAuthorUnsubmitted Done Inline Actionsfound it. ardumont: found it. | |||||
ardumontAuthorUnsubmitted Done Inline Actions
I meant the issue with the build.
I've seen the code you mentioned indeed. And i've double checked it against the new It's exactly as it needs to be processed so great ;) In [1]: from pathlib import Path In [2]: dir_ = Path('/var/tmp/nixguix/manifest-files-output/') In [3]: all_tarballs = list(dir_.iterdir()) In [4]: import magic In [5]: m = magic.Magic(mime=True) In [12]: [(m.from_file(str(tarpath)), str(tarpath)) for tarpath in all_tarballs if str(tarpath).endswith(('.whl', '.love', '.pak', '.oxt', '.vsix', '.VSIXPackage'))] Out[12]: [('application/zip', 'manifest-files-output/Microsoft.VisualStudio.Services.VSIXPackage'), ('application/zip', 'manifest-files-output/da_DK-2.5.189.oxt'), ('application/zip', 'manifest-files-output/vapor_dbf509f.love'), ('application/zip', 'manifest-files-output/ms-python-release.vsix'), ('application/zip', 'manifest-files-output/streamlit-0.50.2-py2.py3-none-any.whl'), ('application/zip', 'manifest-files-output/NotoFonts.pak')] ardumont: > found it
I meant the issue with the build.
> Those can be removed as mime type is used as… | |||||
("tbz2", [".tbz", "tbz2"], _unpack_tar), | ("tbz2", [".tbz", "tbz2"], _unpack_tar), | ||||
# FIXME: make this optional depending on the runtime lzip package install | # FIXME: make this optional depending on the runtime lzip package install | ||||
("tar.lz", [".tar.lz"], _unpack_tar), | ("tar.lz", [".tar.lz"], _unpack_tar), | ||||
("crate", [".crate"], _unpack_tar), | ("crate", [".crate"], _unpack_tar), | ||||
("tar.zst", [".tar.zst", ".tar.zstd"], _unpack_zst), | ("tar.zst", [".tar.zst", ".tar.zstd"], _unpack_zst), | ||||
] | ] | ||||
register_new_archive_formats() | register_new_archive_formats() |
Those can be removed as mime type is used as last resort to guess tarball format (check MIMETYPE_TO_ARCHIVE_FORMAT in the same file).