FS#20131 - [perl-xml-sax] leaves system config file when uninstalled

Attached to Project: Arch Linux
Opened by Justin Davis (juster) - Friday, 09 July 2010, 18:44 GMT
Last edited by Giovanni Scafora (giovanni) - Thursday, 30 September 2010, 09:33 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Giovanni Scafora (giovanni)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When you install perl-xml-sax it adds itself to its own config file, listing parsers, located at:
/usr/share/perl5/vendor_perl/XML/SAX/ParserDetails.ini
It doesn't remove itself from the list when the package is removed.
This is a low priority, because when you uninstall perl-xml-sax there is nothing to read the ParserDetails.ini file any longer :). The bigger problem is other perl-xml-sax- modules copying the .install file from this package.

Additional info:
* perl-xml-sax version 0.96-2
* http://perl-xml.sourceforge.net/faq/#parserdetails.ini

Background Info Rant:
The link above gives a good description of the ParserDetails.ini problem. It says to update the ParserDetails.ini in a post-install script (as we do with post-xml-sax.install). Yet it says not to do this unconditionally, because you don't want to overwrite a better parser with the default one that comes with XML::SAX. This seems illogical, because perl-xml-sax is a pre-requisite to parsers like perl-xml-sax-expat. This means perl-xml-sax will be installed first and need not worry about another parser being installed before it. Nevertheless I don't want to rock the boat and keep the file readability (-r) checks in my bugfix snippet below.

Steps to reproduce:
pacman -S perl-xml-sax
pacman -R perl-xml-sax
cat /usr/share/perl5/vendor_perl/XML/SAX/ParserDetails.ini

Fix:
Add an entry for removal inside the perl-xml-sax.install file, like so:

pre_remove()
{
if [ -r /usr/share/perl5/vendor_perl/XML/SAX/ParserDetails.ini ] ; then
perl -MXML::SAX \
-e "XML::SAX->remove_parser(q(XML::SAX::PurePerl))->save_parsers()" &>/dev/null
fi
}


PS: I don't think the post_upgrade() function in the perl-xml-sax.install file is necessary.
PPS: I will try to remember to report this for perl-xml-sax-expat etc...
This task depends upon

Closed by  Giovanni Scafora (giovanni)
Thursday, 30 September 2010, 09:33 GMT
Reason for closing:  Works for me

Loading...