tag 445803 patch
thanks

On Wed, Oct 24, 2007 at 04:16:29PM +1000, Alexander Zangerl wrote:
 
> further evaluation of the test-and-thus-build failure shows that 
> the parser doesn't work properly anymore; tests like 05merge now fail 
> with error messages like this one:
> 
>        ERROR (line 1):  Invalid xxx syntax near "topic[baseNameString =
>                        "rumsti"]"
> XTM::Path: Invalid syntax around 'topic[baseNameString = "rumsti"]' at 
> /tmp/libxtm-perl-0.37/blib/lib/XTM/Path.pm line 486.
> 
> the intricate relationship between parse::recdescent and the xtm parser
> is something only upstream can deal with properly, but the xtm package 
> is marked 'no longer actively maintained'. 
>
> if upstream does not fix this problem, libxtm-perl will not be part of 
> the lenny release. 

Hi,

the change is that with Parse::RecDescent 1.95.1, rule actions must
succeed, ie. return a defined value, for the $return variable to have
any effect. There are rules in XTM/Path.pm using constructs that return
'undef' for eg. empty lists.

The Parse::RecDescent documentation isn't very clear on this, but from
what I understand, the behaviour was broken until now and is now working
as documented. Thus XTM::Path has been working 'by chance' until now.

The issue with triplet version numbers was actually fortunate; without it,
this could have gone unnoticed for a long time since the CParser.pm files
wouldn't have been rebuilt.

I'm attaching a proposed patch that fixes this for me and works with
both Parse::RecDescent 1.94 and 1.95.1. It's formatted as an NMU just
because I thought the changelog entries would be useful. I'm not
sure if I caught all the problems, but at least the tests now all pass.

The patch also makes sure the CParser.pm files are built from source
each time the package is built. This should ensure that issues like this
don't go unnoticed in the future.

Cheers,
-- 
Niko Tyni   [EMAIL PROTECTED]
diff -Nru --exclude CParser.pm --exclude Makefile.old /tmp/WX2z5Emsti/libxtm-perl-0.37/debian/changelog /tmp/wdmLOM7KCl/libxtm-perl-0.37/debian/changelog
--- /tmp/WX2z5Emsti/libxtm-perl-0.37/debian/changelog	2007-10-24 22:12:40.000000000 +0300
+++ /tmp/wdmLOM7KCl/libxtm-perl-0.37/debian/changelog	2007-10-24 22:12:40.000000000 +0300
@@ -1,3 +1,12 @@
+libxtm-perl (0.37-2.1) unstable; urgency=medium
+
+  * NMU (sort of)
+  * Medium urgency for an RC bugfix.
+  * Fix compatibility issues with Parse::RecDescent 1.95. (Closes: #445803)
+  * Make sure the CParser.pm files are built from source every time.
+
+ -- Niko Tyni <[EMAIL PROTECTED]>  Wed, 24 Oct 2007 21:59:39 +0300
+
 libxtm-perl (0.37-2) unstable; urgency=low
 
   * lifted standards version
diff -Nru --exclude CParser.pm --exclude Makefile.old /tmp/WX2z5Emsti/libxtm-perl-0.37/debian/rules /tmp/wdmLOM7KCl/libxtm-perl-0.37/debian/rules
--- /tmp/WX2z5Emsti/libxtm-perl-0.37/debian/rules	2007-10-24 22:12:40.000000000 +0300
+++ /tmp/wdmLOM7KCl/libxtm-perl-0.37/debian/rules	2007-10-24 22:12:40.000000000 +0300
@@ -5,6 +5,8 @@
 configure: Makefile
 Makefile: Makefile.PL
 	dh_testdir
+	# make sure the CParser.pm files are remade
+	touch lib/XTM/Path.pm lib/XTM/AsTMa/Parser.pm lib/XTM/LTM/Parser.pm
 	perl Makefile.PL INSTALLDIRS=vendor	
 
 build: build-stamp
diff -Nru --exclude CParser.pm --exclude Makefile.old /tmp/WX2z5Emsti/libxtm-perl-0.37/lib/XTM/AsTMa/Parser.pm /tmp/wdmLOM7KCl/libxtm-perl-0.37/lib/XTM/AsTMa/Parser.pm
--- /tmp/WX2z5Emsti/libxtm-perl-0.37/lib/XTM/AsTMa/Parser.pm	2005-03-08 02:54:19.000000000 +0200
+++ /tmp/wdmLOM7KCl/libxtm-perl-0.37/lib/XTM/AsTMa/Parser.pm	2007-10-24 22:12:40.000000000 +0300
@@ -11,7 +11,7 @@
 $VERSION = '0.08';
 
 use Data::Dumper;
-use Parse::RecDescent 1.90;
+use Parse::RecDescent 1.090;
 use URI;
 use URI::Escape;
 
diff -Nru --exclude CParser.pm --exclude Makefile.old /tmp/WX2z5Emsti/libxtm-perl-0.37/lib/XTM/LTM/Parser.pm /tmp/wdmLOM7KCl/libxtm-perl-0.37/lib/XTM/LTM/Parser.pm
--- /tmp/WX2z5Emsti/libxtm-perl-0.37/lib/XTM/LTM/Parser.pm	2005-03-08 02:54:19.000000000 +0200
+++ /tmp/wdmLOM7KCl/libxtm-perl-0.37/lib/XTM/LTM/Parser.pm	2007-10-24 22:12:40.000000000 +0300
@@ -12,7 +12,7 @@
 $VERSION = '0.03';
 
 use Data::Dumper;
-use Parse::RecDescent 1.90;
+use Parse::RecDescent 1.090;
 use URI;
 
 use XTM;
diff -Nru --exclude CParser.pm --exclude Makefile.old /tmp/WX2z5Emsti/libxtm-perl-0.37/lib/XTM/Path.pm /tmp/wdmLOM7KCl/libxtm-perl-0.37/lib/XTM/Path.pm
--- /tmp/WX2z5Emsti/libxtm-perl-0.37/lib/XTM/Path.pm	2005-03-08 02:54:19.000000000 +0200
+++ /tmp/wdmLOM7KCl/libxtm-perl-0.37/lib/XTM/Path.pm	2007-10-24 22:12:40.000000000 +0300
@@ -380,6 +380,7 @@
 			   foreach (@{$item{'predicate(s?)'}}) {
 			     push @{$return->{predicates}}, $_;
 			   }
+			   1;
 
 			 }
 
@@ -426,6 +427,7 @@
 			   if ($item{'op_value(?)'} && $item{'op_value(?)'}->[0]) {
 			     push @$return, @{$item{'op_value(?)'}->[0]};
 			   }
+			   1;
 			 }
 
 			 op_value : compare_op value
@@ -469,7 +471,7 @@
     $parser = XTM::Path::CParser->new();
   }; if ($@) {
     warn "could not find CParser ($@)";
-    use Parse::RecDescent 1.90;
+    use Parse::RecDescent 1.090;
     $parser = new Parse::RecDescent ($xtmpath_grammar) or die "XTM::Path: Problem in grammar";
   };
   return $parser;

Reply via email to