Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/src/tar/write: make sure we add the links when filtering the tar #251

Merged
merged 1 commit into from Feb 21, 2022

Conversation

jmarrero
Copy link
Member

No description provided.

@jmarrero jmarrero force-pushed the write-tars branch 3 times, most recently from 5f0bb35 to 52dfdbc Compare February 18, 2022 02:23
@jmarrero
Copy link
Member Author

The output of:

        println!("Entry link_name {:?}", entry.link_name()?);
        println!("Header link_name {:?}", header.link_name()?);

Shows:

Entry link_name Some("usr/lib/python3.10/site-packages/setuptools/_distutils/command/__pycache__/register.cpython-310.opt-1.pyc")

Header link_name Some("usr/lib/python3.10/site-packages/setuptools/_distutils/command/__pycache__/register.cpython-310.opt-")

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks so much for tracking this down!

Comment on lines 160 to 162
// Need to use the entry.link_name not the header.link_name
// as it is shortened for some reason...
let target_link = entry.link_name()?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be cleanest if we dispatched on the entry type, like this:

match entry.header().entry_type() {
  tar::EntryType::Link | tar::EntryType::Symlink => { /* use append_link() * }
  o => { dest.append_data(&mut header, normalized, entry }
}

or so?

It's also worth referencing e.g. alexcrichton/tar-rs#192 here

Co-authored-by: Colin Walters <walters@verbum.org>
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@cgwalters cgwalters merged commit c6ae68d into ostreedev:main Feb 21, 2022
cgwalters added a commit to cgwalters/rpm-ostree that referenced this pull request Jun 9, 2022
This pulls in ostreedev/ostree-rs-ext#251
at least which I believe is the patch which fixes the
errors we're seeing when package layering in some cases.

xref https://bugzilla.redhat.com/show_bug.cgi?id=2095528
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.

None yet

2 participants