Currernt config hook implementation scales very badly

Mark Shuttleworth mark at ubuntu.com
Thu Feb 2 10:16:57 UTC 2017


On 02/02/17 03:16, Stuart Bishop wrote:
>
>
> On 1 February 2017 at 21:48, Michael Hall <mhall119 at ubuntu.com
> <mailto:mhall119 at ubuntu.com>> wrote:
>
>     On a related note, does anybody have a suggestion on a lightweight way
>     of programmatically modifying configs in .ini, XML or JSON?
>
>     I have a couple of use-cases (erlang-based nosql databases) where the
>     server updates the the local configuration, so I can't just overwrite
>     the whole thing every time. Didier's example will work for a very
>     basic
>     key=value config file, but not something more structured, and I'd hate
>     to introduce Python, Perl or Java just for this.
>
>
> Really? I thought Python was an excellent choice, and built and staged
> all my wrappers as a Python part. 'core' already has Python3, so it
> isn't bloating the snap size. And it makes it a doddle to manipulate
> json, yaml or ini files, when this sort of thing requires an expert to
> do correctly in bash or dash.
>
> (but look at 'jq' if you insist on shell scripts - it seemed very
> helpful for dealing with json)

I would strongly +1 python3 from the core snap for general hook
authorship. It's always there, it's perfectly fast for one-time
operations, it's comfortable for text handling, it's
architecture-independent with small files.

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20170202/10a9fb7e/attachment.html>


More information about the Snapcraft mailing list