summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2012-10-01 20:34:28 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2012-10-01 20:34:28 +0000
commit608dc87f8f6ac2e9d2f37075d1db8bb2a45ebdeb (patch)
tree10b6800fd4bc9b14a581f2d2772c517a8667f0a1
parentf36d4603b8b1aa9a8baeb8555719fb441f02851c (diff)
Merge in patches from asteria
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@554 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xnsa11
-rwxr-xr-xparse-git1
-rwxr-xr-xparse-nagios2
-rwxr-xr-xparse-trac2
4 files changed, 11 insertions, 5 deletions
diff --git a/nsa b/nsa
index 95839db..99789bc 100755
--- a/nsa
+++ b/nsa
@@ -26,6 +26,11 @@ require 'openssl'
require 'yaml'
require 'monitor'
+if RUBY_VERSION =~ /1.9/
+ Encoding.default_external = Encoding::UTF_8
+ Encoding.default_internal = Encoding::UTF_8
+end
+
default_irc = {
'server' => 'irc.oftc.net',
'port' => 6667,
@@ -45,13 +50,13 @@ class << Log
def init
@ignore_list = []
@ignore_list << "dispatch thread"
- @ignore_list << "connection"
+ #@ignore_list << "connection"
@ignore_list << "waituntilonline - waiter"
@ignore_list << "waituntilonline - runthread"
end
def log section, message
- puts message unless @ignore_list.include?(section)
+ puts "[#{Time.now}] #{message}" unless @ignore_list.include?(section)
end
end
@@ -126,8 +131,8 @@ class Connection
@outQueue.synchronize do
@outEmpty.wait_while { @outQueue.empty? }
line = @outQueue.shift
- @sock.puts line
Log.log "connection", "[connection] >>> " + line
+ @sock.puts line
end
end
rescue => e
diff --git a/parse-git b/parse-git
index 03ee1b2..84afd5b 100755
--- a/parse-git
+++ b/parse-git
@@ -99,6 +99,7 @@ my $by;
if (defined $author) {
$by = " by $author";
}
+$subject =~ s/^\[or-cvs\] *//;
$subject =~ s/\[([^\]]*)\] /to $1: /;
print MAIL "$who committed patch$by$at $subject\n";
close(MAIL);
diff --git a/parse-nagios b/parse-nagios
index d51f581..a39073c 100755
--- a/parse-nagios
+++ b/parse-nagios
@@ -41,7 +41,7 @@ my $project = $ARGV[0];
umask 077;
-$project =~ m/^([a-zA-Z-]+(\.[a-zA-Z-]+)*)+$/;
+$project =~ m/^([a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*)+$/;
$project = $1;
die ("Project is not a nice name.\n") unless defined $project;
diff --git a/parse-trac b/parse-trac
index 3cd773c..a79399e 100755
--- a/parse-trac
+++ b/parse-trac
@@ -82,7 +82,7 @@ while (defined($line = shift @headers)) {
$tracproject = $1;
} elsif ($line =~ m/^X-Trac-Ticket-URL:\s*(.*)/i) {
$url = $1;
- $url =~ s/^https:/http:/;
+ #$url =~ s/^https:/http:/;
} elsif ($line =~ m/^X-Trac-Ticket-ID:\s*(.*)/i) {
$ticketid = $1;
} elsif ($line =~ m/^Content-Transfer-Encoding: base64$/s) {