copy -> dump plugin migration

Martin Winter mwinter at opensourcerouting.org
Fri Sep 2 22:35:16 UTC 2016


So I’ve updated the quagga snap from using the copy plugin to the dump 
plugin.
I’ve got it working, but it looks like a horrible hack using the dump 
plugin
to copy files.
I use it to copy default configs to the correct location.

This is what I had before using the copy plugin:

[…]
     quagga-defaults:
         plugin: copy
         source: defaults
         files:
             "*.conf.default": /etc/quagga/
[…]

and this is what I use now with the dump plugin:

[…]
     quagga-defaults:
         plugin: dump
         source: defaults
         organize:
             zebra.conf.default: etc/quagga/zebra.conf.default
             bgpd.conf.default: etc/quagga/bgpd.conf.default
             isisd.conf.default: etc/quagga/isisd.conf.default
             ospf6d.conf.default: etc/quagga/ospf6d.conf.default
             ospfd.conf.default: etc/quagga/ospfd.conf.default
             pimd.conf.default: etc/quagga/pimd.conf.default
             ripd.conf.default: etc/quagga/ripd.conf.default
             ripngd.conf.default: etc/quagga/ripngd.conf.default
[…]

Observations:
I want to copy all files from my “defaults” directory (in the 
snapcraft build dir)
to $SNAP/etc/quagga.
The dump plugin doesn’t seem to support a destination, except with the 
“organize”
function. And the “organize” function doesn’t support wildcards.

This looks to me like bad code, but I can’t find a way to make this 
cleaner (better
doc for the dump plugin would be highly appreciated)

Maybe someone can comment on a better way? (It DOES WORK as shown, just 
trying to
get feedback on a better/cleaner way, preferably with wildcard matching)

- Martin Winter




More information about the Snapcraft mailing list