Bug 197011 - textproc/p5-XML-SAX: checksum mismatch for ParserDetails.ini
Summary: textproc/p5-XML-SAX: checksum mismatch for ParserDetails.ini
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Kurt Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-22 22:03 UTC by Tatsuki Makino
Modified: 2018-02-27 07:16 UTC (History)
4 users (show)

See Also:
pi: maintainer-feedback+


Attachments
unfinished patch (2.12 KB, patch)
2015-02-27 10:52 UTC, Tatsuki Makino
no flags Details | Diff
test log (16.70 KB, text/plain)
2015-02-27 10:55 UTC, Tatsuki Makino
no flags Details
Updated patch for textproc/p5-XML-SAX (p5-XML-SAX-1.00) (2.05 KB, patch)
2018-02-27 02:46 UTC, Tatsuki Makino
no flags Details | Diff
test log (17.62 KB, text/plain)
2018-02-27 02:48 UTC, Tatsuki Makino
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tatsuki Makino 2015-01-22 22:03:44 UTC
A file %%SITE_PERL%%/XML/SAX/ParserDetails.ini (/usr/local/lib/perl5/site_perl/XML/SAX/ParserDetails.ini) is updated by ports that depending textproc/p5-XML-SAX.
For example, I installed textproc/p5-XML-SAX-Expat, textproc/p5-XML-Simple and textproc/p5-XML-LibXML on my machine. They appended some entries for them to ParserDetails.ini.
It occurs checksum mismatch when executing `pkg check -s textproc/p5-XML-SAX`.

Sorry, I don't have a solution for fix it.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-01-22 22:03:44 UTC
Auto-assigned to maintainer perl@FreeBSD.org
Comment 2 Mathieu Arnold freebsd_committer freebsd_triage 2015-02-17 16:02:57 UTC
Is there something to fix ?
Comment 3 Tatsuki Makino 2015-02-27 10:52:20 UTC
Created attachment 153574 [details]
unfinished patch
Comment 4 Tatsuki Makino 2015-02-27 10:55:45 UTC
Created attachment 153575 [details]
test log

test log of attachment 153574 [details]
Comment 5 Tatsuki Makino 2015-05-24 07:22:56 UTC
echo daily_status_security_pkg_checksum_enable=\"YES\" >> /etc/periodic.conf
is to enable a nice useful script.
Comment 6 Tatsuki Makino 2015-05-24 08:28:15 UTC
List of ports which change ParserDetails.ini

textproc/p5-XML-LibXML
textproc/p5-XML-SAX-Expat
textproc/p5-XML-SAX-ExpatXS
Comment 7 Mathieu Arnold freebsd_committer freebsd_triage 2016-08-19 15:11:13 UTC
By which port is the ParserDetails.ini file used ?
Comment 8 John Hein 2016-08-19 17:03:22 UTC
(In reply to Mathieu Arnold from comment #7)
textproc/p5-XML-SAX - it has a load_parsers function that reads that file.
Comment 9 John Hein 2016-08-19 17:17:48 UTC
(In reply to John Hein from comment #8)
textproc/p5-XML-SAX is pretty clearly the owner of this file.  Other ports can munge it by calling (ultimately) XML::SAX->save_parsers().

Is there a way in the pkg infrastructure to mark a file as expected to change (i.e., don't record a checksum - or ignore checksum mismatches)?  This is not really a case of @sample.
Comment 10 Mathieu Arnold freebsd_committer freebsd_triage 2016-08-19 18:43:59 UTC
So, it is owned by XML::SAX, and XML::LibXML, XML::SAX::Expat and XML::SAX::ExpatXS add themselves to it.  Are there other ?

I can grok something so that it works.
Comment 11 Mathieu Arnold freebsd_committer freebsd_triage 2016-08-19 18:44:54 UTC
Other question, how are the other OS working with it ?
Comment 12 John Hein 2016-08-20 00:22:38 UTC
(In reply to Mathieu Arnold from comment #11)
The redhat package labels it a "ghost" file.  Look for the ghost directive here:

http://www.rpm.org/max-rpm-snapshot/s1-rpm-inside-files-list-directives.html

Basically it means not to include the file in the package but remove it on uninstall - intended for logs and other things that get generated by the package during its installed lifetime.

Then they have a post install scriptlet to gen the file (using save_parsers()).  And some logic to try to preserve an existing ParserDetails.ini file (cp to .backup) which doesn't look quite right, but probably works in most typical cases.

And a pre-uninstall scriptlet to undo that post-install stuff.

The bottom line is that the file shows up in the package listing, but is ignored for package verification.  Tested on Fedora 23.
Comment 13 John Hein 2016-08-20 00:29:53 UTC
(In reply to John Hein from comment #12)
RPM also has a %verify directive to guide how the package checking process should handle a particular file (e.g., don't bother with the checksum or size or mtime).  Their package for perl-XML-SAX doesn't use that, but it could have.
Comment 14 Walter Schwarzenfeld freebsd_triage 2018-01-17 07:05:35 UTC
Is this still relevant?
Comment 15 Tatsuki Makino 2018-01-17 10:20:52 UTC
(In reply to w.schwarzenfeld from comment #14)

Did it change anything?
/usr/local/etc/periodic/security/460.pkg-checksum reports on checksum mismatch everyday :)
Comment 16 Walter Schwarzenfeld freebsd_triage 2018-01-17 10:23:20 UTC
Sorry, I know it and don't thought on it ;-))
Comment 17 Tatsuki Makino 2018-01-17 23:46:04 UTC
attachment 153574 [details] changes not to check the checksum of %%SITE_PERL%%/XML/SAX/ParserDetails.ini and to remove it when it is not referenced. ...maybe :)
It can be solved temporarily. However, ParserDetails.ini is weak against unexpected changes.
Comment 18 Walter Schwarzenfeld freebsd_triage 2018-01-18 00:55:43 UTC
Patch seems to work. Thanks!
Comment 19 Tatsuki Makino 2018-02-27 02:46:30 UTC
Created attachment 191042 [details]
Updated patch for textproc/p5-XML-SAX (p5-XML-SAX-1.00)
Comment 20 Tatsuki Makino 2018-02-27 02:48:02 UTC
Created attachment 191043 [details]
test log

log of using attachment 191042 [details]
Comment 21 Kurt Jaeger freebsd_committer freebsd_triage 2018-02-27 07:16:12 UTC
Committed, thanks.
Comment 22 commit-hook freebsd_committer freebsd_triage 2018-02-27 07:16:14 UTC
A commit references this bug:

Author: pi
Date: Tue Feb 27 07:15:55 UTC 2018
New revision: 463111
URL: https://svnweb.freebsd.org/changeset/ports/463111

Log:
  textproc/p5-XML-SAX: fix checksum mismatch for ParserDetails.ini

  - The file %%SITE_PERL%%/XML/SAX/ParserDetails.ini
    is updated by ports that depending textproc/p5-XML-SAX.
  - For example, textproc/p5-XML-SAX-Expat, textproc/p5-XML-Simple
    and textproc/p5-XML-LibXML append something to the .ini file.
  - This causes checksum mismatch when executing
    `pkg check -s textproc/p5-XML-SAX`

  The fix provides a pkg-install program to handle the file in post-install.

  PR:		197011
  Submitted by:	Tatsuki Makino <tatsuki_makino@hotmail.com>
  Reviewed by:	John Hein, mat, Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>

Changes:
  head/textproc/p5-XML-SAX/Makefile
  head/textproc/p5-XML-SAX/files/patch-Makefile.PL
  head/textproc/p5-XML-SAX/files/pkg-install.in
  head/textproc/p5-XML-SAX/pkg-plist