Skip to content

fix: handle fn field conversion for archive source files#503

Closed
xingzihai wants to merge 1 commit intoconda:mainfrom
xingzihai:handle-fn-archive-source
Closed

fix: handle fn field conversion for archive source files#503
xingzihai wants to merge 1 commit intoconda:mainfrom
xingzihai:handle-fn-archive-source

Conversation

@xingzihai
Copy link
Copy Markdown

Fixes #500

For archive source files (.tar.gz, .zip, .7z, etc.), converting fn to file_name changes behavior in V1 format. In V1, file_name on archives disables automatic extraction, which is not desired.

Changes:

  • Add ARCHIVE_FILE_EXTENSION regex to detect archive file extensions
  • For archive sources, remove fn field and warn user
  • For non-archive sources, perform normal fn -> file_name conversion
  • Update tests to verify the new behavior

Testing:

  • Updated test files to reflect the new behavior
  • Archive sources now correctly remove fn with a warning
  • Non-archive sources still convert fn to file_name

This ensures that archive sources maintain automatic extraction behavior when converting from V0 to V1 format.

Issue conda#500: For archive source files, converting fn to file_name changes behavior
In V1, file_name on archives disables automatic extraction, which is not desired

Changes:
- Add ARCHIVE_FILE_EXTENSION regex to detect archive file extensions
- For archive sources, remove fn field and warn user
- For non-archive sources, perform normal fn -> file_name conversion
- Update tests to verify the new behavior

Fixes conda#500
@conda-bot
Copy link
Copy Markdown
Contributor

We require contributors to sign our Contributor License Agreement and we don't have one on file for @xingzihai.

In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature, merge the PR (conda/infrastructure#1307), and ping the bot to refresh the PR.

@schuylermartin45
Copy link
Copy Markdown
Collaborator

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

convert: what to do with fn and archive source files

3 participants