]> sipb.mit.edu Git - ikiwiki.git/commitdiff
fix two build bugs
authorJoey Hess <joey@kodama.kitenet.net>
Fri, 13 Jun 2008 17:05:44 +0000 (13:05 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Fri, 13 Jun 2008 17:05:44 +0000 (13:05 -0400)
* ikiwiki-mass-rebuild: Make group list comparison more robust.
* search: Work around xapian bug #486138 by only stemming locales
  in a whitelist.

IkiWiki/Plugin/search.pm
debian/changelog
doc/bugs/Can__39__t_rebuild_wiki_pages_with_ikiwiki_2.49.mdwn
ikiwiki-mass-rebuild

index 3ac4351979e7b96bd81c334d7d873cb40d612498..8fc2f3724c9f4666e675aeaa79bc43e839230792 100644 (file)
@@ -108,8 +108,14 @@ sub index (@) { #{{{
        if (! $stemmer) {
                my $langcode=$ENV{LANG} || "en";
                $langcode=~s/_.*//;
-               eval { $stemmer=Search::Xapian::Stem->new($langcode) };
-               if ($@) {
+
+               # This whitelist is here to work around a xapian bug (#486138)
+               my @whitelist=qw{da de en es fi fr hu it no pt ru ro sv tr};
+
+               if (grep { $_ eq $langcode } @whitelist) {
+                       $stemmer=Search::Xapian::Stem->new($langcode);
+               }
+               else {
                        $stemmer=Search::Xapian::Stem->new("english");
                }
        }
index 579e5f6c3eb763c1c344dceae4e3a997fa329eea..d1a3d0b3ab2436903f472d6415aa19826282097e 100644 (file)
@@ -3,6 +3,9 @@ ikiwiki (2.50) UNRELEASED; urgency=low
   * img: Support captions.
   * img: Don't generate empty title attributes, etc.
   * img: Allow setting defaults for class and id too.
+  * ikiwiki-mass-rebuild: Make group list comparison more robust.
+  * search: Work around xapian bug #486138 by only stemming locales
+    in a whitelist.
 
  -- Joey Hess <joeyh@debian.org>  Sat, 07 Jun 2008 23:04:00 -0400
 
index b59984e3e4174fce5ebfb1776d665cc47a352efc..6e43c1149a9fbb3f70bdb9d3044a95ead1a30b21 100644 (file)
@@ -16,3 +16,13 @@ I've installed all needed packages for new search engine and added path
 to `omega` binary in my `ikiwiki.setup` file.
 
 Any ideas how to fix that problem? --[[PaweÅ‚|ptecza]]
+
+> Well, it's two separate problems. Xapian is crashing in the C code when
+> asked to create a stemmer for `pl`. This is a Xapain bug, but I've put 
+> in a workaround.
+> 
+> For the first problem, looks like I need a more robust grouplist comparor
+> -- fixed in git.
+>
+> [[done]]
+> --[[Joey]]
index 3d0ca734c4652368c9486e5479ce92279efdb610..f13033e7f821d7cbae3a7c761147aa27dedf2b45 100755 (executable)
@@ -15,6 +15,23 @@ sub supplemental_groups {
        return @list;
 }
 
+sub samelists {
+       my %a=map { $_ => 1 } split(' ', shift());
+       my %b=map { $_ => 1 } split(' ', shift());
+
+       foreach my $i (keys %b) {
+               if (! exists $a{$i}) {
+                       return 0;
+               }
+       }
+       foreach my $i (keys %a) {
+               if (! exists $b{$i}) {
+                       return 0;
+               }
+       }
+       return 1;
+}
+
 sub processline {
        my $user=shift;
        my $setup=shift;
@@ -34,7 +51,7 @@ sub processline {
        if (! $pid) {
                my ($uuid, $ugid) = (getpwnam($user))[2, 3];
                my $grouplist=join(" ", $ugid, sort {$a <=> $b} $ugid, supplemental_groups($user));
-               if (($)=$grouplist) ne $grouplist) {
+               if (! samelists(($)=$grouplist), $grouplist)) {
                        die "failed to set egid $grouplist (got back $))";
                }
                $(=$ugid;