Bug#658702: Fix for bug 658702
Stéphane Graber
stgraber at ubuntu.com
Fri Aug 10 20:06:02 UTC 2012
Hello,
We've just hit that same bug in Ubuntu when preparing for Ubuntu 10.04
to 12.04 upgrades without internet connectivity.
I'm attaching the patch we've applied to workaround/fix that problem.
It's based on a similar change that was done to doc-base a while ago,
basically implementing a local version of dirname.
I have uploaded updated patches to precise-proposed and quantal a few
minutes ago but don't expect any other issue with that package.
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
Description: Copy DirName function from doc-base and use that instead of dirname()
Author: Stéphane Graber <stgraber at ubuntu.com>
Forwarded: no
Last-Update: 2012-08-10
--- libxml-sax-perl-0.99+dfsg.orig/SAX.pm
+++ libxml-sax-perl-0.99+dfsg/SAX.pm
@@ -12,7 +12,6 @@ use Exporter ();
@EXPORT_OK = qw(Namespaces Validation);
-use File::Basename qw(dirname);
use File::Spec ();
use Symbol qw(gensym);
use XML::SAX::ParserFactory (); # loaded for simplicity
@@ -44,6 +43,13 @@ http://xml.org/sax/features/validation =
=cut
+sub _DirName { # {{{
+ my @p = split '/', $_[0];
+ return (join '/', @p[0..($#p-1)]) if $#p > 1;
+ return '/' if substr ($_[0], 0, 1) eq '/';
+ return '.';
+} # }}}
+
sub load_parsers {
my $class = shift;
my $dir = shift;
@@ -54,7 +60,7 @@ sub load_parsers {
# get directory from wherever XML::SAX is installed
if (!$dir) {
$dir = $INC{'XML/SAX.pm'};
- $dir = dirname($dir);
+ $dir = _DirName($dir);
}
my $fh = gensym();
@@ -190,7 +196,7 @@ sub save_parsers {
# get directory from wherever XML::SAX is installed
my $dir = $INC{'XML/SAX.pm'};
- $dir = dirname($dir);
+ $dir = _DirName($dir);
my $file = File::Spec->catfile($dir, "SAX", PARSER_DETAILS);
chmod 0644, $file;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20120810/6bdd2d8a/attachment.pgp>
More information about the pkg-perl-maintainers
mailing list