Install single file from stage-packages


#1

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

#2

Remove - -*,

asciicast

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


#3

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


#4

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.


#5

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!


#6

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.


#7

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


#8

Excellent - thank you!