]> scripts.mit.edu Git - www/ikiwiki.git/commitdiff
Merge branch 'master' into po
authorJoey Hess <joey@gnu.kitenet.net>
Sun, 19 Jul 2009 10:36:01 +0000 (12:36 +0200)
committerJoey Hess <joey@gnu.kitenet.net>
Sun, 19 Jul 2009 10:36:01 +0000 (12:36 +0200)
Conflicts:
debian/changelog

1  2 
IkiWiki.pm
debian/changelog

diff --combined IkiWiki.pm
index 67c1c661055f3afaac79d23663908283bd08c11c,0cb3bf143cc65963b2263486d0ce3c7b8677e73f..a11b330f2126a038f69678512e1a1ba2f2c238fb
@@@ -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 "<a href=\"$bestlink\"@attrs>$linktext</a>";
  }
  
+ 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 d72efe455c1bc0071d8f9a5b4817b345c13a2c62,05b7be70fb769419e18afb3792c8123587539289..dffab53497b78231eeb594b457d61dd887dfa56e
@@@ -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 <joeyh@debian.org>  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 <joeyh@debian.org>  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 <joeyh@debian.org>  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.
      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 <joeyh@debian.org>  Tue, 02 Jun 2009 17:03:41 -0400
+  -- Joey Hess <joeyh@debian.org>  Fri, 12 Jun 2009 19:50:46 -0400
  
  ikiwiki (3.14) unstable; urgency=low