bro-pkg upgrade and over-writing of files

Hello,

I have a package where I provide a sample configuration file for people to redef according to their needs and specifics.

Now everytime when they upgrade the package, I risk over writing their modified config file.

SO I decided to call the config file scan-config.bro.orig but then I am running into issues of which one to load and how to determine the presence of an already existing scan-config.bro in __load__.bro

The idea of asking uses to redef outside package directory might be cumbersome for unfamiliar users.

Any thoughts ?

Aashish

At the moment, the best thing would be to ask users to explicitly copy/modify/@load the sample config file somewhere in the site/ dir.

But a new feature could be added to bro-pkg that allows package authors to specify a list of config files in their bro-pkg.meta. Then on install/upgrade/remove, if a user has made modifications to any of those files, they can be warned/prompted about how to proceed (show a diff, ask to overwrite or keep modified version, etc.). This seems a common way to handle config files in the package management scene.

Would such a feature work for you?

- Jon

But a new feature could be added to bro-pkg that allows package authors to specify a list of config files in their bro-pkg.meta. Then on install/upgrade/remove, if a user has made modifications to any of those files, they can be warned/prompted about how to proceed (show a diff, ask to overwrite or keep modified version, etc.). This seems a common way to handle config files in the package management scene.

I like the idea of warned/prompted (show a diff, ask to overwrite or keep new version etc) is good. That helps with situations where a new variables introduced in in a config file after the upgrade also don't go unnoticed.

Would such a feature work for you?

Yes absolutely. This would be rather perfect.

Thank you,
Aashish

In bro-pkg 0.9, there’s now a config_files field [1] you can put in bro-pkg.meta to prevent bro-pkg operations from clobbering local user modifications to certain files.

- Jon

[1] http://bro-package-manager.readthedocs.io/en/stable/package.html#config-files