From: Joey Hess Date: Sun, 19 Jul 2009 10:36:01 +0000 (+0200) Subject: Merge branch 'master' into po X-Git-Url: https://scripts.mit.edu/gitweb/www/ikiwiki.git/commitdiff_plain/ec965fc92cd41f597c6e8e88584b9a688407c8c6?hp=-c Merge branch 'master' into po Conflicts: debian/changelog --- ec965fc92cd41f597c6e8e88584b9a688407c8c6 diff --combined IkiWiki.pm index 67c1c6610,0cb3bf143..a11b330f2 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@@ -14,7 -14,7 +14,7 @@@ use open qw{:utf8 :std} use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase %pagestate %wikistate %renderedfiles %oldrenderedfiles %pagesources %destsources %depends %hooks %forcerebuild - $gettext_obj %loaded_plugins}; + %loaded_plugins}; use Exporter q{import}; our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match @@@ -459,7 -459,7 +459,7 @@@ sub checkconfig () if (defined $config{locale}) { if (POSIX::setlocale(&POSIX::LC_ALL, $config{locale})) { $ENV{LANG}=$config{locale}; - $gettext_obj=undef; + define_gettext(); } } @@@ -1063,6 -1063,41 +1063,41 @@@ sub htmllink ($$$;@) return "$linktext"; } + sub openiduser ($) { + my $user=shift; + + if ($user =~ m!^https?://! && + eval q{use Net::OpenID::VerifiedIdentity; 1} && !$@) { + my $display; + + if (Net::OpenID::VerifiedIdentity->can("DisplayOfURL")) { + # this works in at least 2.x + $display = Net::OpenID::VerifiedIdentity::DisplayOfURL($user); + } + else { + # this only works in 1.x + my $oid=Net::OpenID::VerifiedIdentity->new(identity => $user); + $display=$oid->display; + } + + # Convert "user.somehost.com" to "user [somehost.com]" + # (also "user.somehost.co.uk") + if ($display !~ /\[/) { + $display=~s/^([-a-zA-Z0-9]+?)\.([-.a-zA-Z0-9]+\.[a-z]+)$/$1 [$2]/; + } + # Convert "http://somehost.com/user" to "user [somehost.com]". + # (also "https://somehost.com/user/") + if ($display !~ /\[/) { + $display=~s/^https?:\/\/(.+)\/([^\/]+)\/?$/$2 [$1]/; + } + $display=~s!^https?://!!; # make sure this is removed + eval q{use CGI 'escapeHTML'}; + error($@) if $@; + return escapeHTML($display); + } + return; + } + sub userlink ($) { my $user=shift; @@@ -1346,7 -1381,7 +1381,7 @@@ sub check_content (@) foreach my $line (split("\n", $params{content})) { push @diff, $line if ! exists $old{$_}; } - $params{content}=join("\n", @diff); + $params{diff}=join("\n", @diff); } my $ok; @@@ -1704,29 -1739,37 +1739,37 @@@ sub file_pruned ($$) return $file =~ m/$regexp/ && $file ne $base; } - sub gettext { - # Only use gettext in the rare cases it's needed. + sub define_gettext () { + # If translation is needed, redefine the gettext function to do it. + # Otherwise, it becomes a quick no-op. + no warnings 'redefine'; if ((exists $ENV{LANG} && length $ENV{LANG}) || (exists $ENV{LC_ALL} && length $ENV{LC_ALL}) || (exists $ENV{LC_MESSAGES} && length $ENV{LC_MESSAGES})) { - if (! $gettext_obj) { - $gettext_obj=eval q{ + *gettext=sub { + my $gettext_obj=eval q{ use Locale::gettext q{textdomain}; Locale::gettext->domain('ikiwiki') }; - if ($@) { - print STDERR "$@"; - $gettext_obj=undef; + + if ($gettext_obj) { + $gettext_obj->get(shift); + } + else { return shift; } - } - return $gettext_obj->get(shift); + }; } else { - return shift; + *gettext=sub { return shift }; } } + sub gettext { + define_gettext(); + gettext(@_); + } + sub yesno ($) { my $val=shift; diff --combined debian/changelog index d72efe455,05b7be70f..dffab5349 --- a/debian/changelog +++ b/debian/changelog @@@ -1,4 -1,22 +1,31 @@@ - ikiwiki (3.15) UNRELEASED; urgency=low ++ikiwiki (3.15) unstable; urgency=low ++ ++ * Add new hooks: canremove, canrename, rename. (intrigeri) ++ * rename: Refactor subpage rename handling code into rename hook. (intrigeri) ++ * po: New plugin, suporting translation of wiki pages using po files. ++ (intrigeri) ++ ++ -- Joey Hess Tue, 02 Jun 2009 17:03:41 -0400 ++ + ikiwiki (3.14159) unstable; urgency=low + + * svn: Fix rcs_rename to properly scope call to dirname. + * img: Pass the align parameter through to the generated img tag. + * Move OpenID pretty-printing from openid plugin to core (smcv) + + -- Joey Hess Thu, 16 Jul 2009 14:37:22 -0400 + + ikiwiki (3.1415) unstable; urgency=low + + * img: Fix extra double quote with alt text. (smcv) + * Updated French debconf templates translation. Closes: #535103 + * openid: Support Net::OpenID 2.x when pretty-printing + openids. (smcv) + * highlight: Fix utf-8 encoding bug. Closes: #535028 + + -- Joey Hess Tue, 07 Jul 2009 16:25:05 -0400 + + ikiwiki (3.141) unstable; urgency=low * comment: Make comment directives no longer use the internal "_comment" form, and document the comment directive syntax. @@@ -18,12 -36,16 +45,16 @@@ name, to support several cases including mercurial's long user names on the RecentChanges page, and urls with spaces being handled by the 404 plugin. - * Add new hooks: canremove, canrename, rename. (intrigeri) - * rename: Refactor subpage rename handling code into rename hook. (intrigeri) - * po: New plugin, suporting translation of wiki pages using po files. - (intrigeri) + * Optimise use of gettext, and avoid ugly warnings if Locale::gettext + is not available. Closes: #532285 + * meta: Add openid delegate parameter to allow delegating only + openid or openid2. + * Disable the Preferences link if no plugin with an auth hook is enabled. + * Updated French translation. Closes: #532654 + * aggregate: Fix storing of changed md5. + * aggregate: Avoid resetting ctime when an item md5 changes. - -- Joey Hess Tue, 02 Jun 2009 17:03:41 -0400 + -- Joey Hess Fri, 12 Jun 2009 19:50:46 -0400 ikiwiki (3.14) unstable; urgency=low