Skip to content

Bundle unpacking logic fails with tk-multi-setframerange #1023

@th-pmacdonald

Description

@th-pmacdonald

# - if the zip contains a single folder with all content inside,
# assume the bundle is contained inside this structure. This is
# a common scenario if a user has created a zip by right clicking on it
# and selected 'create archive' or 'send to zip'.
# compute number of unique root folders
# note: zip module uses forward slash on all operating systems
root_items = set(
[item.split("/")[0] for item in zip_obj.namelist() if "/" in item]
)
# remove certain system items
root_items -= SYSTEM_FILE_ITEMS
if len(root_items) == 1:

If the toolkit bundle zip has only a single folder, then it unpacks that folder as the bundle, not the root of the zip.
This works for most packages, but for tk-multi-setframerange, this causes only the hooks folder being unpacked.

Suggested fix : Check for info.yml in the root folder as this is a clear indication of a shotgrid toolkit bundle.
Or check that if there is only a single folder, that there are no files in the root folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions