* Optimise displaytime, trimming maybe 6% off the build time.
parent
15d61ff4ed
commit
13c7a51f1f
|
@ -6,6 +6,7 @@ use strict;
|
||||||
use Encode;
|
use Encode;
|
||||||
use HTML::Entities;
|
use HTML::Entities;
|
||||||
use URI::Escape q{uri_escape_utf8};
|
use URI::Escape q{uri_escape_utf8};
|
||||||
|
use POSIX;
|
||||||
use open qw{:utf8 :std};
|
use open qw{:utf8 :std};
|
||||||
|
|
||||||
use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
|
use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
|
||||||
|
@ -83,8 +84,6 @@ sub checkconfig () { #{{{
|
||||||
delete $ENV{LC_ALL};
|
delete $ENV{LC_ALL};
|
||||||
}
|
}
|
||||||
if (defined $config{locale}) {
|
if (defined $config{locale}) {
|
||||||
eval q{use POSIX};
|
|
||||||
error($@) if $@;
|
|
||||||
if (POSIX::setlocale(&POSIX::LC_ALL, $config{locale})) {
|
if (POSIX::setlocale(&POSIX::LC_ALL, $config{locale})) {
|
||||||
$ENV{LANG}=$config{locale};
|
$ENV{LANG}=$config{locale};
|
||||||
$gettext_obj=undef;
|
$gettext_obj=undef;
|
||||||
|
@ -434,8 +433,6 @@ sub abs2rel ($$) { #{{{
|
||||||
sub displaytime ($) { #{{{
|
sub displaytime ($) { #{{{
|
||||||
my $time=shift;
|
my $time=shift;
|
||||||
|
|
||||||
eval q{use POSIX};
|
|
||||||
error($@) if $@;
|
|
||||||
# strftime doesn't know about encodings, so make sure
|
# strftime doesn't know about encodings, so make sure
|
||||||
# its output is properly treated as utf8
|
# its output is properly treated as utf8
|
||||||
return decode_utf8(POSIX::strftime(
|
return decode_utf8(POSIX::strftime(
|
||||||
|
|
|
@ -319,7 +319,6 @@ sub add_page (@) { #{{{
|
||||||
|
|
||||||
# Make sure that the file name isn't too long.
|
# Make sure that the file name isn't too long.
|
||||||
# NB: This doesn't check for path length limits.
|
# NB: This doesn't check for path length limits.
|
||||||
eval q{use POSIX};
|
|
||||||
my $max=POSIX::pathconf($config{srcdir}, &POSIX::_PC_NAME_MAX);
|
my $max=POSIX::pathconf($config{srcdir}, &POSIX::_PC_NAME_MAX);
|
||||||
if (defined $max && length(htmlfn($page)) >= $max) {
|
if (defined $max && length(htmlfn($page)) >= $max) {
|
||||||
$c="";
|
$c="";
|
||||||
|
|
|
@ -266,8 +266,6 @@ sub get_inline_content ($$) { #{{{
|
||||||
sub date_822 ($) { #{{{
|
sub date_822 ($) { #{{{
|
||||||
my $time=shift;
|
my $time=shift;
|
||||||
|
|
||||||
eval q{use POSIX};
|
|
||||||
error($@) if $@;
|
|
||||||
my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
|
my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
|
||||||
POSIX::setlocale(&POSIX::LC_TIME, "C");
|
POSIX::setlocale(&POSIX::LC_TIME, "C");
|
||||||
my $ret=POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time));
|
my $ret=POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time));
|
||||||
|
@ -278,8 +276,6 @@ sub date_822 ($) { #{{{
|
||||||
sub date_3339 ($) { #{{{
|
sub date_3339 ($) { #{{{
|
||||||
my $time=shift;
|
my $time=shift;
|
||||||
|
|
||||||
eval q{use POSIX};
|
|
||||||
error($@) if $@;
|
|
||||||
my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
|
my $lc_time=POSIX::setlocale(&POSIX::LC_TIME);
|
||||||
POSIX::setlocale(&POSIX::LC_TIME, "C");
|
POSIX::setlocale(&POSIX::LC_TIME, "C");
|
||||||
my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", localtime($time));
|
my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", localtime($time));
|
||||||
|
@ -401,7 +397,6 @@ sub pingurl (@) { #{{{
|
||||||
defined(my $pid = fork) or error("Can't fork: $!");
|
defined(my $pid = fork) or error("Can't fork: $!");
|
||||||
return if $pid;
|
return if $pid;
|
||||||
chdir '/';
|
chdir '/';
|
||||||
eval q{use POSIX 'setsid'};
|
|
||||||
setsid() or error("Can't start a new session: $!");
|
setsid() or error("Can't start a new session: $!");
|
||||||
open STDIN, '/dev/null';
|
open STDIN, '/dev/null';
|
||||||
open STDOUT, '>/dev/null';
|
open STDOUT, '>/dev/null';
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
use warnings;
|
use warnings;
|
||||||
use strict;
|
use strict;
|
||||||
use IkiWiki;
|
use IkiWiki;
|
||||||
use POSIX qw(setlocale LC_CTYPE);
|
|
||||||
|
|
||||||
package IkiWiki;
|
package IkiWiki;
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,6 @@ sub send_commit_mails ($$$@) { #{{{
|
||||||
# Daemonize, in case the mail sending takes a while.
|
# Daemonize, in case the mail sending takes a while.
|
||||||
defined(my $pid = fork) or error("Can't fork: $!");
|
defined(my $pid = fork) or error("Can't fork: $!");
|
||||||
return if $pid;
|
return if $pid;
|
||||||
eval q{use POSIX 'setsid'};
|
|
||||||
setsid() or error("Can't start a new session: $!");
|
setsid() or error("Can't start a new session: $!");
|
||||||
chdir '/';
|
chdir '/';
|
||||||
open STDIN, '/dev/null';
|
open STDIN, '/dev/null';
|
||||||
|
|
|
@ -14,8 +14,9 @@ ikiwiki (1.50) UNRELEASED; urgency=low
|
||||||
the source page used to create it, ie it's the reverse of %renderedfiles.
|
the source page used to create it, ie it's the reverse of %renderedfiles.
|
||||||
* Use %destsources in htmllink and urlto for 20-50% speedup. Thanks
|
* Use %destsources in htmllink and urlto for 20-50% speedup. Thanks
|
||||||
Josh Triplett for the idea.
|
Josh Triplett for the idea.
|
||||||
|
* Optimise displaytime, trimming maybe 6% off the build time.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Mon, 09 Apr 2007 21:09:32 -0400
|
-- Joey Hess <joeyh@debian.org> Mon, 09 Apr 2007 21:42:14 -0400
|
||||||
|
|
||||||
ikiwiki (1.49) unstable; urgency=low
|
ikiwiki (1.49) unstable; urgency=low
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2007-04-09 21:13-0400\n"
|
"POT-Creation-Date: 2007-04-09 21:45-0400\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -101,7 +101,7 @@ msgstr ""
|
||||||
msgid "processed ok at %s"
|
msgid "processed ok at %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../IkiWiki/Plugin/aggregate.pm:334
|
#: ../IkiWiki/Plugin/aggregate.pm:333
|
||||||
#, perl-format
|
#, perl-format
|
||||||
msgid "creating new page %s"
|
msgid "creating new page %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -169,7 +169,7 @@ msgstr ""
|
||||||
msgid "Discussion"
|
msgid "Discussion"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../IkiWiki/Plugin/inline.pm:396
|
#: ../IkiWiki/Plugin/inline.pm:392
|
||||||
msgid "RPC::XML::Client not found, not pinging"
|
msgid "RPC::XML::Client not found, not pinging"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -541,11 +541,11 @@ msgstr ""
|
||||||
msgid "usage: ikiwiki [options] source dest"
|
msgid "usage: ikiwiki [options] source dest"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../IkiWiki.pm:105
|
#: ../IkiWiki.pm:104
|
||||||
msgid "Must specify url to wiki with --url when using --cgi"
|
msgid "Must specify url to wiki with --url when using --cgi"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../IkiWiki.pm:152 ../IkiWiki.pm:153
|
#: ../IkiWiki.pm:151 ../IkiWiki.pm:152
|
||||||
msgid "Error"
|
msgid "Error"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -553,7 +553,7 @@ msgstr ""
|
||||||
#. translators: preprocessor directive name,
|
#. translators: preprocessor directive name,
|
||||||
#. translators: the second a page name, the
|
#. translators: the second a page name, the
|
||||||
#. translators: third a number.
|
#. translators: third a number.
|
||||||
#: ../IkiWiki.pm:625
|
#: ../IkiWiki.pm:622
|
||||||
#, perl-format
|
#, perl-format
|
||||||
msgid "%s preprocessing loop detected on %s at depth %i"
|
msgid "%s preprocessing loop detected on %s at depth %i"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
Loading…
Reference in New Issue