Hi, I want to use the dh_ucf script with the 'aide' package. That requires the changes contained in the attached patch against the master branch. The changes include * support directories * support '--debconf-ok' ucf option * support '--three-way' ucf option * check for errors at code generation time * reduced size of generated code for multiple config files Please consider to include the changes in the debhelper package. Thanks Hannes
Hannes von Haugwitz wrote: I don't think any debhelper autoscripts define shell functions, and so I am wary of adding that here. A for loop would have the same effect. I am also somewhat doubtful of the utility of optimising the space used by the maintainer script snippets. How many files are being registered with ucf to make this matter? Does ucf scale to that many files? What if they all got changed, does the admin have to wade through hundreds of ucf prompts? It does not seem appropriate to add individual ucf options to dh_ucf. One way that would work better would be to take all options after -- as options for ucf. I also wonder if there's any reason not to make --three-way the default, either in ucf itself, or in dh_ucf.
Hello, What is wrong with shell functions? A for loop wouldn't help here, but one could hack a while loop analogous to the dh_usrlocal script. However I think shell functions are the cleaner approach. The aide package currently registers 157 configuration files with ucf. The current dh_ucf script would generate 936 postinst lines and 2198 postrm lines. My approach only generates 479 postinst lines and 486 postrm lines. Please let me know which approach do you prefer (shell functions, while loops or the current one). Yes, but the same would apply if the files would have been managed by dpkg itself. Both points make sense. I'll update the script to enable '--three-way' by default and change the synopsis to 'dh_ucf [debhelper options] [-n] [-- params]'. Best regards Hannes
Dear Debhelper Maintainers, Apart from the above two points what else do I have to do to get the patch accepted? Best regards Hannes
Hannes von Haugwitz:
Hi Hannes,
Sorry that this bug has fallen between the chairs in between debhelper
changing maintainer. :)
Those two points would be great to have implemented. I think the
concern with the shell function comes in several variants:
* The shell function is afterwards available to the maintainer,
effectively making it a part of the API/ABI.
* It can clash with another maintainer defined function.
(Less likely and trivially solved by using a proper namespace
for debhelper provided functions)
* The autoscripts should have trivial logic as updates it takes a
long time to roll out patches to autoscripts. This is easier to
do if the complex logic is outsourced to a different tool called
from the scripts[1]. Defining a function has probably been the
rule of thumb for something that is getting too complex.
I am willing to try this if we name space the function. Let me know
when you have an updated patch. :)
Thanks,
~Niels
[1] This has its own issues like very few packages can actually provide
such programs. Nonetheless, that was one of the design goals.
Hi Niels, Sorry for the long delay. Looks like I still owe you an updated patch. Are you still interested the enhancements? Best regards Hannes
Hannes von Haugwitz: Hi Hannes, Yes, I would still be interested in the improvements if you still feel it would be worth your time and effort to do them. :) Thanks, ~Niels
Hello, Originally I created the bug/patch to ease the maintenance of the numerous rule files in the aide package. Meanwhile Marc (one of the aide maintainers) has developed some ucf helper functions for the same purpose. These functions are now provided by the ucf package [ucf_helper_functions] and are used directly in the aide-common postinst file (see [aide-common.postinst]). Principally I'm still willing to update the dh_ucf patch, but I think it does not make sense to provide the same functionality in two different packages (debhelper and ucf). How do we want to proceed now? @Marc @Manoj What is your opinion as the maintainers of the other involved packages? Best regards Hannes [ucf_helper_functions] https://salsa.debian.org/srivasta/ucf/-/blob/master/ucf_helper_functions.sh [aide-common.postinst[ https://salsa.debian.org/debian/aide/-/blob/master/debian/aide-common.postinst