}
if (defined $config{locale}) {
eval q{use POSIX};
+ error($@) if $@;
$ENV{LANG} = $config{locale}
if POSIX::setlocale(&POSIX::LC_TIME, $config{locale});
}
if ($config{w3mmode}) {
eval q{use Cwd q{abs_path}};
+ error($@) if $@;
$config{srcdir}=possibly_foolish_untaint(abs_path($config{srcdir}));
$config{destdir}=possibly_foolish_untaint(abs_path($config{destdir}));
$config{cgiurl}="file:///\$LIB/ikiwiki-w3m.cgi/".$config{cgiurl}
my $time=shift;
eval q{use POSIX};
+ error($@) if $@;
# strftime doesn't know about encodings, so make sure
# its output is properly treated as utf8
return decode_utf8(POSIX::strftime(
# during page builds as the return values may change, but they
# won't here.)
eval q{use Memoize};
+ error($@) if $@;
memoize("htmllink");
eval q{use Time::Duration};
+ error($@) if $@;
eval q{use CGI 'escapeHTML'};
+ error($@) if $@;
my $changelog=[rcs_recentchanges(100)];
foreach my $change (@$changelog) {
my $session=shift;
eval q{use CGI::FormBuilder};
+ error($@) if $@;
my $form = CGI::FormBuilder->new(
title => "signin",
fields => [qw(do title page subpage from name password)],
);
eval q{use Mail::Sendmail};
+ error($@) if $@;
sendmail(
To => userinfo_get($user_name, "email"),
From => "$config{wikiname} admin <$config{adminemail}>",
my $session=shift;
eval q{use CGI::FormBuilder};
+ error($@) if $@;
my $form = CGI::FormBuilder->new(
title => "preferences",
fields => [qw(do name password confirm_password email
my @buttons=("Save Page", "Preview", "Cancel");
eval q{use CGI::FormBuilder; use CGI::FormBuilder::Template::HTML};
+ error($@) if $@;
my $renderer=CGI::FormBuilder::Template::HTML->new(
fields => \@fields,
template_params("editpage.tmpl"),
} #}}}
sub cgi () { #{{{
- eval q{use CGI};
- eval q{use CGI::Session};
+ eval q{use CGI; use CGI::Session};
+ error($@) if $@;
my $q=CGI->new;
sub getopt () { #{{{
eval q{use Getopt::Long};
+ error($@) if $@;
Getopt::Long::Configure('pass_through');
GetOptions("aggregate" => \$config{aggregate});
} #}}}
sub savestate () { #{{{
eval q{use HTML::Entities};
- die $@ if $@;
+ error($@) if $@;
open (OUT, ">$config{wikistatedir}/aggregate" ||
die "$config{wikistatedir}/aggregate: $!");
foreach my $data (values %feeds, values %guids) {
sub aggregate () { #{{{
eval q{use XML::Feed};
- die $@ if $@;
+ error($@) if $@;
eval q{use HTML::Entities};
- die $@ if $@;
+ error($@) if $@;
foreach my $feed (values %feeds) {
next unless $config{rebuild} ||
# to avoid unneccessary rebuilding. The mtime from rss cannot be
# trusted; let's use a digest.
eval q{use Digest::MD5 'md5_hex'};
+ error($@) if $@;
require Encode;
my $digest=md5_hex(Encode::encode_utf8($params{content}));
return unless ! exists $guid->{md5} || $guid->{md5} ne $digest || $config{rebuild};
return $_scrubber if defined $_scrubber;
eval q{use HTML::Scrubber};
+ error($@) if $@;
# Lists based on http://feedparser.org/docs/html-sanitization.html
$_scrubber = HTML::Scrubber->new(
allow => [qw{
my $time=shift;
eval q{use POSIX};
+ error($@) if $@;
my $lc_time= POSIX::setlocale(&POSIX::LC_TIME);
POSIX::setlocale(&POSIX::LC_TIME, "C");
my $ret=POSIX::strftime("%a, %d %b %Y %H:%M:%S %z", localtime($time));
my $time=shift;
eval q{use POSIX};
+ error($@) if $@;
my $lc_time= POSIX::setlocale(&POSIX::LC_TIME);
POSIX::setlocale(&POSIX::LC_TIME, "C");
my $ret=POSIX::strftime("%Y-%m-%dT%H:%M:%SZ", localtime($time));
sub getopt () { #{{{
eval q{use Getopt::Long};
+ error($@) if $@;
Getopt::Long::Configure('pass_through');
GetOptions("estseek=s" => \$config{estseek});
} #}}}
sub getopt () { #{{{
eval q{use Getopt::Long};
+ error($@) if $@;
Getopt::Long::Configure('pass_through');
GetOptions("tagbase=s" => \$config{tagbase});
} #}}}
my ($num) = @_;
eval q{use Date::Parse};
+ error($@) if $@;
my ($sha1, $type, $when, $diffurl, $user, @pages, @message, @rets);
INFO: foreach my $ci (git_commit_info('HEAD', $num)) {
);
eval q{use Mail::Sendmail};
+ error($@) if $@;
foreach my $email (@email_recipients) {
sendmail(
To => $email,
my ($num) = @_;
eval q{use CGI 'escapeHTML'};
+ error($@) if $@;
my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", "-l", $num);
open (my $out, "@cmdline |");
return unless -d "$config{srcdir}/.svn";
- eval q{use Date::Parse};
- eval q{use Time::Duration};
- eval q{use XML::SAX};
- eval q{use XML::Simple};
+ eval q{
+ use Date::Parse;
+ use Time::Duration;
+ use XML::SAX;
+ use XML::Simple;
+ };
+ error($@) if $@;
# avoid using XML::SAX::PurePerl, it's buggy with UTF-8 data
my @parsers = map { ${$_}{Name} } @{XML::SAX->parsers()};
);
eval q{use Mail::Sendmail};
+ error($@) if $@;
foreach my $email (@email_recipients) {
sendmail(
To => $email,
}
eval q{use Date::Parse};
+ error($@) if $@;
$date=str2time($date);
debug("found ctime ".localtime($date)." for $file");
return $date;
return unless -d "$config{srcdir}/{arch}";
eval q{use Date::Parse};
+ error($@) if $@;
eval q{use Mail::Header};
+ error($@) if $@;
my $logs = `tla logs -d $config{srcdir}`;
my @changesets = reverse split(/\n/, $logs);
my $rev=int(possibly_foolish_untaint($ENV{REV}));
eval q{use Mail::Header};
+ error($@) if $@;
open(LOG, $ENV{"ARCH_LOG"});
my $head = Mail::Header->new(\*LOG);
close(LOG);
);
eval q{use Mail::Sendmail};
+ error($@) if $@;
foreach my $email (@email_recipients) {
sendmail(
To => $email,
sub rcs_getctime ($) { #{{{
my $file=shift;
eval q{use Date::Parse};
+ error($@) if $@;
eval q{use Mail::Header};
+ error($@) if $@;
my $logs = `tla logs -d $config{srcdir}`;
my @changesets = reverse split(/\n/, $logs);
my %exists;
my @files;
eval q{use File::Find};
+ error($@) if $@;
find({
no_chdir => 1,
wanted => sub {
* Enable utf8 file IO in aggregate plugin.
* Fix some issues with the new registration form.
* Patch from Ethan Glasser Camp to add a skip option to the inline plugin.
+ * Make sure to check for errors from every eval.
- -- Joey Hess <joeyh@debian.org> Wed, 8 Nov 2006 15:39:16 -0500
+ -- Joey Hess <joeyh@debian.org> Wed, 8 Nov 2006 15:57:35 -0500
ikiwiki (1.32) unstable; urgency=low
* And if Foo/Bar/Baz is then removed, it forgets to update Foo/Bar to link
back to Foo/Baz.
- -- is this still true? (Yes (as of 1.0))
+As of 1.33, this is still true. The buggy code is the %linkchanged
+calculation in refresh(), which doesn't detect that the link has changed in
+this case.