r9810 - in /trunk/libxml-sax-perl: debian/libxml-sax-perl.README.Debian examples/libxml-foo-perl.postinst

ntyni-guest at users.alioth.debian.org ntyni-guest at users.alioth.debian.org
Tue Nov 27 18:56:59 UTC 2007


Author: ntyni-guest
Date: Tue Nov 27 18:56:59 2007
New Revision: 9810

URL: http://svn.debian.org/wsvn/?sc=1&rev=9810
Log:
update README.Debian and add an example on changing priority

Modified:
    trunk/libxml-sax-perl/debian/libxml-sax-perl.README.Debian
    trunk/libxml-sax-perl/examples/libxml-foo-perl.postinst

Modified: trunk/libxml-sax-perl/debian/libxml-sax-perl.README.Debian
URL: http://svn.debian.org/wsvn/trunk/libxml-sax-perl/debian/libxml-sax-perl.README.Debian?rev=9810&op=diff
==============================================================================
--- trunk/libxml-sax-perl/debian/libxml-sax-perl.README.Debian (original)
+++ trunk/libxml-sax-perl/debian/libxml-sax-perl.README.Debian Tue Nov 27 18:56:59 2007
@@ -41,13 +41,18 @@
 2. Generate the file 'ParserDetails.ini' by concatenating the contents
    of the remaining files in the 'ParserDetails.d' directory.
 
-This script uses the directory '/etc/perl/XML/SAX/ParserDetails.d' and
+This script uses the directory '/var/lib/libxml-sax-perl/ParserDetails.d' and
 the file '/etc/perl/XML/SAX/ParserDetails.ini' by default.
 
 To keep the default behaviour of the XML::SAX module the file
 '/usr/share/perl5/XML/SAX/ParserDetails.ini' is symlinked to the file
 '/etc/perl/XML/SAX/ParserDetails.ini'.
 
+The file '/etc/perl/XML/SAX/ParserDetails.ini' is managed with ucf(1)
+to ensure that local changes are not accidentally overwritten. If
+you choose to keep a locally modified file but change your mind later,
+you can get update-perl-sax-parsers to overwrite your modified file
+by running 'ucf --purge '/etc/perl/XML/SAX/ParserDetails.ini' first.
 
 Support for Debian packages with Perl SAX parser modules
 --------------------------------------------------------
@@ -56,6 +61,20 @@
 needs to register these modules using the `update-perl-sax-parsers`
 script.   This is done by putting the appropriate invocations of this
 script in the postinst and the prerm scripts of that package.
+
+Starting with libxml-sax-perl version 0.16-0.2, the
+'update-perl-sax-parsers' script supports parser-specific priorities.
+The idea is that the parser with the highest priority gets to be the
+default SAX parser. The bundled parser, XML::SAX::PurePerl, is not
+recommended for serious use, so its priority is set to 10.  The default
+priority, when the '--priority' option is not used, is 50. 
+
+Parsers with the same priority are ordered alphabetically by their module
+name, and the last one is the winner.
+
+If you want to change the priority of your module later, just remove
+the module with the old priority and the re-add it with the new
+priority. 
 
 Below is an example of a postinst script:
 
@@ -70,7 +89,12 @@
   ## ----------------------------------------------------------------------
   if [ "$1" = configure ]
   then
-      update-perl-sax-parsers --add XML::FOO
+      if [ -n "$2" ] && dpkg --compare-versions "$2" lt x.x-x
+      then
+          update-perl-sax-parsers --remove XML::FOO
+      fi
+
+      update-perl-sax-parsers --add XML::FOO --priority 60
       update-perl-sax-parsers --update
   fi
 
@@ -95,7 +119,7 @@
   ## ----------------------------------------------------------------------
   if [ "$1" = remove ]
   then
-      update-perl-sax-parsers --remove XML::FOO
+      update-perl-sax-parsers --remove XML::FOO --priority 60
       update-perl-sax-parsers --update
   fi
 
@@ -107,10 +131,9 @@
 
   ## ----------------------------------------------------------------------
 
-For the above to work properly the package needs to have a dependencty
-on the package 'libxml-sax-perl'.  You can find these examples in the
-directory '/usr/share/doc/libxml-sax-perl/examples'.
-
+For the above to work properly the package needs to have a versioned
+dependency on 'libxml-sax-perl (>= 0.16-0.2)'.  You can find these 
+examples in the directory '/usr/share/doc/libxml-sax-perl/examples'.
 
 Local Parser SAX parser module registration
 -------------------------------------------
@@ -119,7 +142,7 @@
 local Perl SAX parser module registration.
 
 When (de)registering a Perl SAX parser module to the registry one can
-indicate a directory (default is '/etc/perl/XML/SAX/ParserDetails.d'),
+indicate a directory (default is '/var/lib/libxml-sax-perl/ParserDetails.d'),
 e.g.:
 
   update-perl-sax-parsers --add XML::FOO \
@@ -139,7 +162,7 @@
   update-perl-sax-parsers --update \
     --file /usr/local/share/perl5/XML/SAX/ParserDetails.ini \
     --directory /usr/local/share/perl5/XML/SAX/ParserDetails.d \
-    --directory /etc/perl/XML/SAX/ParserDetails.d
+    --directory /var/lib/libxml-sax-perl/ParserDetails.d
 
 
 Original CPAN Package vs. Debian Package

Modified: trunk/libxml-sax-perl/examples/libxml-foo-perl.postinst
URL: http://svn.debian.org/wsvn/trunk/libxml-sax-perl/examples/libxml-foo-perl.postinst?rev=9810&op=diff
==============================================================================
--- trunk/libxml-sax-perl/examples/libxml-foo-perl.postinst (original)
+++ trunk/libxml-sax-perl/examples/libxml-foo-perl.postinst Tue Nov 27 18:56:59 2007
@@ -9,7 +9,12 @@
 ## ----------------------------------------------------------------------
 if [ "$1" = configure ]
 then
-    update-perl-sax-parsers --add XML::FOO
+    if [ -n "$2" ] && dpkg --compare-versions "$2" lt x.x-x
+    then
+        update-perl-sax-parsers --remove XML::FOO
+    fi
+
+    update-perl-sax-parsers --add XML::FOO --priority 60
     update-perl-sax-parsers --update
 fi
 




More information about the Pkg-perl-cvs-commits mailing list