-
Notifications
You must be signed in to change notification settings - Fork 10
Bug 808419 : opt-in for user feedback plugin #46
base: master
Are you sure you want to change the base?
Conversation
Thank you a lot! I will try to review this soon, but currently I am very busy.. |
no problem, take your time. :) |
This PR contains commits that edits commits in the PR itself. It would be good practice to squash some of the changes. Please pull the latest master and then rebase interactively with |
Here is a flawless example of a good PR and git commit messages: #47 You work is good, I can merge as-is if you don't have time to fixup a bit. I just thought that you a perhaps interested in learning to do things perfectly, as you are on path to become a Debian Developer. DD's in general love to perfect the details. |
Thanks for the feedback. I'll rework the PR and squash a few commits.
|
|
I have cleaned up the commit history by squashing a few commits |
All of the changes could fit in one single commit under the title "Add debconf question to enable User Feedback Plugin". Do you think it would be possible to not echo the config file inside the maint script but instead distribute it to all installations like all the other files under |
Yes, that would be better. I'm getting the hang of 'git rebase
I gave this some thought when I was investigating on how to create and "Note that a package should not modify a dpkg-handled conffile in its That's why the config file is generated with echo commands. [0] last paragraph of section E.1 on |
All the changes are in one commit now. :) |
I read this again now. Looks good. The only thing I wondered about is wheter echoing a config file is a good idea. What if the feedback.cnf config file was part of the packaging and always installed, but with all lines commented out? And then on activation the feedback=on line would have the #-characted stripped off. Also I wonder if you would be interested to adapt this as a PR against upstream github.com/mariadb/server branch 10.2? I think this would suit perfectly there as 10.2 is in beta stage and feedback is desperately needed there. |
Hi Otto, Thanks for reviewing. I read this again now. Looks good. The only thing I wondered about is
I'd prefer to generate the config file in another way than using a large I see some options :
Also I wonder if you would be interested to adapt this as a PR against
Does mariadb have an installer where the question could be asked? |
|
Good point, so I guess the feedback.cnf config file goes into folder
I assumed as much. Thanks for clarifying. |
Hi Otto, With some delay, I had time to look into it some more. Conditionally installing a file based on the result of the debconf question doesn't seem possible. All files mentioned in So, there are a few options :
What do you think? |
What about installing the file to all users but with the contents commented out? And what the postinstall does, is a simple sed to remove a # character from the line so that after next restart of server the feedback plugin is active? |
I read Debian Policy again on this. What I previously mentioned about not changing an installed config file in a postinst script, does only seem to apply to files listed in a 'conffiles' file (which doesn't exist in the mariadb-server-10.0 package. On a side note, it probably should be added for the other config files that are installed by the package). The script is currently a bit more complicated (ie. more robust) than removing a #, as it makes sure that the correct setting is added, it also works in cases where the configfile was changed by the user (different setting for the feedback option or removal of the commented feedback option line). |
HI Otto, I did some more reading. It turns out all files installed in /etc are automatically checked by dpkg as config files. So the only option is to create the configfile using the postinst script, to avoid problems with dpkg complaining or the file being overwritten during and upgrade. |
Another idea : |
This sounds good! |
- Add debconf template to enable User Feedback Plugin The template description was reviewed by the debian-l10n-english team - Update po files after adding User Feedback Plugin template - Load User Feedback debconf template and apply current setting debconf takes the current value in the config file as default choice. It defaults to 'false' if the value is not found or the config file is missing. - Create User Feedback config file based on debconf setting mariadb-server-10.0.postinst script creates config file 50-feedback.cnf to enable the plugin. If the question is answered with 'true', the plugin is enabled (disabled by default). The script handles the case when the file is not present, by copying it or when it when the required setting was manually changed or removed. - Remove User Feedback config file if the package is purged
This pull request is now updated : a template for There is an alternative version that is a bit simpler : it copies and removes the config file depending on the answer in the debconf question. Downside of this approach : any manual changes to Both versions are rebased onto master |
Looks good! Now I wonder if I should apply this on ottok/mariadb-10.1 or on mariadb/server/10.2.. I will not upload new versions of 10.0 to Debian anymore. Maybe the best fit would be to send this directly to upstream 10.2. Do you want to make a PR against https://github.com/MariaDB/server/tree/10.2/debian or do you want me to finalize this (and of course keep you as git --author)? |
Well, applying it to 10.2 upstream will cause it to miss the freeze for stretch. But maybe it's better to have it a longer time in testing before it goes into stable (not that it is a very big change). I can prepare the PR for upstream 10.2. How easy is to apply the patch to 10.2? I mean, how different is the debian/ dir in 10.2 upstream from the one in the 10.0/10.1 Debian package? What do you think? |
This pull request implements feature request in bug #808419.
mariadb-server-10.0.postinst
script a config file50-feedback.cnf
is created to enable the plugin, by default it is disabled, but if the question is answered with 'true', the plugin is enabledmariadb-server-10.0.postinst
script handles case when the file is not present, or when it when the required setting was manually changed or removed