* ikiwiki-mass-rebuild: Make group list comparison more robust.
* search: Work around xapian bug #486138 by only stemming locales
in a whitelist.
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");
}
}
* 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
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]]
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;
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;