organize keyword does not accept globs to organize into a target directory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Medium
|
Sergio Schvezov |
Bug Description
Hi,
bug 1597600 got closed by adding the dump plugin, but I have found challenges to migrate from copy to dump/nil in my case.
The case:
So far I used the copy plugin (now deprecated) to achive the following:
- copy a file from the local source (source: .) into the snap to be installed
- copy it into the snap under a different name (using the file feature of copy)
Here a slimmed down snippet of my old snapcraft.yaml
defaultconf:
plugin: copy
files:
etc/use*: etc/
Here (one of many) tries using dump:
defaultconf:
plugin: dump
source: etc
organize:
etc/use*: etc/
I had various similar tries with/without the "filesets" and "snap" keys as well as trying the nil plugin to only use filesets/organize features.
But none worked.
Most of the times I end up with the system complaining that the files are not at .../install/.. like:
FileNotFoundError: [Errno 2] No such file or directory: '/home/
But that is just what I used the copy plugin for before - adding extra files that got not added by the app's "make&install" step.
I'm sure it is not too hard, but it seems I can't get there by trial and error.
And neither doc nor IRC got it resolved, hence the bug report.
Changed in snapcraft: | |
milestone: | none → 2.17 |
Changed in snapcraft: | |
importance: | Undecided → Medium |
status: | New → Triaged |
tags: | added: plugin |
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
Yeah you've just hit a bit of a limitation in the `organize` keyword, where you can't use globbing like the copy plugin supported. You need to be more explicit, e.g.
plugin: dump
example. conf: etc/ntp.conf
user1. conf: etc/user1.conf
user2. conf: etc/user2.conf
source: etc
organize:
Note also that since `source: etc` organize refers to the files relative to source. I also made some dumb assumptions about what the etc/use* files were actually named.
These limitations should definitely be resolved in order for the dump plugin to actually replace the copy plugin in functionality.