Files
haikuports/dev-perl/xml_sax/patches/xml_sax-1.02.patchset
Joachim Mairböck 924c69c62a xml_sax: new perl module recipe
This includes a patch to install the ParserDetails.ini configuration file into
site_perl (i.e. the non-packaged hierarchy) instead of vendor_perl because it
should be editable by other perl module packages that provide an XML SAX parser
(whether installed as HPKG or manually).

The config file is created and modified using post-install and pre-uninstall
scripts.
2025-03-10 19:34:05 +01:00

50 lines
1.4 KiB
Plaintext

From bb777002f24040802543de8e9ae6716365c04898 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= <j.mairboeck@gmail.com>
Date: Sun, 8 Dec 2024 21:52:07 +0100
Subject: put ParserDetails.ini into site_perl in non-packaged
diff --git a/lib/XML/SAX.pm b/lib/XML/SAX.pm
index 7cd93d2..b04b3e8 100644
--- a/lib/XML/SAX.pm
+++ b/lib/XML/SAX.pm
@@ -12,7 +12,9 @@ use Exporter ();
@EXPORT_OK = qw(Namespaces Validation);
+use Config;
use File::Basename qw(dirname);
+use File::Path qw(make_path);
use File::Spec ();
use Symbol qw(gensym);
use XML::SAX::ParserFactory (); # loaded for simplicity
@@ -53,8 +55,8 @@ sub load_parsers {
# get directory from wherever XML::SAX is installed
if (!$dir) {
- $dir = $INC{'XML/SAX.pm'};
- $dir = dirname($dir);
+ $dir = $Config{'sitelib'};
+ $dir = File::Spec->catdir($dir, "XML");
}
my $fh = gensym();
@@ -180,10 +182,11 @@ sub save_parsers {
my $class = shift;
# get directory from wherever XML::SAX is installed
- my $dir = $INC{'XML/SAX.pm'};
- $dir = dirname($dir);
+ my $dir = $Config{'sitelib'};
+ $dir = File::Spec->catdir($dir, "XML", "SAX");
+ make_path($dir);
- my $file = File::Spec->catfile($dir, "SAX", PARSER_DETAILS);
+ my $file = File::Spec->catfile($dir, PARSER_DETAILS);
chmod 0644, $file;
unlink($file);
--
2.45.2