Skip to content

Conversation

@jeckersb
Copy link
Collaborator

  • ostree-ext/tar/export: add unmap_path and rework map_path to share inner fn
  • ostree-ext/tar/export: add test_unmap_path and update test_map_path to use as_os_str()
  • ostree-ext: Add tar_create_parent_dirs to container::ExportOpts

jeckersb added 3 commits June 11, 2025 15:50
…ner fn

In preparation for (un)mapping tar stream data back to ostree data so
we can look up the correct metadata for a given tar entry
…o use `as_os_str()`

We want to compare the actual os_str here, because `Eq` on Paths
canonicalizes and removes any trailing '/', but ostree makes a
distinction between trailing '/' or not.  For example:

```
    let p1 = Path::new("/foo");
    let p2 = Path::new("/foo/");
    assert_eq!(p1, p2);
    println!("{:?} {:?}", p1.as_os_str(), p2.as_os_str());
```

Will print:

"/foo" "/foo/"

Signed-off-by: John Eckersberg <[email protected]>
Part of coreos/rpm-ostree#5416

Default to previous behavior and do *not* create parent directories,
however for reproducible builds we need to ensure we create them with
consistent metadata.

See also containers/composefs-rs#132

Signed-off-by: John Eckersberg <[email protected]>
@jeckersb jeckersb changed the title mtime ostree-ext: Add tar_create_parent_dirs to container::ExportOpts Jun 11, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new feature to create parent directories in tar layers during ostree export. It also refactors path mapping functions and adds associated tests. The changes look good.

Copy link
Contributor

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

@jeckersb jeckersb merged commit a9f01fe into bootc-dev:main Jun 12, 2025
34 checks passed
jeckersb added a commit to jeckersb/rpm-ostree that referenced this pull request Jun 12, 2025
Primarily to pull in bootc-dev/bootc#1364

Signed-off-by: John Eckersberg <[email protected]>
jeckersb added a commit to jeckersb/rpm-ostree that referenced this pull request Jun 16, 2025
Primarily to pull in bootc-dev/bootc#1364

Signed-off-by: John Eckersberg <[email protected]>
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.

2 participants