Skip to content

Fix: improve recreate() method in archive.py #9477

@ANKITAPRAMODPATIL

Description

@ANKITAPRAMODPATIL

Problem

The recreate() function in archive.py sometimes does not handle chunk processing correctly.
Issues observed:

  • process_items() may skip chunks incorrectly.
  • Chunks are not reused efficiently in process_chunks().
  • Target creation logic may trigger unnecessary rechunking.
  • matcher_add_tagged_dirs() may not exclude caches correctly.

Proposed Fix

  • Ensure all items are processed correctly in process_items().
  • Reuse chunks when possible to avoid duplication.
  • Improve target creation logic for proper rechunkify handling.
  • Enhance matcher_add_tagged_dirs() to handle CACHE_TAG_NAME correctly.

Steps to Reproduce

  1. Create an archive with multiple files and caches.
  2. Run recreate() with exclude_caches and exclude_if_present flags.
  3. Observe that some chunks are unnecessarily reprocessed.

Additional Notes

  • This change improves efficiency and prevents duplicate chunks.
  • Works with both dry_run and actual execution.

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