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

content.list() fails with "cannot read file not selected" in every case #7

Closed
woky opened this issue Jun 10, 2022 · 2 comments
Closed

Comments

@woky
Copy link
Contributor

woky commented Jun 10, 2022

I've tried to use content.list() in ca-certificates_data slice. Below are several variants I've tried, none of which worked. (For text: todo please see #6).

$ cat slices/ca-certificates.yaml
package: ca-certificates
slices:
  data:
    contents:
      /etc/ssl/certs/ca-certificates.crt: { text: todo, mutable: true }
      /usr/share/ca-certificates/mozilla/*.crt:
    mutate: |
      certs = [content.read(path) for path in content.list("/usr/share/ca-certificates/mozilla/")]
      content.write("/etc/ssl/certs/ca-certificates.crt", "".join(certs))
$ chisel cut --release $PWD --root ~/tmp/chisel-out ca-certificates_data
...
2022/06/10 09:14:23 Extracting files from package "ca-certificates"...
error: slice ca-certificates_data: cannot read file not selected: /usr/share/ca-certificates/mozilla

More variants of contents that produce the same error:

    contents:
      /etc/ssl/certs/ca-certificates.crt: { text: todo, mutable: true }
      /usr/share/ca-certificates/mozilla/:
      /usr/share/ca-certificates/mozilla/*.crt:
    contents:
      /etc/ssl/certs/ca-certificates.crt: { text: todo, mutable: true }
      /usr/share/ca-certificates/mozilla/:
      /usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt:
@woky
Copy link
Contributor Author

woky commented Jun 14, 2022

The variant

    contents:
      /etc/ssl/certs/ca-certificates.crt: { text: todo, mutable: true }
      /usr/share/ca-certificates/mozilla/:
      /usr/share/ca-certificates/mozilla/*.crt:

now works. Pretty sure I've tried it before. Maybe I was using relative --root. Is the directory supposed to be listed explicitly when I want to list() it?

@woky
Copy link
Contributor Author

woky commented Jun 29, 2022

It works now as said in previous comment. Closing...

@woky woky closed this as completed Jun 29, 2022
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