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

Pilet pack/tgz format includes entries for directories starting in version 0.15.x #629

Closed
3 tasks done
peter-at-work opened this issue Sep 29, 2023 · 0 comments · Fixed by #630
Closed
3 tasks done
Labels
bug Something isn't working cli Concerns the piral-cli application.
Milestone

Comments

@peter-at-work
Copy link
Contributor

peter-at-work commented Sep 29, 2023

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version?
  • Did you perform a search in the issues?

Environment Details and Version

Previous piral-cli version used: 0.14.32
New piral-cli version used: 1.2.0

Description

Starting with piral-cli 0.15.0, the npm packing process to generate the pilet package/tgz is replaced with a simpler tar packing process using the tar utility. a850ff7

With the new packing process, the directories/folders are included as 0-length items in the pack list and are included when enumerating the files in the pack. The entries for the directories/folders have additional information attached, such as the Unix file mode drwxr-xr-x.

The previous npm packing process did not include the directories/folders as entries in the pack list. npm apparently does not have any use of the additional information (Unix file mode) that is preserved by the tar utility.

Steps to Reproduce

  1. Using a pilet scaffolded with piral-cli version 0.14.32, pack the pilet: npx pilet pack
  2. Using a pilet scaffolded with piral-cli version 1.2.0 (0.15.0 or later), pack the pilet: npx pilet pack

7-zip flat view of the package built with piral-cli version 0.14.32:
image

7-zip flat view of the package built with piral-cli version 1.2.0:
image

Expected behavior

With the new pack process introduced in 0.15.0, it should still ignore directories/folders during packing, since the associated directories/folders attributes are not useful nor needed.

Possible Origin/Solution

Perhaps the filter option to the tar c() method can be utilized to filter out directories/folders https://github.com/isaacs/node-tar
Something like filter = (path, stat) => stat.isDirectory() ? false : true

@peter-at-work peter-at-work added the bug Something isn't working label Sep 29, 2023
@FlorianRappl FlorianRappl added cli Concerns the piral-cli application. in-review The item is currently being reviewed. labels Sep 30, 2023
@FlorianRappl FlorianRappl added this to the 1.3.0 milestone Sep 30, 2023
@FlorianRappl FlorianRappl added in-testing The item is already out in preview and can be tested. and removed in-review The item is currently being reviewed. labels Oct 1, 2023
FlorianRappl added a commit that referenced this issue Oct 1, 2023
@FlorianRappl FlorianRappl removed the in-testing The item is already out in preview and can be tested. label Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli Concerns the piral-cli application.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants