Install single file from stage-packages

Hi! I’m trying to include just /usr/bin/timeout from the GNU coreutils package, since its other binaries are already whitelisted. Why doesn’t this work?:

  timeout:
    plugin: nil
    stage-packages: [coreutils]
    prime:
      - -*
      - usr/bin/timeout

Remove - -*,

asciicast

I will need to look into why that is a problem though, I don’t think we support negative globing like this.

Many thanks!

I copied the negative globs from Github, where they appear multiple times: https://github.com/search?p=1&q=filename%3Asnapcraft.yaml+prime%3A&type=Code

Sometimes I’m following Github samples blindly - in this case, I couldn’t find the documentation for filesets on https://docs.snapcraft.io

True, the current documentation is under restructuring,some information can be found here https://docs.snapcraft.io/snapcraft-yaml-reference/4276

I will nudge @degville to get search functionality in and for a fix on those dead links.

In the meantime, snapcraft help plugins should give some relevant information.

Yeah, the dead link is for “Working with filesets”. The search works, but I think this particular page is missing. The command you gave me works, though!

Thank you again!

Thanks for the nudge! We’ve just added search - there’s now a Search the documentation field at the top of https://docs.snapcraft.io pages, although there will likely be further refinements.

The broken links have been fixed in the updated The snapcraft format reference material, but I need to go back and make the same changes to Snapcraft.yaml reference as I really don’t want to remove an easily searchable single page.

I’ll look into adding something on filesets.

1 Like

https://github.com/snapcore/snapcraft/blob/master/snapcraft/__init__.py has a good section on filesets

Excellent - thank you!