[Koha-bugs] [Bug 32791] Log4perl configuration files need a tool for updating on package upgrade

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Feb 10 01:36:33 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32791

--- Comment #8 from David Cook <dcook at prosentient.com.au> ---
On ktd, I'm noticing /var/lib/ucf/cache/:etc:perl:XML:SAX:ParserDetails.ini

ucfq --verbose /etc/perl/XML/SAX/ParserDetails.ini
Configuration file                            Package             Exists
Changed
/etc/perl/XML/SAX/ParserDetails.ini           libxml-sax-perl     Yes     No

In the postinst for the libxml-sax-perl Debian package, it calls
"update-perl-sax-parsers" which runs the following:

system("ucf", "--debconf-ok", "--sum-file", 
"/var/lib/libxml-sax-perl/ParserDetails.ini.md5sum", $tmpfile, $file);
unlink $tmpfile or die("unlink $tmpfile: $!");

/usr/share/doc/ucf/examples/postinst also includes an example of using a
temporary file with "ucf", so that sounds pretty good to me. 

--

I've done some hacking on "update-perl-sax-parsers" and the "ucf" data files to
try to get the prompt I wanted. I used "sudo su -" to bypass
"DEBIAN_FRONTEND=noninteractive" in the ktd env vars. (In ktd images, we should
use ARG instead of ENV for setting this env var. I'll double-check whether or
not I have an existing issue or PR for that...)

Hacked files:
- /usr/bin/update-perl-sax-parsers
- /var/lib/ucf/cache/\:etc\:perl\:XML\:SAX\:ParserDetails.ini
- /var/lib/ucf/hashfile


dpkg-reconfigure libxml-sax-perl
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based
frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line
78.)
debconf: falling back to frontend: Readline
update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::PurePerl with
priority 10...
update-perl-sax-parsers: Updating overall Perl SAX parser modules info file...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based
frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line
78.)
debconf: falling back to frontend: Readline
Modified configuration file
---------------------------

A new version (/tmp/61U6DAa6Rj) of configuration file
/etc/perl/XML/SAX/ParserDetails.ini is available, but the version installed
currently has been locally modified.

  1. install the package maintainer's version    3. show the differences
between the versions            5. show a 3-way difference between available
versions  7. start a new shell to examine the situation
  2. keep the local version currently installed  4. show a side-by-side
difference between the versions  6. do a 3-way merge between available versions
What do you want to do about modified configuration file ParserDetails.ini?

--

Basically, it checks if the installed version and the ucf cached version match.
If they match, then the upstream version is installed. If they don't match,
then the sysadmin is prompted as above. 

I think that sounds pretty ideal. 

We could actually use that for a variety of generated Koha config files.

--

Anyway, I think I better change to a different task now, but I'm curious to
hear what people think!

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list