From 4fbe1c3d447d875562b6c6a43ac702101eae3953 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 22 Apr 2009 13:31:56 -0400 Subject: websetup: Display stderr in browser if ikiwiki setup fails. --- IkiWiki/Plugin/websetup.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 95d044c08..92e6875ba 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -426,8 +426,10 @@ sub showform ($$) { "-refresh", "-wrappers", "-v"); } + close STDERR; + open(STDERR, ">&STDOUT"); my $ret=system(@command); - print "\n
";
+			print "\n<\/pre>";
 			if ($ret != 0) {
 				print '

'. sprintf(gettext("

Error: %s exited nonzero (%s)"), -- cgit v1.2.3 From 55377e7336070c4d2a3da1473666accf13d64325 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 22 Apr 2009 13:33:20 -0400 Subject: blogspam: Load RPC::XML library in checkconfig, so that an error can be printed at that point if it's not available, allowing the admin to see it during wiki setup. Closes: #520015 --- IkiWiki/Plugin/blogspam.pm | 17 ++++++++++------- debian/changelog | 4 ++++ 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index cbd9859a5..c9883fbc2 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -9,6 +9,7 @@ my $defaulturl='http://test.blogspam.net:8888/'; sub import { hook(type => "getsetup", id => "blogspam", call => \&getsetup); + hook(type => "checkconfig", id => "skeleton", call => \&checkconfig); hook(type => "checkcontent", id => "blogspam", call => \&checkcontent); } @@ -43,17 +44,19 @@ sub getsetup () { }, } -sub checkcontent (@) { - my %params=@_; - +sub checkconfig () { + # This is done at checkconfig time because printing an error + # if the module is missing when a spam is posted would not + # let the admin know about the problem. eval q{ use RPC::XML; use RPC::XML::Client; }; - if ($@) { - warn($@); - return undef; - } + error $@ if $@; +} + +sub checkcontent (@) { + my %params=@_; if (exists $config{blogspam_pagespec}) { return undef diff --git a/debian/changelog b/debian/changelog index 533a2a16f..011f4b669 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,10 @@ ikiwiki (3.11) UNRELEASED; urgency=low * Add python:Depends to control file. Closes: #525086 * websetup: Display stderr in browser if ikiwiki setup fails. + * blogspam: Load RPC::XML library in checkconfig, so that an + error can be printed at that point if it's not available, + allowing the admin to see it during wiki setup. + Closes: #520015 -- Joey Hess Tue, 21 Apr 2009 21:41:38 -0400 -- cgit v1.2.3 From 565e5291cd037c155e976b69f7b8d26c5b64a389 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 22 Apr 2009 14:05:37 -0400 Subject: websetup: If setup fails, restore old setup file. --- IkiWiki/Plugin/websetup.pm | 8 ++++++-- debian/changelog | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index 92e6875ba..9edd22d26 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -403,6 +403,7 @@ sub showform ($$) { $form->reset(0); # doesn't really make sense here } else { + my $oldsetup=readfile($config{setupfile}); IkiWiki::Setup::dump($config{setupfile}); IkiWiki::saveindex(); @@ -432,12 +433,15 @@ sub showform ($$) { print "\n<\/pre>"; if ($ret != 0) { print '

'. - sprintf(gettext("

Error: %s exited nonzero (%s)"), + sprintf(gettext("Error: %s exited nonzero (%s). Discarding setup changes."), join(" ", @command), $ret). '

'; + open(OUT, ">", $config{setupfile}) || error("$config{setupfile}: $!"); + print OUT $oldsetup; + close OUT; } - print $tail; + print $tail; exit 0; } } diff --git a/debian/changelog b/debian/changelog index 011f4b669..ba3042af0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ikiwiki (3.11) UNRELEASED; urgency=low error can be printed at that point if it's not available, allowing the admin to see it during wiki setup. Closes: #520015 + * websetup: If setup fails, restore old setup file. -- Joey Hess Tue, 21 Apr 2009 21:41:38 -0400 -- cgit v1.2.3 From 338d4ccff115e99a6541a660433591a9b7306c32 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 22 Apr 2009 15:38:50 -0400 Subject: fix id --- IkiWiki/Plugin/blogspam.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/blogspam.pm b/IkiWiki/Plugin/blogspam.pm index c9883fbc2..da63d3edb 100644 --- a/IkiWiki/Plugin/blogspam.pm +++ b/IkiWiki/Plugin/blogspam.pm @@ -9,7 +9,7 @@ my $defaulturl='http://test.blogspam.net:8888/'; sub import { hook(type => "getsetup", id => "blogspam", call => \&getsetup); - hook(type => "checkconfig", id => "skeleton", call => \&checkconfig); + hook(type => "checkconfig", id => "blogspam", call => \&checkconfig); hook(type => "checkcontent", id => "blogspam", call => \&checkcontent); } -- cgit v1.2.3 From 748aa7af777caaa32ac5ab56e707509b3739b49e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 14:07:28 -0400 Subject: pagespec error/failure distinction and error display by inline * Add IkiWiki::ErrorReason objects, and modify pagespecs to return them in cases where they fail to match due to a configuration or syntax error. * inline: Display a handy error message if the inline cannot display any pages due to such an error. This is perhaps somewhat incomplete, as other users of pagespecs do not display the error, and will eventually need similar modifications to inline. I should probably factor out a pagespec_match_all function and make it throw ErrorReasons. --- IkiWiki.pm | 14 +++++++---- IkiWiki/Plugin/filecheck.pm | 18 +++++++------- IkiWiki/Plugin/inline.pm | 9 ++++++- debian/changelog | 5 ++++ doc/plugins/write.mdwn | 9 ++++--- po/bg.po | 31 ++++++++++++++---------- po/cs.po | 31 ++++++++++++++---------- po/da.po | 36 +++++++++++++++++----------- po/de.po | 37 ++++++++++++++++++----------- po/es.po | 58 +++++++++++++++++++++++++++++---------------- po/fr.po | 37 ++++++++++++++++++----------- po/gu.po | 31 ++++++++++++++---------- po/ikiwiki.pot | 27 ++++++++++++--------- po/pl.po | 31 ++++++++++++++---------- po/sv.po | 31 ++++++++++++++---------- po/vi.po | 31 ++++++++++++++---------- 16 files changed, 266 insertions(+), 170 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index 2eca82e4d..fca8da874 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1800,7 +1800,7 @@ sub pagespec_translate ($) { $code.="IkiWiki::PageSpec::match_$1(\$page, ".safequote($2).", \@_)"; } else { - $code.="IkiWiki::FailReason->new(".safequote(qq{unknown function in pagespec "$word"}).")"; + $code.="IkiWiki::ErrorReason->new(".safequote(qq{unknown function in pagespec "$word"}).")"; } } else { @@ -1827,7 +1827,7 @@ sub pagespec_match ($$;@) { } my $sub=pagespec_translate($spec); - return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") + return IkiWiki::ErrorReason->new("syntax error in pagespec \"$spec\"") if $@ || ! defined $sub; return $sub->($page, @params); } @@ -1861,6 +1861,10 @@ sub new { return bless \$value, $class; } +package IkiWiki::ErrorReason; + +our @ISA = 'IkiWiki::FailReason'; + package IkiWiki::SuccessReason; use overload ( @@ -2021,7 +2025,7 @@ sub match_user ($$;@) { my %params=@_; if (! exists $params{user}) { - return IkiWiki::FailReason->new("no user specified"); + return IkiWiki::ErrorReason->new("no user specified"); } if (defined $params{user} && lc $params{user} eq lc $user) { @@ -2041,7 +2045,7 @@ sub match_admin ($$;@) { my %params=@_; if (! exists $params{user}) { - return IkiWiki::FailReason->new("no user specified"); + return IkiWiki::ErrorReason->new("no user specified"); } if (defined $params{user} && IkiWiki::is_admin($params{user})) { @@ -2061,7 +2065,7 @@ sub match_ip ($$;@) { my %params=@_; if (! exists $params{ip}) { - return IkiWiki::FailReason->new("no IP specified"); + return IkiWiki::ErrorReason->new("no IP specified"); } if (defined $params{ip} && lc $params{ip} eq lc $ip) { diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm index 8575ee108..01d490961 100644 --- a/IkiWiki/Plugin/filecheck.pm +++ b/IkiWiki/Plugin/filecheck.pm @@ -71,13 +71,13 @@ sub match_maxsize ($$;@) { my $page=shift; my $maxsize=eval{IkiWiki::Plugin::filecheck::parsesize(shift)}; if ($@) { - return IkiWiki::FailReason->new("unable to parse maxsize (or number too large)"); + return IkiWiki::ErrorReason->new("unable to parse maxsize (or number too large)"); } my %params=@_; my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; if (! defined $file) { - return IkiWiki::FailReason->new("no file specified"); + return IkiWiki::ErrorReason->new("no file specified"); } if (-s $file > $maxsize) { @@ -92,13 +92,13 @@ sub match_minsize ($$;@) { my $page=shift; my $minsize=eval{IkiWiki::Plugin::filecheck::parsesize(shift)}; if ($@) { - return IkiWiki::FailReason->new("unable to parse minsize (or number too large)"); + return IkiWiki::ErrorReason->new("unable to parse minsize (or number too large)"); } my %params=@_; my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; if (! defined $file) { - return IkiWiki::FailReason->new("no file specified"); + return IkiWiki::ErrorReason->new("no file specified"); } if (-s $file < $minsize) { @@ -116,14 +116,14 @@ sub match_mimetype ($$;@) { my %params=@_; my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; if (! defined $file) { - return IkiWiki::FailReason->new("no file specified"); + return IkiWiki::ErrorReason->new("no file specified"); } # Use ::magic to get the mime type, the idea is to only trust # data obtained by examining the actual file contents. eval q{use File::MimeInfo::Magic}; if ($@) { - return IkiWiki::FailReason->new("failed to load File::MimeInfo::Magic ($@); cannot check MIME type"); + return IkiWiki::ErrorReason->new("failed to load File::MimeInfo::Magic ($@); cannot check MIME type"); } my $mimetype=File::MimeInfo::Magic::magic($file); if (! defined $mimetype) { @@ -149,12 +149,12 @@ sub match_virusfree ($$;@) { my %params=@_; my $file=exists $params{file} ? $params{file} : $IkiWiki::pagesources{$page}; if (! defined $file) { - return IkiWiki::FailReason->new("no file specified"); + return IkiWiki::ErrorReason->new("no file specified"); } if (! exists $IkiWiki::config{virus_checker} || ! length $IkiWiki::config{virus_checker}) { - return IkiWiki::FailReason->new("no virus_checker configured"); + return IkiWiki::ErrorReason->new("no virus_checker configured"); } # The file needs to be fed into the virus checker on stdin, @@ -162,7 +162,7 @@ sub match_virusfree ($$;@) { # used, clamd would fail to read it. eval q{use IPC::Open2}; error($@) if $@; - open (IN, "<", $file) || return IkiWiki::FailReason->new("failed to read file"); + open (IN, "<", $file) || return IkiWiki::ErrorReason->new("failed to read file"); binmode(IN); my $sigpipe=0; $SIG{PIPE} = sub { $sigpipe=1 }; diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 9d7d4b0fd..551c38a65 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -184,13 +184,20 @@ sub preprocess_inline (@) { } my @list; + my $lastmatch; foreach my $page (keys %pagesources) { next if $page eq $params{page}; - if (pagespec_match($page, $params{pages}, location => $params{page})) { + $lastmatch=pagespec_match($page, $params{pages}, location => $params{page}); + if ($lastmatch) { push @list, $page; } } + if (! @list && defined $lastmatch && + $lastmatch->isa("IkiWiki::ErrorReason")) { + error(sprintf(gettext("cannot match pages: %s"), $lastmatch)); + } + if (exists $params{sort} && $params{sort} eq 'title') { @list=sort { pagetitle(basename($a)) cmp pagetitle(basename($b)) } @list; } diff --git a/debian/changelog b/debian/changelog index fbfed0007..f8378f098 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,11 @@ ikiwiki (3.11) UNRELEASED; urgency=low Closes: #520015 * websetup: If setup fails, restore old setup file. * relativedate: Deal with clock skew. + * Add IkiWiki::ErrorReason objects, and modify pagespecs to return + them in cases where they fail to match due to a configuration or syntax + error. + * inline: Display a handy error message if the inline cannot display any + pages due to such an error. -- Joey Hess Tue, 21 Apr 2009 21:41:38 -0400 diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 11ed312ae..23df01ca7 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -890,9 +890,12 @@ It's also possible to write plugins that add new functions to IkiWiki::PageSpec package, that is named `match_foo`, where "foo()" is how it will be accessed in a [[ikiwiki/PageSpec]]. The function will be passed two parameters: The name of the page being matched, and the thing to match -against. It may also be passed additional, named parameters. It should return -a IkiWiki::SuccessReason object if the match succeeds, or an -IkiWiki::FailReason object if the match fails. +against. It may also be passed additional, named parameters. + +It should return a IkiWiki::SuccessReason object if the match succeeds, or +an IkiWiki::FailReason object if the match fails. If the match cannot be +attempted at all, for any page, it can instead return an +IkiWiki::ErrorReason object explaining why. ### Setup plugins diff --git a/po/bg.po b/po/bg.po index ce963f994..f2207601f 100644 --- a/po/bg.po +++ b/po/bg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki-bg\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2007-01-12 01:19+0200\n" "Last-Translator: Damyan Ivanov \n" "Language-Team: Bulgarian \n" @@ -181,14 +181,14 @@ msgstr "" msgid "automatic index generation" msgstr "" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " msgstr "" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -419,29 +419,34 @@ msgstr "шаблонът „%s” не е намерен" msgid "missing pages parameter" msgstr "липсващ параметър „id” на шаблона" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "грешка при четене на „%s”: %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "непознат вид сортиране „%s”" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Дискусия" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "модулът „RPC::XML::Client” не е намерен; източникът не е проверен" @@ -903,9 +908,9 @@ msgid "" "to rebuild the wiki." msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" #: ../IkiWiki/Receive.pm:35 @@ -986,12 +991,12 @@ msgstr "грешка при четене на „%s”: %s" msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "" diff --git a/po/cs.po b/po/cs.po index c66004dcb..29df2126a 100644 --- a/po/cs.po +++ b/po/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2007-05-09 21:21+0200\n" "Last-Translator: Miroslav Kure \n" "Language-Team: Czech \n" @@ -178,14 +178,14 @@ msgstr "" msgid "automatic index generation" msgstr "" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " msgstr "" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -413,29 +413,34 @@ msgstr "zdroj nebyl nalezen" msgid "missing pages parameter" msgstr "chybí parametr %s" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "nemohu číst %s: %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "neznámý typ řazení %s" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "Přidat nový příspěvek nazvaný:" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "neexistující šablona %s" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Diskuse" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client nebyl nalezen, nepinkám" @@ -885,9 +890,9 @@ msgid "" "to rebuild the wiki." msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" #: ../IkiWiki/Receive.pm:35 @@ -968,12 +973,12 @@ msgstr "nemohu číst %s: %s" msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "" diff --git a/po/da.po b/po/da.po index 5f582312d..b49ac5cbd 100644 --- a/po/da.po +++ b/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2008-10-22 19:13+0100\n" "Last-Translator: Jonas Smedegaard \n" "Language-Team: None\n" @@ -180,14 +180,14 @@ msgstr "vedhæftningsoplægning" msgid "automatic index generation" msgstr "automatisk indeks-dannelse" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " msgstr "" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -410,29 +410,34 @@ msgstr "sideredigering er ikke tilladt" msgid "missing pages parameter" msgstr "mangler pages-parametren" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "kan ikke læse %s: %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "ukendt sorteringsform %s" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "Tilføj nyt indlæg med følgende titel:" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "ikke-eksisterende skabelon: %s" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Diskussion" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client ikke fundet, pinger ikke" @@ -881,10 +886,10 @@ msgstr "" "For at opsætningsændringerne vist nedenfor træder fuldt ud i kraft, skal du " "muligvis genopbygge wikien." -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" -msgstr "

Fejl: %s sluttede med fejl (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." +msgstr "" #: ../IkiWiki/Receive.pm:35 #, perl-format @@ -966,12 +971,12 @@ msgstr "kan ikke læse %s: %s" msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "du skal angive et wikinavn (som indeholder alfanumeriske tegn)" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "revisionskontrolsystem %s ikke understøttet" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "opsætning af depotet med ikiwiki-makerepo mislykkedes" @@ -1068,6 +1073,9 @@ msgstr "Hvilken wiki bruger (eller openid) skal være administrator?" msgid "What is the domain name of the web server?" msgstr "Hvad er domænenavnet på webserveren?" +#~ msgid "

Error: %s exited nonzero (%s)" +#~ msgstr "

Fejl: %s sluttede med fejl (%s)" + #~ msgid "failed to write %s: %s" #~ msgstr "skrivning ad %s mislykkedes: %s" diff --git a/po/de.po b/po/de.po index 748265924..3a05f46a8 100644 --- a/po/de.po +++ b/po/de.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.06\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2009-03-02 15:39+0100\n" "Last-Translator: Kai Wasserbäch \n" "Language-Team: German \n" @@ -178,7 +178,7 @@ msgstr "Anhang hochladen" msgid "automatic index generation" msgstr "automatische Index-Erstellung" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " @@ -187,7 +187,7 @@ msgstr "" "als Spam ein: " #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -415,29 +415,34 @@ msgstr "Seitenbearbeitungen sind nicht erlaubt" msgid "missing pages parameter" msgstr "Fehlender Seitenparameter" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "kann %s nicht lesen: %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "Unbekannter Sortierungstyp %s" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "Füge einen neuen Beitrag hinzu. Titel:" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "nicht-vorhandene Vorlage %s" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Diskussion" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client nicht gefunden, führe Ping nicht aus" @@ -891,11 +896,10 @@ msgstr "" "Damit die unten aufgeführten Konfigurationsänderungen aktiviert werden, kann " "es erforderlich sein, das Wiki neu zu erzeugen." -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" -"

Fehler: %s beendete sich mit einem Wert ungleich Null (%s)" #: ../IkiWiki/Receive.pm:35 #, perl-format @@ -978,12 +982,12 @@ msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "" "Sie müssen einen Wiki-Namen eingeben (der alphanumerische Zeichen enthält)" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "Nicht unterstütztes Versionskontrollsystem %s" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "Erstellen des Depots mit ikiwiki-makerepo ist fehlgeschlagen" @@ -1082,3 +1086,8 @@ msgstr "" #: ../auto.setup:23 msgid "What is the domain name of the web server?" msgstr "Wie lautet der Domainname des Webservers?" + +#~ msgid "

Error: %s exited nonzero (%s)" +#~ msgstr "" +#~ "

Fehler: %s beendete sich mit einem Wert ungleich Null " +#~ "(%s)" diff --git a/po/es.po b/po/es.po index bf8f82899..682eff0c9 100644 --- a/po/es.po +++ b/po/es.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2009-04-07 08:54+0200\n" "Last-Translator: Víctor Moral \n" "Language-Team: spanish \n" @@ -34,7 +34,8 @@ msgstr "" #: ../IkiWiki/CGI.pm:149 msgid "login failed, perhaps you need to turn on cookies?" -msgstr "registro fallido, ¿ tal vez necesita activar las cookies en el navegador ?" +msgstr "" +"registro fallido, ¿ tal vez necesita activar las cookies en el navegador ?" #: ../IkiWiki/CGI.pm:168 ../IkiWiki/CGI.pm:299 msgid "Your login session has expired." @@ -70,7 +71,8 @@ msgstr "Contenido añadido activado vía web." #: ../IkiWiki/Plugin/aggregate.pm:93 msgid "Nothing to do right now, all feeds are up-to-date!" -msgstr "¡ No hay nada que hacer, todas las fuentes de noticias están actualizadas !" +msgstr "" +"¡ No hay nada que hacer, todas las fuentes de noticias están actualizadas !" #: ../IkiWiki/Plugin/aggregate.pm:220 #, perl-format @@ -183,7 +185,7 @@ msgstr "enviado el adjunto" msgid "automatic index generation" msgstr "creación de índice automática" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " @@ -192,7 +194,7 @@ msgstr "" "dice que el texto puede ser spam." #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -359,7 +361,8 @@ msgstr "" #: ../IkiWiki/Plugin/google.pm:31 msgid "Failed to parse url, cannot determine domain name" -msgstr "Error en el análisis del URL, no puedo determinar el nombre del dominio" +msgstr "" +"Error en el análisis del URL, no puedo determinar el nombre del dominio" #: ../IkiWiki/Plugin/goto.pm:49 msgid "missing page" @@ -417,29 +420,36 @@ msgstr "no está permitida la modificación de páginas" msgid "missing pages parameter" msgstr "falta el parámetro pages" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "no puedo leer el archivo %s: %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" -msgstr "Se necesita el módulo Sort::Naturally para el tipo de ordenación title_natural" +msgstr "" +"Se necesita el módulo Sort::Naturally para el tipo de ordenación " +"title_natural" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "no conozco este tipo de ordenación %s" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "Añadir una entrada nueva titulada:" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "la plantilla %s no existe " -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Comentarios" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "No he encontrado el componente RPC::XML::Client, no envío señal alguna" @@ -454,7 +464,8 @@ msgstr "La página %s está bloqueada y no puede modificarse" #: ../IkiWiki/Plugin/mdwn.pm:44 msgid "multimarkdown is enabled, but Text::MultiMarkdown is not installed" -msgstr "el modo multimarkdown está activo, pero no está instalado Text::MultiMarkdown" +msgstr "" +"el modo multimarkdown está activo, pero no está instalado Text::MultiMarkdown" #: ../IkiWiki/Plugin/mdwn.pm:67 #, perl-format @@ -876,7 +887,8 @@ msgid "plugins" msgstr "complementos" #: ../IkiWiki/Plugin/websetup.pm:395 -msgid "The configuration changes shown below require a wiki rebuild to take effect." +msgid "" +"The configuration changes shown below require a wiki rebuild to take effect." msgstr "" "Los cambios en la configuración que se muestran más abajo precisan una " "reconstrucción del wiki para tener efecto." @@ -889,10 +901,10 @@ msgstr "" "Para que los cambios en la configuración mostrados más abajo tengan efecto, " "es posible que necesite reconstruir el wiki." -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" -msgstr "

Error: %s finaliza con código distinto de cero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." +msgstr "" #: ../IkiWiki/Receive.pm:35 #, perl-format @@ -976,12 +988,12 @@ msgstr "no puedo leer el archivo %s: %s" msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "debe escribir un nombre wiki (que contiene caracteres alfanuméricos)" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "el sistema de control de versiones %s no está soportado" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "no he podido crear un repositorio con el programa ikiwiki-makerepo" @@ -992,7 +1004,8 @@ msgstr "el programa %s no parece ser ejecutable" #: ../IkiWiki/Wrapper.pm:20 msgid "cannot create a wrapper that uses a setup file" -msgstr "no puedo crear un programa envoltorio que utiliza un archivo de configuración" +msgstr "" +"no puedo crear un programa envoltorio que utiliza un archivo de configuración" #: ../IkiWiki/Wrapper.pm:24 msgid "wrapper filename not specified" @@ -1082,3 +1095,6 @@ msgstr "" msgid "What is the domain name of the web server?" msgstr "¿ Cuál es el dominio para el servidor web ?" +#~ msgid "

Error: %s exited nonzero (%s)" +#~ msgstr "" +#~ "

Error: %s finaliza con código distinto de cero (%s)" diff --git a/po/fr.po b/po/fr.po index 78b3bbe0f..8845f5068 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.04\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2009-03-15 16:10+0100\n" "Last-Translator: Philippe Batailler \n" "Language-Team: French \n" @@ -180,7 +180,7 @@ msgstr "Envoi de la pièce jointe" msgid "automatic index generation" msgstr "Génération de l'index automatique" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " @@ -189,7 +189,7 @@ msgstr "" "blogspam.net/\">blogspam: " #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -412,29 +412,34 @@ msgstr "Modification de page interdite" msgid "missing pages parameter" msgstr "Paramètre « pages » manquant" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "Lecture impossible de %s : %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "Type de tri %s inconnu" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "Ajouter un nouvel article dont le titre est :" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "Le modèle de page %s n'existe pas" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Discussion" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client introuvable, pas de réponse au ping" @@ -886,11 +891,10 @@ msgstr "" "Pour que les changements de configuration ci-dessous prennent effet vous " "devez recompiler le wiki" -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" -"

Erreur : %s s'est terminé, valeur de sortie nonzero (%s)" #: ../IkiWiki/Receive.pm:35 #, perl-format @@ -975,12 +979,12 @@ msgstr "" "Vous devez spécifier un nom de wiki (contenant des caractères " "alphanumériques)" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "Système de contrôle de version non reconnu : %s" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "Échec lors de la création du dépôt avec ikiwiki-makerepo" @@ -1076,3 +1080,8 @@ msgstr "Identifiant de l'administrateur (utilisateur du wiki ou openid) :" #: ../auto.setup:23 msgid "What is the domain name of the web server?" msgstr "Nom de domaine du serveur HTTP :" + +#~ msgid "

Error: %s exited nonzero (%s)" +#~ msgstr "" +#~ "

Erreur : %s s'est terminé, valeur de sortie nonzero (%" +#~ "s)" diff --git a/po/gu.po b/po/gu.po index dd9c7c5a1..a1bda2a15 100644 --- a/po/gu.po +++ b/po/gu.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki-gu\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2007-01-11 16:05+0530\n" "Last-Translator: Kartik Mistry \n" "Language-Team: Gujarati \n" @@ -179,14 +179,14 @@ msgstr "" msgid "automatic index generation" msgstr "" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " msgstr "" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -414,29 +414,34 @@ msgstr "ફીડ મળ્યું નહી" msgid "missing pages parameter" msgstr "ખોવાયેલ %s વિકલ્પ" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "વાંચી શકાતી નથી %s: %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "અજાણ્યો ગોઠવણી પ્રકાર %s" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "આ શિર્ષકથી નવું પોસ્ટ ઉમેરો:" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "અસ્તિત્વમાં ન હોય તેવું ટેમ્પલેટ %s" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "ચર્ચા" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client મળ્યું નહી, પિંગ કરવામાં આવતું નથી" @@ -885,9 +890,9 @@ msgid "" "to rebuild the wiki." msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" #: ../IkiWiki/Receive.pm:35 @@ -968,12 +973,12 @@ msgstr "વાંચી શકાતી નથી %s: %s" msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "" diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index d05a4a693..6c9b16289 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 18:50-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -177,14 +177,14 @@ msgstr "" msgid "automatic index generation" msgstr "" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " msgstr "" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -405,29 +405,34 @@ msgstr "" msgid "missing pages parameter" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, perl-format +msgid "cannot match pages: %s" +msgstr "" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "" @@ -868,9 +873,9 @@ msgid "" "to rebuild the wiki." msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" #: ../IkiWiki/Receive.pm:35 diff --git a/po/pl.po b/po/pl.po index 305d8bfc6..fc9313364 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 1.51\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2007-04-27 22:05+0200\n" "Last-Translator: Pawel Tecza \n" "Language-Team: Debian L10n Polish \n" @@ -183,14 +183,14 @@ msgstr "" msgid "automatic index generation" msgstr "" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " msgstr "" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -421,29 +421,34 @@ msgstr "nieznaleziony kanał RSS" msgid "missing pages parameter" msgstr "brakujący parametr %s" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "awaria w trakcie odczytu %s: %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "nieznany sposób sortowania %s" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "Tytuł nowego wpisu" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "brakujący szablon %s" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Dyskusja" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "Nieznaleziony moduł RPC::XML::Client, brak możliwości pingowania" @@ -909,9 +914,9 @@ msgid "" "to rebuild the wiki." msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" #: ../IkiWiki/Receive.pm:35 @@ -992,12 +997,12 @@ msgstr "awaria w trakcie odczytu %s: %s" msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "" diff --git a/po/sv.po b/po/sv.po index eeeac88f8..fc7af3830 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2007-01-10 23:47+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" @@ -180,14 +180,14 @@ msgstr "" msgid "automatic index generation" msgstr "" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " msgstr "" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -416,29 +416,34 @@ msgstr "mallen %s hittades inte" msgid "missing pages parameter" msgstr "mall saknar id-parameter" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "kan inte läsa %s: %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "okänd sorteringstyp %s" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Diskussion" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "RPC::XML::Client hittades inte, pingar inte" @@ -898,9 +903,9 @@ msgid "" "to rebuild the wiki." msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" #: ../IkiWiki/Receive.pm:35 @@ -981,12 +986,12 @@ msgstr "kan inte läsa %s: %s" msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "" diff --git a/po/vi.po b/po/vi.po index 719e99889..212acbe58 100644 --- a/po/vi.po +++ b/po/vi.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-04 14:59-0400\n" +"POT-Creation-Date: 2009-04-23 14:02-0400\n" "PO-Revision-Date: 2007-01-13 15:31+1030\n" "Last-Translator: Clytie Siddall \n" "Language-Team: Vietnamese \n" @@ -181,14 +181,14 @@ msgstr "" msgid "automatic index generation" msgstr "" -#: ../IkiWiki/Plugin/blogspam.pm:105 +#: ../IkiWiki/Plugin/blogspam.pm:108 msgid "" "Sorry, but that looks like spam to blogspam: " msgstr "" #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 -#: ../IkiWiki/Plugin/inline.pm:361 ../IkiWiki/Plugin/opendiscussion.pm:26 +#: ../IkiWiki/Plugin/inline.pm:368 ../IkiWiki/Plugin/opendiscussion.pm:26 #: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79 #: ../IkiWiki/Render.pm:149 msgid "discussion" @@ -419,29 +419,34 @@ msgstr "không tìm thấy mẫu %s" msgid "missing pages parameter" msgstr "mẫu thiếu tham số id" -#: ../IkiWiki/Plugin/inline.pm:200 +#: ../IkiWiki/Plugin/inline.pm:198 +#, fuzzy, perl-format +msgid "cannot match pages: %s" +msgstr "không thể đọc %s: %s" + +#: ../IkiWiki/Plugin/inline.pm:207 msgid "Sort::Naturally needed for title_natural sort" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:211 +#: ../IkiWiki/Plugin/inline.pm:218 #, perl-format msgid "unknown sort type %s" msgstr "kiểu sắp xếp không rõ %s" -#: ../IkiWiki/Plugin/inline.pm:314 +#: ../IkiWiki/Plugin/inline.pm:321 msgid "Add a new post titled:" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:334 +#: ../IkiWiki/Plugin/inline.pm:341 #, perl-format msgid "nonexistant template %s" msgstr "" -#: ../IkiWiki/Plugin/inline.pm:369 ../IkiWiki/Render.pm:83 +#: ../IkiWiki/Plugin/inline.pm:376 ../IkiWiki/Render.pm:83 msgid "Discussion" msgstr "Thảo luận" -#: ../IkiWiki/Plugin/inline.pm:600 +#: ../IkiWiki/Plugin/inline.pm:607 msgid "RPC::XML::Client not found, not pinging" msgstr "Không tìm thấy RPC::XML::Client nên không gửi gói tin ping" @@ -899,9 +904,9 @@ msgid "" "to rebuild the wiki." msgstr "" -#: ../IkiWiki/Plugin/websetup.pm:433 +#: ../IkiWiki/Plugin/websetup.pm:436 #, perl-format -msgid "

Error: %s exited nonzero (%s)" +msgid "Error: %s exited nonzero (%s). Discarding setup changes." msgstr "" #: ../IkiWiki/Receive.pm:35 @@ -982,12 +987,12 @@ msgstr "không thể đọc %s: %s" msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:68 +#: ../IkiWiki/Setup/Automator.pm:71 #, perl-format msgid "unsupported revision control system %s" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:94 +#: ../IkiWiki/Setup/Automator.pm:97 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "" -- cgit v1.2.3 From 527d178c12141d2467dfa86492e249d021b88997 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 14:56:10 -0400 Subject: comments: Add link to comment post form to allow user to sign in if they wish to, if the configuration makes signin optional for commenting. --- IkiWiki/Plugin/comments.pm | 7 +++++++ debian/changelog | 3 +++ po/ikiwiki.pot | 26 +++++++++++++------------- templates/editcomment.tmpl | 5 ++++- 4 files changed, 27 insertions(+), 14 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 98f9f8b3d..e618d1a90 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -317,6 +317,13 @@ sub editcomment ($$) { force => 1); } + if (! defined $session->param('name')) { + # Make signinurl work and return here. + $form->tmpl_param(signinurl => IkiWiki::cgiurl(do => 'signin')); + $session->param(postsignin => $ENV{QUERY_STRING}); + IkiWiki::cgi_savesession($session); + } + # The untaint is OK (as in editpage) because we're about to pass # it to file_pruned anyway my $page = $form->field('page'); diff --git a/debian/changelog b/debian/changelog index f8378f098..de4ac4a8c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,9 @@ ikiwiki (3.11) UNRELEASED; urgency=low error. * inline: Display a handy error message if the inline cannot display any pages due to such an error. + * comments: Add link to comment post form to allow user to sign in + if they wish to, if the configuration makes signin optional + for commenting. -- Joey Hess Tue, 21 Apr 2009 21:41:38 -0400 diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 6c9b16289..254bf83be 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-04-23 14:02-0400\n" +"POT-Creation-Date: 2009-04-23 14:43-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -212,55 +212,55 @@ msgstr "" msgid "Anonymous" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:326 ../IkiWiki/Plugin/editpage.pm:97 +#: ../IkiWiki/Plugin/comments.pm:331 ../IkiWiki/Plugin/editpage.pm:97 msgid "bad page name" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:331 +#: ../IkiWiki/Plugin/comments.pm:336 #, perl-format msgid "commenting on %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:349 +#: ../IkiWiki/Plugin/comments.pm:354 #, perl-format msgid "page '%s' doesn't exist, so you can't comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:356 +#: ../IkiWiki/Plugin/comments.pm:361 #, perl-format msgid "comments on page '%s' are closed" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:450 +#: ../IkiWiki/Plugin/comments.pm:455 msgid "comment stored for moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:452 +#: ../IkiWiki/Plugin/comments.pm:457 msgid "Your comment will be posted after moderator review" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:465 +#: ../IkiWiki/Plugin/comments.pm:470 msgid "Added a comment" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:469 +#: ../IkiWiki/Plugin/comments.pm:474 #, perl-format msgid "Added a comment: %s" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:511 ../IkiWiki/Plugin/websetup.pm:236 +#: ../IkiWiki/Plugin/comments.pm:516 ../IkiWiki/Plugin/websetup.pm:236 msgid "you are not logged in as an admin" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:562 +#: ../IkiWiki/Plugin/comments.pm:567 msgid "Comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:601 +#: ../IkiWiki/Plugin/comments.pm:606 msgid "comment moderation" msgstr "" -#: ../IkiWiki/Plugin/comments.pm:752 +#: ../IkiWiki/Plugin/comments.pm:757 msgid "Comments" msgstr "" diff --git a/templates/editcomment.tmpl b/templates/editcomment.tmpl index 7590cdfd7..27d9457d4 100644 --- a/templates/editcomment.tmpl +++ b/templates/editcomment.tmpl @@ -6,8 +6,11 @@ -Name: (optional)
+Name: (optional, or +Signin)
Website: (optional)
+ +(You might want to Signin first?)
Subject:
-- cgit v1.2.3 From aa306957bac11477b914ac19b93890184ffe4062 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 15:45:30 -0400 Subject: pagespec_match_list added and used in most appropriate places * pagespec_match_list: New API function, matches pages in a list and throws an error if the pagespec is bad. * inline, brokenlinks, calendar, linkmap, map, orphans, pagecount, pagestate, postsparkline: Display a handy error message if the pagespec is erronious. --- IkiWiki.pm | 32 +++++++++++++++++++++++---- IkiWiki/Plugin/brokenlinks.pm | 23 +++++++++---------- IkiWiki/Plugin/calendar.pm | 3 +-- IkiWiki/Plugin/external.pm | 9 +++++++- IkiWiki/Plugin/inline.pm | 17 +++----------- IkiWiki/Plugin/linkmap.pm | 7 +++--- IkiWiki/Plugin/map.pm | 49 ++++++++++++++++++++--------------------- IkiWiki/Plugin/orphans.pm | 7 +++--- IkiWiki/Plugin/pagecount.pm | 9 +++----- IkiWiki/Plugin/pagestats.pm | 11 +++++---- IkiWiki/Plugin/postsparkline.pm | 10 +++------ debian/changelog | 7 ++++-- doc/plugins/write.mdwn | 13 +++++++++++ 13 files changed, 111 insertions(+), 86 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index fca8da874..e260fffea 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -18,10 +18,10 @@ use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match - bestlink htmllink readfile writefile pagetype srcfile pagename - displaytime will_render gettext urlto targetpage - add_underlay pagetitle titlepage linkpage newpagefile - inject + pagespec_match_list bestlink htmllink readfile writefile + pagetype srcfile pagename displaytime will_render gettext urlto + targetpage add_underlay pagetitle titlepage linkpage + newpagefile inject %config %links %pagestate %wikistate %renderedfiles %pagesources %destsources); our $VERSION = 3.00; # plugin interface version, next is ikiwiki version @@ -1832,6 +1832,30 @@ sub pagespec_match ($$;@) { return $sub->($page, @params); } +sub pagespec_match_list ($$;@) { + my $pages=shift; + my $spec=shift; + my @params=@_; + + my $sub=pagespec_translate($spec); + error "syntax error in pagespec \"$spec\"" + if $@ || ! defined $sub; + + my @ret; + my $r; + foreach my $page (@$pages) { + $r=$sub->($page, @params); + push @ret, $page if $r; + } + + if (! @ret && defined $r && $r->isa("IkiWiki::ErrorReason")) { + error(sprintf(gettext("cannot match pages: %s"), $r)); + } + else { + return @ret; + } +} + sub pagespec_valid ($) { my $spec=shift; diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index bf0d7560d..da97dbc28 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -28,18 +28,17 @@ sub preprocess (@) { add_depends($params{page}, $params{pages}); my %broken; - foreach my $page (keys %links) { - if (pagespec_match($page, $params{pages}, location => $params{page})) { - my $discussion=gettext("discussion"); - my %seen; - foreach my $link (@{$links{$page}}) { - next if $seen{$link}; - $seen{$link}=1; - next if $link =~ /.*\/\Q$discussion\E/i && $config{discussion}; - my $bestlink=bestlink($page, $link); - next if length $bestlink; - push @{$broken{$link}}, $page; - } + foreach my $page (pagespec_match_list([keys %links], + $params{pages}, location => $params{page})) { + my $discussion=gettext("discussion"); + my %seen; + foreach my $link (@{$links{$page}}) { + next if $seen{$link}; + $seen{$link}=1; + next if $link =~ /.*\/\Q$discussion\E/i && $config{discussion}; + my $bestlink=bestlink($page, $link); + next if length $bestlink; + push @{$broken{$link}}, $page; } } diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm index d473c8348..fe4b16072 100644 --- a/IkiWiki/Plugin/calendar.pm +++ b/IkiWiki/Plugin/calendar.pm @@ -369,8 +369,7 @@ sub preprocess (@) { my $page =$params{page}; if (! defined $cache{$pagespec}) { - foreach my $p (keys %pagesources) { - next unless pagespec_match($p, $pagespec); + foreach my $p (pagespec_match_list([keys %pagesources], $pagespec)) { my $mtime = $IkiWiki::pagectime{$p}; my $src = $pagesources{$p}; my @date = localtime($mtime); diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm index 066f15cf1..aeee15dea 100644 --- a/IkiWiki/Plugin/external.pm +++ b/IkiWiki/Plugin/external.pm @@ -230,10 +230,17 @@ sub hook ($@) { } sub pagespec_match ($@) { - # convert pagespec_match's return object into a XML RPC boolean + # convert return object into a XML RPC boolean my $plugin=shift; return RPC::XML::boolean->new(0 + IkiWiki::pagespec_march(@_)); } +sub pagespec_match_list ($@) { + # convert return object into a XML RPC boolean + my $plugin=shift; + + return RPC::XML::boolean->new(0 + IkiWiki::pagespec_march_list(@_)); +} + 1 diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 551c38a65..366357095 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -183,20 +183,9 @@ sub preprocess_inline (@) { $params{template} = $archive ? "archivepage" : "inlinepage"; } - my @list; - my $lastmatch; - foreach my $page (keys %pagesources) { - next if $page eq $params{page}; - $lastmatch=pagespec_match($page, $params{pages}, location => $params{page}); - if ($lastmatch) { - push @list, $page; - } - } - - if (! @list && defined $lastmatch && - $lastmatch->isa("IkiWiki::ErrorReason")) { - error(sprintf(gettext("cannot match pages: %s"), $lastmatch)); - } + my @list=pagespec_match_list( + [ grep { $_ ne $params{page}} keys %pagesources ], + $params{pages}, location => $params{page}); if (exists $params{sort} && $params{sort} eq 'title') { @list=sort { pagetitle(basename($a)) cmp pagetitle(basename($b)) } @list; diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm index 941ed5f36..0137476ac 100644 --- a/IkiWiki/Plugin/linkmap.pm +++ b/IkiWiki/Plugin/linkmap.pm @@ -56,10 +56,9 @@ sub genmap ($) { # Get all the items to map. my %mapitems = (); - foreach my $item (keys %links) { - if (pagespec_match($item, $params{pages}, location => $params{page})) { - $mapitems{$item}=urlto($item, $params{destpage}); - } + foreach my $item (pagespec_match_list([keys %links], + $params{pages}, location => $params{page})) { + $mapitems{$item}=urlto($item, $params{destpage}); } my $dest=$params{page}."/linkmap.png"; diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm index 328493116..120451b5d 100644 --- a/IkiWiki/Plugin/map.pm +++ b/IkiWiki/Plugin/map.pm @@ -32,32 +32,31 @@ sub preprocess (@) { # Get all the items to map. my %mapitems; - foreach my $page (keys %pagesources) { - if (pagespec_match($page, $params{pages}, location => $params{page})) { - if (exists $params{show} && - exists $pagestate{$page} && - exists $pagestate{$page}{meta}{$params{show}}) { - $mapitems{$page}=$pagestate{$page}{meta}{$params{show}}; - } - else { - $mapitems{$page}=''; - } - # Check for a common prefix. - if (! defined $common_prefix) { - $common_prefix=$page; - } - elsif (length $common_prefix && - $page !~ /^\Q$common_prefix\E(\/|$)/) { - my @a=split(/\//, $page); - my @b=split(/\//, $common_prefix); - $common_prefix=""; - while (@a && @b && $a[0] eq $b[0]) { - if (length $common_prefix) { - $common_prefix.="/"; - } - $common_prefix.=shift(@a); - shift @b; + foreach my $page (pagespec_match_list([keys %pagesources], + $params{pages}, location => $params{page})) { + if (exists $params{show} && + exists $pagestate{$page} && + exists $pagestate{$page}{meta}{$params{show}}) { + $mapitems{$page}=$pagestate{$page}{meta}{$params{show}}; + } + else { + $mapitems{$page}=''; + } + # Check for a common prefix. + if (! defined $common_prefix) { + $common_prefix=$page; + } + elsif (length $common_prefix && + $page !~ /^\Q$common_prefix\E(\/|$)/) { + my @a=split(/\//, $page); + my @b=split(/\//, $common_prefix); + $common_prefix=""; + while (@a && @b && $a[0] eq $b[0]) { + if (length $common_prefix) { + $common_prefix.="/"; } + $common_prefix.=shift(@a); + shift @b; } } } diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index 605e6e43a..cf74c9b79 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -35,9 +35,10 @@ sub preprocess (@) { my @orphans; my $discussion=gettext("discussion"); - foreach my $page (keys %pagesources) { - next if $linkedto{$page} || $page eq 'index'; - next unless pagespec_match($page, $params{pages}, location => $params{page}); + foreach my $page (pagespec_match_list( + [ grep { ! $linkedto{$_} && $_ ne 'index' } + keys %pagesources ], + $params{pages}, location => $params{page})) { # If the page has a link to some other page, it's # indirectly linked to a page via that page's backlinks. next if grep { diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index a143f24d0..f8881a04b 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -27,12 +27,9 @@ sub preprocess (@) { add_depends($params{page}, $params{pages}); my @pages=keys %pagesources; - return $#pages+1 if $params{pages} eq "*"; # optimisation - my $count=0; - foreach my $page (@pages) { - $count++ if pagespec_match($page, $params{pages}, location => $params{page}); - } - return $count; + @pages=pagespec_match_list(\@pages, $params{pages}, location => $params{page}) + if $params{pages} ne "*"; # optimisation; + return $#pages+1; } 1 diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index dbe69539d..8ab5d3666 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -41,12 +41,11 @@ sub preprocess (@) { my %counts; my $max = 0; - foreach my $page (keys %links) { - if (pagespec_match($page, $params{pages}, location => $params{page})) { - use IkiWiki::Render; - $counts{$page} = scalar(IkiWiki::backlinks($page)); - $max = $counts{$page} if $counts{$page} > $max; - } + foreach my $page (pagespec_match_list([keys %links], + $params{pages}, location => $params{page})) { + use IkiWiki::Render; + $counts{$page} = scalar(IkiWiki::backlinks($page)); + $max = $counts{$page} if $counts{$page} > $max; } if ($style eq 'table') { diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm index ba43561fb..c2ebbc5eb 100644 --- a/IkiWiki/Plugin/postsparkline.pm +++ b/IkiWiki/Plugin/postsparkline.pm @@ -50,13 +50,9 @@ sub preprocess (@) { add_depends($params{page}, $params{pages}); - my @list; - foreach my $page (keys %pagesources) { - next if $page eq $params{page}; - if (pagespec_match($page, $params{pages}, location => $params{page})) { - push @list, $page; - } - } + my @list=pagespec_match_list( + [ grep { $_ ne $params{page} } keys %pagesources], + $params{pages}, location => $params{page}); @list = sort { $params{timehash}->{$b} <=> $params{timehash}->{$a} } @list; diff --git a/debian/changelog b/debian/changelog index de4ac4a8c..37b69ada0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,8 +11,11 @@ ikiwiki (3.11) UNRELEASED; urgency=low * Add IkiWiki::ErrorReason objects, and modify pagespecs to return them in cases where they fail to match due to a configuration or syntax error. - * inline: Display a handy error message if the inline cannot display any - pages due to such an error. + * pagespec_match_list: New API function, matches pages in a list + and throws an error if the pagespec is bad. + * inline, brokenlinks, calendar, linkmap, map, orphans, pagecount, + pagestate, postsparkline: Display a handy error message if the pagespec + is erronious. * comments: Add link to comment post form to allow user to sign in if they wish to, if the configuration makes signin optional for commenting. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 23df01ca7..0b358b215 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -572,6 +572,19 @@ The most often used is "location", which specifies the location the PageSpec should match against. If not passed, relative PageSpecs will match relative to the top of the wiki. +#### `pagespec_match_list($$;@)` + +Passed a reference to a list of page names, and [[ikiwiki/PageSpec]], +returns the set of pages that match the [[ikiwiki/PageSpec]]. + +Additional named parameters can be passed, to further limit the match. +The most often used is "location", which specifies the location the +PageSpec should match against. If not passed, relative PageSpecs will match +relative to the top of the wiki. + +Unlike pagespec_match, this may throw an error if there is an error in +the pagespec. + #### `bestlink($$)` Given a page and the text of a link on the page, determine which -- cgit v1.2.3 From e3ccf393c6081e413e1da0eae46ac937a032a13b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 16:13:40 -0400 Subject: typo --- IkiWiki/Plugin/external.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm index aeee15dea..f0acc7e4e 100644 --- a/IkiWiki/Plugin/external.pm +++ b/IkiWiki/Plugin/external.pm @@ -233,14 +233,14 @@ sub pagespec_match ($@) { # convert return object into a XML RPC boolean my $plugin=shift; - return RPC::XML::boolean->new(0 + IkiWiki::pagespec_march(@_)); + return RPC::XML::boolean->new(0 + IkiWiki::pagespec_match(@_)); } sub pagespec_match_list ($@) { # convert return object into a XML RPC boolean my $plugin=shift; - return RPC::XML::boolean->new(0 + IkiWiki::pagespec_march_list(@_)); + return RPC::XML::boolean->new(0 + IkiWiki::pagespec_match_list(@_)); } 1 -- cgit v1.2.3 From 860a86707856dcffcc67f137a0ab250ab34c42a6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 16:14:35 -0400 Subject: formatting --- IkiWiki/Plugin/inline.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 366357095..4507ace4d 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -184,7 +184,7 @@ sub preprocess_inline (@) { } my @list=pagespec_match_list( - [ grep { $_ ne $params{page}} keys %pagesources ], + [ grep { $_ ne $params{page} } keys %pagesources ], $params{pages}, location => $params{page}); if (exists $params{sort} && $params{sort} eq 'title') { -- cgit v1.2.3 From 2f96c49bd1826ecb213ae025ad456a714aa04863 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 16:20:18 -0400 Subject: pagespec_match_list * optimisation Add an optimisation for the semi-common case of a "*" pagespec. Can avoid doing any real processing in this case. --- IkiWiki.pm | 2 ++ IkiWiki/Plugin/pagecount.pm | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index e260fffea..e8c0c7abc 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1837,6 +1837,8 @@ sub pagespec_match_list ($$;@) { my $spec=shift; my @params=@_; + return @$pages if $spec eq '*'; # optimisation + my $sub=pagespec_translate($spec); error "syntax error in pagespec \"$spec\"" if $@ || ! defined $sub; diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index f8881a04b..a561e58e5 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -26,9 +26,7 @@ sub preprocess (@) { # register a dependency. add_depends($params{page}, $params{pages}); - my @pages=keys %pagesources; - @pages=pagespec_match_list(\@pages, $params{pages}, location => $params{page}) - if $params{pages} ne "*"; # optimisation; + my @pages=pagespec_match_list([keys %pagesources], $params{pages}, location => $params{page}); return $#pages+1; } -- cgit v1.2.3 From 14d8df55ad6099e1785c6e568b6f020abca3290f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 16:23:52 -0400 Subject: simplify --- IkiWiki/Plugin/postsparkline.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/postsparkline.pm b/IkiWiki/Plugin/postsparkline.pm index c2ebbc5eb..d2e5c2378 100644 --- a/IkiWiki/Plugin/postsparkline.pm +++ b/IkiWiki/Plugin/postsparkline.pm @@ -50,11 +50,10 @@ sub preprocess (@) { add_depends($params{page}, $params{pages}); - my @list=pagespec_match_list( - [ grep { $_ ne $params{page} } keys %pagesources], - $params{pages}, location => $params{page}); - - @list = sort { $params{timehash}->{$b} <=> $params{timehash}->{$a} } @list; + my @list=sort { $params{timehash}->{$b} <=> $params{timehash}->{$a} } + pagespec_match_list( + [ grep { $_ ne $params{page} } keys %pagesources], + $params{pages}, location => $params{page}); my @data=eval qq{IkiWiki::Plugin::postsparkline::formula::$formula(\\\%params, \@list)}; if ($@) { -- cgit v1.2.3 From 4030f757650a68df220956666f01e575f848daaf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 16:26:54 -0400 Subject: avoid using pagespec_match_list here I forgot to check if it was called from preprocess, and it is not; it's called by a format hook. If an error is thrown from a format hook, wiki build fails, so we don't want that. --- IkiWiki/Plugin/linkmap.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm index 0137476ac..941ed5f36 100644 --- a/IkiWiki/Plugin/linkmap.pm +++ b/IkiWiki/Plugin/linkmap.pm @@ -56,9 +56,10 @@ sub genmap ($) { # Get all the items to map. my %mapitems = (); - foreach my $item (pagespec_match_list([keys %links], - $params{pages}, location => $params{page})) { - $mapitems{$item}=urlto($item, $params{destpage}); + foreach my $item (keys %links) { + if (pagespec_match($item, $params{pages}, location => $params{page})) { + $mapitems{$item}=urlto($item, $params{destpage}); + } } my $dest=$params{page}."/linkmap.png"; -- cgit v1.2.3 From 85ae48b21eed71eeace8cd093ce92b7399cba861 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 16:35:56 -0400 Subject: Revert "pagespec_match_list * optimisation" This reverts commit 2f96c49bd1826ecb213ae025ad456a714aa04863. I forgot about internal pages. We don't want * matching them! I left the optimisation in pagecount, where it used to live. Internal pages probably don't matter when they're just being counted. --- IkiWiki.pm | 2 -- IkiWiki/Plugin/pagecount.pm | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index e8c0c7abc..e260fffea 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1837,8 +1837,6 @@ sub pagespec_match_list ($$;@) { my $spec=shift; my @params=@_; - return @$pages if $spec eq '*'; # optimisation - my $sub=pagespec_translate($spec); error "syntax error in pagespec \"$spec\"" if $@ || ! defined $sub; diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index a561e58e5..f8881a04b 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -26,7 +26,9 @@ sub preprocess (@) { # register a dependency. add_depends($params{page}, $params{pages}); - my @pages=pagespec_match_list([keys %pagesources], $params{pages}, location => $params{page}); + my @pages=keys %pagesources; + @pages=pagespec_match_list(\@pages, $params{pages}, location => $params{page}) + if $params{pages} ne "*"; # optimisation; return $#pages+1; } -- cgit v1.2.3 From 528f8f83ea228ff64f1d05e30f555f75ac2f2ddd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 23 Apr 2009 16:40:45 -0400 Subject: simplifiy --- IkiWiki/Plugin/pagecount.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/pagecount.pm b/IkiWiki/Plugin/pagecount.pm index f8881a04b..1955603b0 100644 --- a/IkiWiki/Plugin/pagecount.pm +++ b/IkiWiki/Plugin/pagecount.pm @@ -26,8 +26,7 @@ sub preprocess (@) { # register a dependency. add_depends($params{page}, $params{pages}); - my @pages=keys %pagesources; - @pages=pagespec_match_list(\@pages, $params{pages}, location => $params{page}) + my @pages=pagespec_match_list([keys %pagesources], $params{pages}, location => $params{page}) if $params{pages} ne "*"; # optimisation; return $#pages+1; } -- cgit v1.2.3 From e77d0030d61b8b8ad44f296a003c8713766ffd51 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 May 2009 20:06:50 -0400 Subject: inline: Minor optimisation. When finding the pageurl, it was calling bestlink unnecessarily. Since at this point $page contains the full name of the page that is being inlined, there is no need to do bestlink's scan for it. This is only a minor optimisation, since bestlink is only called once per displayed, inlined page. --- IkiWiki/Plugin/inline.pm | 2 +- debian/changelog | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 4507ace4d..27ea1c4a6 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -342,7 +342,7 @@ sub preprocess_inline (@) { my $content=get_inline_content($page, $params{destpage}); $template->param(content => $content); } - $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage})); + $template->param(pageurl => urlto($page, $params{destpage})); $template->param(inlinepage => $page); $template->param(title => pagetitle(basename($page))); $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat})); diff --git a/debian/changelog b/debian/changelog index ae7ce90be..9244ccdb8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ ikiwiki (3.12) UNRELEASED; urgency=low * ikiwiki-makerepo: Avoid using abs_path, as it apparently fails on nonexistant directories with some broken perl versions. + * inline: Minor optimisation. -- Joey Hess Mon, 04 May 2009 19:17:39 -0400 -- cgit v1.2.3 From 2a7721febd6cac1af5e7f4b4949ffe066c62c837 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 May 2009 23:40:09 -0400 Subject: Avoid %links accumulating duplicates. (For TOVA) This is sorta an optimisation, and sorta a bug fix. In one test case I have available, it can speed a page build up from 3 minutes to 3 seconds. The root of the problem is that $links{$page} contains arrays of links, rather than hashes of links. And when a link is found, it is just pushed onto the array, without checking for dups. Now, the array is emptied before scanning a page, so there should not be a lot of opportunity for lots of duplicate links to pile up in it. But, in some cases, they can, and if there are hundreds of duplicate links in the array, then scanning it for matching links, as match_link and some other code does, becomes much more expensive than it needs to be. Perhaps the real right fix would be to change the data structure to a hash. But, the list of links is never accessed like that, you always want to iterate through it. I also looked at deduping the list in saveindex, but that does a lot of unnecessary work, and doesn't completly solve the problem. So, finally, I decided to add an add_link function that handles deduping, and make ikiwiki-transition remove the old dup links. --- IkiWiki.pm | 12 ++++++++++-- IkiWiki/Plugin/camelcase.pm | 2 +- IkiWiki/Plugin/img.pm | 2 +- IkiWiki/Plugin/link.pm | 2 +- IkiWiki/Plugin/meta.pm | 2 +- IkiWiki/Plugin/tag.pm | 6 +++--- debian/NEWS | 9 +++++++++ debian/changelog | 4 ++++ doc/ikiwiki-transition.mdwn | 7 +++++++ doc/plugins/write.mdwn | 22 ++++++++++++++-------- ikiwiki-transition | 19 +++++++++++++++++++ 11 files changed, 70 insertions(+), 17 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki.pm b/IkiWiki.pm index e260fffea..e6efe1889 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -21,12 +21,12 @@ our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match pagespec_match_list bestlink htmllink readfile writefile pagetype srcfile pagename displaytime will_render gettext urlto targetpage add_underlay pagetitle titlepage linkpage - newpagefile inject + newpagefile inject add_link %config %links %pagestate %wikistate %renderedfiles %pagesources %destsources); our $VERSION = 3.00; # plugin interface version, next is ikiwiki version our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE -our $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE +our $installdir='/usr'; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE # Optimisation. use Memoize; @@ -1757,6 +1757,14 @@ sub inject { use warnings; } +sub add_link ($$) { + my $page=shift; + my $link=shift; + + push @{$links{$page}}, $link + unless grep { $_ eq $link } @{$links{$page}}; +} + sub pagespec_merge ($$) { my $a=shift; my $b=shift; diff --git a/IkiWiki/Plugin/camelcase.pm b/IkiWiki/Plugin/camelcase.pm index 74a8397d7..088447d6b 100644 --- a/IkiWiki/Plugin/camelcase.pm +++ b/IkiWiki/Plugin/camelcase.pm @@ -61,7 +61,7 @@ sub scan (@) { my $content=$params{content}; while ($content =~ /$link_regexp/g) { - push @{$links{$page}}, linkpage($1) unless ignored($1) + add_link($page, linkpage($1)) unless ignored($1) } } diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index d295b833b..a697fea19 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -43,7 +43,7 @@ sub preprocess (@) { return ''; } - push @{$links{$params{page}}}, $image; + add_link($params{page}, $image); # optimisation: detect scan mode, and avoid generating the image if (! defined wantarray) { return; diff --git a/IkiWiki/Plugin/link.pm b/IkiWiki/Plugin/link.pm index b79273f96..4c1add985 100644 --- a/IkiWiki/Plugin/link.pm +++ b/IkiWiki/Plugin/link.pm @@ -86,7 +86,7 @@ sub scan (@) { my $content=$params{content}; while ($content =~ /(? pagetitle($1)); } else { my $tag=linkpage($_); $tags{$params{page}}{$tag}=1; - push @{$links{$params{page}}}, tagpage($tag); + add_link($params{page}, tagpage($tag)); return taglink($params{page}, $params{destpage}, $tag); } } diff --git a/debian/NEWS b/debian/NEWS index 22513cc4a..62e1543b3 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,12 @@ +ikiwiki (3.12) UNRELEASED; urgency=low + + You may want to run `ikiwiki-transition deduplinks /path/to/srcdir` + after upgrading to this version of ikiwiki. This command will + optimise your wiki's saved state, removing duplicate information + that can slow ikiwiki down. + + -- Joey Hess Wed, 06 May 2009 00:25:06 -0400 + ikiwiki (3.01) unstable; urgency=low If your wiki uses git, and you have a `diffurl` configured in diff --git a/debian/changelog b/debian/changelog index 9244ccdb8..1e1d48d78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,10 @@ ikiwiki (3.12) UNRELEASED; urgency=low fails on nonexistant directories with some broken perl versions. * inline: Minor optimisation. + * add_link: New function, which plugins should use rather than + modifying %links directly, to avoid it accumulating duplicates. + * ikiwiki-transition: Add a deduplinks action, that can be used + to remove duplicate links and optimise a wiki w/o rebuilding it. -- Joey Hess Mon, 04 May 2009 19:17:39 -0400 diff --git a/doc/ikiwiki-transition.mdwn b/doc/ikiwiki-transition.mdwn index 18836d5f5..e0b853ecf 100644 --- a/doc/ikiwiki-transition.mdwn +++ b/doc/ikiwiki-transition.mdwn @@ -61,6 +61,13 @@ If this is not done explicitly, a user's plaintext password will be automatically converted to a hash when a user logs in for the first time after upgrade to ikiwiki 2.48. +# deduplinks srcdir + +In the past, bugs in ikiwiki have allowed duplicate link information +to be stored in its indexdb. This mode removes such duplicate information, +which may speed up wikis afflicted by it. Note that rebuilding the wiki +will have the same effect. + # AUTHOR Josh Triplett , Joey Hess diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 0b358b215..28da243d5 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -107,8 +107,8 @@ adding or removing files from it. This hook is called early in the process of building the wiki, and is used as a first pass scan of the page, to collect metadata about the page. It's -mostly used to scan the page for [[WikiLinks|ikiwiki/WikiLink]], and add them to `%links`. -Present in IkiWiki 2.40 and later. +mostly used to scan the page for [[WikiLinks|ikiwiki/WikiLink]], and add +them to `%links`. Present in IkiWiki 2.40 and later. The function is passed named parameters "page" and "content". Its return value is ignored. @@ -151,11 +151,11 @@ parameter is set to a true value if the page is being previewed. If `hook` is passed an optional "scan" parameter, set to a true value, this makes the hook be called during the preliminary scan that ikiwiki makes of updated pages, before begining to render pages. This should be done if the -hook modifies data in `%links`. Note that doing so will make the hook be -run twice per page build, so avoid doing it for expensive hooks. (As an -optimisation, if your preprocessor hook is called in a void context, you -can assume it's being run in scan mode, and avoid doing expensive things at -that point.) +hook modifies data in `%links` (typically by calling `add_link`). Note that +doing so will make the hook be run twice per page build, so avoid doing it +for expensive hooks. (As an optimisation, if your preprocessor hook is +called in a void context, you can assume it's being run in scan mode, and +avoid doing expensive things at that point.) Note that if the [[htmlscrubber]] is enabled, html in preprocessor [[ikiwiki/directive]] output is sanitised, which may limit what @@ -174,7 +174,8 @@ links. The function is passed named parameters "page", "destpage", and and later. Plugins that implement linkify must also implement a scan hook, that scans -for the links on the page and adds them to `%links`. +for the links on the page and adds them to `%links` (typically by calling +`add_link`). ### htmlize @@ -753,6 +754,11 @@ Optionally, a third parameter can be passed, to specify the preferred filename of the page. For example, `targetpage("foo", "rss", "feed")` will yield something like `foo/feed.rss`. +#### `add_link($$)` + +This adds a link to `%links`, ensuring that duplicate links are not +added. Pass it the page that contains the link, and the link text. + ## Miscellaneous ### Internal use pages diff --git a/ikiwiki-transition b/ikiwiki-transition index 599261a09..f17868d73 100755 --- a/ikiwiki-transition +++ b/ikiwiki-transition @@ -220,6 +220,21 @@ sub moveprefs { IkiWiki::Setup::dump($setup); } +sub deduplinks { + my $dir=shift; + if (! defined $dir) { + usage(); + } + $config{wikistatedir}=$dir."/.ikiwiki"; + IkiWiki::loadindex(); + foreach my $page (keys %links) { + my %l; + $l{$_}=1 foreach @{$links{$page}}; + $links{$page}=[keys %l] + } + IkiWiki::saveindex(); +} + sub usage { print STDERR "Usage: ikiwiki-transition type ...\n"; print STDERR "Currently supported transition subcommands:\n"; @@ -229,6 +244,7 @@ sub usage { print STDERR "\tmoveprefs setupfile\n"; print STDERR "\thashpassword srcdir\n"; print STDERR "\tindexdb srcdir\n"; + print STDERR "\tdeduplinks srcdir\n"; exit 1; } @@ -253,6 +269,9 @@ elsif ($mode eq 'setupformat') { elsif ($mode eq 'moveprefs') { moveprefs(@ARGV); } +elsif ($mode eq 'deduplinks') { + deduplinks(@ARGV); +} else { usage(); } -- cgit v1.2.3 From d3188a04fff1d0ed7329b3aae8343beaf1735390 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 May 2009 12:57:37 -0400 Subject: external: Fix pagespec_match and pagespec_match_list. Closes: #527281 --- IkiWiki/Plugin/external.pm | 10 ++++++++-- debian/NEWS | 2 +- debian/changelog | 6 ++++-- 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm index f0acc7e4e..57a72eb68 100644 --- a/IkiWiki/Plugin/external.pm +++ b/IkiWiki/Plugin/external.pm @@ -232,15 +232,21 @@ sub hook ($@) { sub pagespec_match ($@) { # convert return object into a XML RPC boolean my $plugin=shift; + my $page=shift; + my $spec=shift; - return RPC::XML::boolean->new(0 + IkiWiki::pagespec_match(@_)); + return RPC::XML::boolean->new(0 + IkiWiki::pagespec_match( + $page, $spec, @_)); } sub pagespec_match_list ($@) { # convert return object into a XML RPC boolean my $plugin=shift; + my $pages=shift; + my $spec=shift; - return RPC::XML::boolean->new(0 + IkiWiki::pagespec_match_list(@_)); + return RPC::XML::boolean->new(0 + IkiWiki::pagespec_match_list( + $pages, $spec, @_)); } 1 diff --git a/debian/NEWS b/debian/NEWS index 62e1543b3..7daa350d9 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,4 +1,4 @@ -ikiwiki (3.12) UNRELEASED; urgency=low +ikiwiki (3.12) unstable; urgency=low You may want to run `ikiwiki-transition deduplinks /path/to/srcdir` after upgrading to this version of ikiwiki. This command will diff --git a/debian/changelog b/debian/changelog index 1e1d48d78..d4fe91b88 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ikiwiki (3.12) UNRELEASED; urgency=low +ikiwiki (3.12) unstable; urgency=low * Re-enable python-support and add python:Depends to control file. * ikiwiki-makerepo: Avoid using abs_path, as it apparently @@ -9,8 +9,10 @@ ikiwiki (3.12) UNRELEASED; urgency=low modifying %links directly, to avoid it accumulating duplicates. * ikiwiki-transition: Add a deduplinks action, that can be used to remove duplicate links and optimise a wiki w/o rebuilding it. + * external: Fix pagespec_match and pagespec_match_list. + Closes: #527281 - -- Joey Hess Mon, 04 May 2009 19:17:39 -0400 + -- Joey Hess Wed, 06 May 2009 00:31:16 -0400 ikiwiki (3.11) unstable; urgency=low -- cgit v1.2.3 From 838955aba445f29b7990c7be97c505b6cbe86057 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 May 2009 13:13:01 -0400 Subject: remove pagespec_match_list override for external Not needed since it returns a list of pages, not a fail/success object. --- IkiWiki/Plugin/external.pm | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm index 57a72eb68..0d292dfc2 100644 --- a/IkiWiki/Plugin/external.pm +++ b/IkiWiki/Plugin/external.pm @@ -239,14 +239,4 @@ sub pagespec_match ($@) { $page, $spec, @_)); } -sub pagespec_match_list ($@) { - # convert return object into a XML RPC boolean - my $plugin=shift; - my $pages=shift; - my $spec=shift; - - return RPC::XML::boolean->new(0 + IkiWiki::pagespec_match_list( - $pages, $spec, @_)); -} - 1 -- cgit v1.2.3 From 30248df40a19dc03c0d8c07e136105f3c2299191 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 16 May 2009 13:56:25 +0100 Subject: check for longname for each syntax plugin We build an array of [ plugin name, long name ] pairs, where long name is an optional argument to hook(). So, a syntax plugin could define long "friendly" name, such as "Markdown" instead of mdwn, and we would then pass this array to formbuilder to populate the drop-down on the edit page. --- IkiWiki/Plugin/editpage.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 0068a6b11..eb6a7bbcb 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -276,8 +276,14 @@ sub cgi_editpage ($$) { my @page_types; if (exists $hooks{htmlize}) { - @page_types=grep { !/^_/ } - keys %{$hooks{htmlize}}; + foreach my $key (grep { !/^_/ } keys %{$hooks{htmlize}}) { + my $pluginref = ${$hooks{htmlize}}{$key}; + if(${$pluginref}{'longname'}) { + push @page_types, [$key, ${$pluginref}{'longname'}]; + } else { + push @page_types, [$key, $key]; + } + } } $form->tmpl_param("page_select", 1); -- cgit v1.2.3 From 79510950f09ace7906e149799ffda5aa26decbf6 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 16 May 2009 13:59:27 +0100 Subject: add a long name for mdwn ("Markdown") --- IkiWiki/Plugin/mdwn.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index 0e134c822..c62780cb8 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -8,7 +8,7 @@ use IkiWiki 3.00; sub import { hook(type => "getsetup", id => "mdwn", call => \&getsetup); - hook(type => "htmlize", id => "mdwn", call => \&htmlize); + hook(type => "htmlize", id => "mdwn", call => \&htmlize, longname => "Markdown"); } sub getsetup () { -- cgit v1.2.3 From 83e3fc3af031abfd0321fadf0a64bbf6ecee5886 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 16 May 2009 13:59:36 +0100 Subject: add a long name for textile/txtl ("Textile") --- IkiWiki/Plugin/textile.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/textile.pm b/IkiWiki/Plugin/textile.pm index b604aa3c5..8cc5a7951 100644 --- a/IkiWiki/Plugin/textile.pm +++ b/IkiWiki/Plugin/textile.pm @@ -11,7 +11,7 @@ use Encode; sub import { hook(type => "getsetup", id => "textile", call => \&getsetup); - hook(type => "htmlize", id => "txtl", call => \&htmlize); + hook(type => "htmlize", id => "txtl", call => \&htmlize, longname => "Textile"); } sub getsetup () { -- cgit v1.2.3 From eba9b862b2f7d346dfffcd5576cd96fce9dd239d Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Sat, 16 May 2009 14:44:23 +0100 Subject: tidy up new page_types code --- IkiWiki/Plugin/editpage.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index eb6a7bbcb..af42097ba 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -277,12 +277,7 @@ sub cgi_editpage ($$) { my @page_types; if (exists $hooks{htmlize}) { foreach my $key (grep { !/^_/ } keys %{$hooks{htmlize}}) { - my $pluginref = ${$hooks{htmlize}}{$key}; - if(${$pluginref}{'longname'}) { - push @page_types, [$key, ${$pluginref}{'longname'}]; - } else { - push @page_types, [$key, $key]; - } + push @page_types, [$key, $hooks{htmlize}{$key}{longname} || $key]; } } -- cgit v1.2.3