summaryrefslogtreecommitdiff
path: root/IkiWiki/Rcs
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-11-08 21:03:33 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-11-08 21:03:33 +0000
commit35ee7e44a62f9126a83c1243b549d47cc5ca7b43 (patch)
treeba5c6a377f586a8c7114fb4387b2386f06f5e1ee /IkiWiki/Rcs
parentdd2ce6e6a064b804902369c74f8a654755ea3de2 (diff)
* Make sure to check for errors from every eval.
Diffstat (limited to 'IkiWiki/Rcs')
-rw-r--r--IkiWiki/Rcs/git.pm2
-rw-r--r--IkiWiki/Rcs/mercurial.pm1
-rw-r--r--IkiWiki/Rcs/svn.pm13
-rw-r--r--IkiWiki/Rcs/tla.pm6
4 files changed, 18 insertions, 4 deletions
diff --git a/IkiWiki/Rcs/git.pm b/IkiWiki/Rcs/git.pm
index 09275fe5f..c8b5adc45 100644
--- a/IkiWiki/Rcs/git.pm
+++ b/IkiWiki/Rcs/git.pm
@@ -344,6 +344,7 @@ sub rcs_recentchanges ($) { #{{{
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)) {
@@ -458,6 +459,7 @@ sub rcs_notify () { #{{{
);
eval q{use Mail::Sendmail};
+ error($@) if $@;
foreach my $email (@email_recipients) {
sendmail(
To => $email,
diff --git a/IkiWiki/Rcs/mercurial.pm b/IkiWiki/Rcs/mercurial.pm
index 82a2fa642..36972c560 100644
--- a/IkiWiki/Rcs/mercurial.pm
+++ b/IkiWiki/Rcs/mercurial.pm
@@ -91,6 +91,7 @@ sub rcs_recentchanges ($) { #{{{
my ($num) = @_;
eval q{use CGI 'escapeHTML'};
+ error($@) if $@;
my @cmdline = ("hg", "-R", $config{srcdir}, "log", "-v", "-l", $num);
open (my $out, "@cmdline |");
diff --git a/IkiWiki/Rcs/svn.pm b/IkiWiki/Rcs/svn.pm
index f3e353cbe..2d3ad046c 100644
--- a/IkiWiki/Rcs/svn.pm
+++ b/IkiWiki/Rcs/svn.pm
@@ -122,10 +122,13 @@ sub rcs_recentchanges ($) { #{{{
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()};
@@ -241,6 +244,7 @@ sub rcs_notify () { #{{{
);
eval q{use Mail::Sendmail};
+ error($@) if $@;
foreach my $email (@email_recipients) {
sendmail(
To => $email,
@@ -276,6 +280,7 @@ sub rcs_getctime ($) { #{{{
}
eval q{use Date::Parse};
+ error($@) if $@;
$date=str2time($date);
debug("found ctime ".localtime($date)." for $file");
return $date;
diff --git a/IkiWiki/Rcs/tla.pm b/IkiWiki/Rcs/tla.pm
index c9b64dbe5..c71c9e6ee 100644
--- a/IkiWiki/Rcs/tla.pm
+++ b/IkiWiki/Rcs/tla.pm
@@ -89,7 +89,9 @@ sub rcs_recentchanges ($) {
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);
@@ -159,6 +161,7 @@ sub rcs_notify () { #{{{
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);
@@ -214,6 +217,7 @@ sub rcs_notify () { #{{{
);
eval q{use Mail::Sendmail};
+ error($@) if $@;
foreach my $email (@email_recipients) {
sendmail(
To => $email,
@@ -228,7 +232,9 @@ sub rcs_notify () { #{{{
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);