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

Cannot create empty file (for mutable) #6

Open
woky opened this issue Jun 10, 2022 · 0 comments
Open

Cannot create empty file (for mutable) #6

woky opened this issue Jun 10, 2022 · 0 comments

Comments

@woky
Copy link
Contributor

woky commented Jun 10, 2022

In order to write a file, it has to be listed in contents as mutable. However, if the file doesn't exist in package archive, it has to be created with non-empty text, otherwise chisel fails with no content error.

Demonstration:

$ cat slices/ca-certificates.yaml
package: ca-certificates
slices:
  data:
    contents:
      /etc/ssl/certs/ca-certificates.crt: { text: "", mutable: true }
    mutate: |
      content.write("/etc/ssl/certs/ca-certificates.crt", "foobar")
$ chisel cut --release $PWD --root ~/tmp/chisel-out ca-certificates_data
...
2022/06/10 09:07:38 Extracting files from package "ca-certificates"...
error: cannot extract from package "ca-certificates": no content at /etc/ssl/certs/ca-certificates.crt

It works when I explicitly set file text to non-empty value, e.g.:

$ cat slices/ca-certificates.yaml
package: ca-certificates
slices:
  data:
    contents:
      /etc/ssl/certs/ca-certificates.crt: { text: "todo", mutable: true }
    mutate: |
      content.write("/etc/ssl/certs/ca-certificates.crt", "foobar")
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

No branches or pull requests

1 participant