diff options
-rw-r--r-- | .hgtags | 13 | ||||
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/mauvealert-server.init | 15 | ||||
-rw-r--r-- | lib/mauve/notifier.rb | 18 | ||||
-rw-r--r-- | lib/mauve/notifiers/xmpp.rb | 11 | ||||
-rw-r--r-- | lib/mauve/pop3_server.rb | 2 | ||||
-rw-r--r-- | lib/mauve/version.rb | 2 |
8 files changed, 51 insertions, 33 deletions
@@ -1,8 +1,11 @@ -aaab1eab14333f0de39bf1a6763ecfc70bb04a75 0.13 -f552a7440699fbe85523bf97e334cdee627773b3 0.17 -83f5ecdbdcd8c93c7e38780887a968642b924974 1.0.0.beta -429621063b4e3833832b2ee2cc637178d72e9125 1.0.beta2 -0f9cca9cb958c339e9e3c987909f2abe10911824 Jruby compatible version f2bb169c15c4edf8c3e88a5a2e2eb2fbb0a225ac 3.5.7 df0c174c38f6489ab232262f892563c4f8956b09 3.5.8 15f95cc4ed2339ff3291bf9ef20866ea708be348 3.5.9 +3962863b8d7e336b59b2b265a7b5bc11382409ac 3.5.6 +3dac67eb8d1126b1882d4b59f76729d8eb2b53b7 3.5.5 +2fcecddb77ffa3a09a4c149f638529774f474fbb 3.5.4 +80ddd77b723c9a465948b759aeca24de811e54a3 3.5.3 +8f199ec1e27f57d80b6903cde36292f2757d6b5b 3.5.2 +38821fc960868b19c4b1d2b2433fc39fc7cda704 3.5.1 +7e2e95d0bcc1661b87cbd7c889ae34235e54d6b4 3.5.0 +f8edd462e6123096d59f720c35334ca52e78b178 3.5.10 @@ -23,6 +23,9 @@ clean: ruby ./setup.rb clean ; \ fi $(RM) -r tmp + $(RM) -r OpenBSD + $(RM) setup.rb + distclean: clean if [ -e ./setup.rb ] ; then ruby ./setup.rb distclean ; fi @@ -35,14 +38,20 @@ test: setup.rb setup.rb: /usr/lib/ruby/1.8/setup.rb ln -sf /usr/lib/ruby/1.8/setup.rb . -OpenBSD: OpenBSD/sha256sums +OpenBSD: OpenBSD/sha256.asc -OpenBSD/sha256sums: OpenBSD/ruby-mauvealert.tar.gz OpenBSD/ruby-protobuf.tar.gz +OpenBSD/sha256: OpenBSD/ruby-mauvealert.tar.gz OpenBSD/ruby-protobuf.tar.gz # # rejig sha256sum to openbsd sha256 # + $(RM) OpenBSD/sha256 cd OpenBSD && sha256sum * | sed -e 's/\([^ ]\+\) \(.*\)$$/SHA256 (\2) = \1/' > sha256 - gpg --clearsign OpenBSD/sha256sum + +OpenBSD/sha256.asc: OpenBSD/sha256 + # + # Sign it. + # + gpg --clearsign OpenBSD/sha256 OpenBSD/ruby-mauvealert.tar.gz: all setup.rb mkdir -p tmp/ruby-mauvealert @@ -63,5 +72,5 @@ OpenBSD/ruby-protobuf.tar.gz: mkdir -p OpenBSD tar -C tmp/ruby-protobuf -czvf $@ . -.PHONY: all clean openbsd_tarball test distclean +.PHONY: all clean openbsd_tarball test distclean OpenBSD diff --git a/debian/changelog b/debian/changelog index 9195150..a67e957 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +mauvealert (3.5.10) stable; urgency=low + + * Fixed up Pop3Client class to work. + + -- Patrick J Cherry <patrick@bytemark.co.uk> Tue, 04 Oct 2011 15:29:22 +0100 + mauvealert (3.5.9) stable; urgency=low * Improve documentation in code diff --git a/debian/mauvealert-server.init b/debian/mauvealert-server.init index 1e48c68..592304f 100644 --- a/debian/mauvealert-server.init +++ b/debian/mauvealert-server.init @@ -59,8 +59,8 @@ do_start() count=0 while [ $((count = count + 1)) -le 5 ] ; do - echo -n . sleep 1 + # This is just a test to see if the daemon is running yet. start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON --chuid $RUNASUSER --test > /dev/null \ || return 0 done @@ -81,6 +81,7 @@ do_stop() start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --user $RUNASUSER RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 + # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code @@ -88,7 +89,9 @@ do_stop() # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --pidfile $PIDFILE --user $RUNASUSER - [ "$?" = 2 ] && return 2 + RETVAL="$?" + [ "$RETVAL" = 2 ] && return 2 + # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE return "$RETVAL" @@ -121,16 +124,16 @@ case "$1" in [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || exit 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 || exit 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || exit 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 || exit 1 ;; esac ;; status) diff --git a/lib/mauve/notifier.rb b/lib/mauve/notifier.rb index 14e188c..bf36162 100644 --- a/lib/mauve/notifier.rb +++ b/lib/mauve/notifier.rb @@ -42,13 +42,17 @@ module Mauve # # Make sure we're connected to the XMPP server if needed on every iteration. # - if Configuration.current.notification_methods['xmpp'] and !Configuration.current.notification_methods['xmpp'].ready? + xmpp = Configuration.current.notification_methods['xmpp'] + + if xmpp and !xmpp.ready? # # Connect to XMPP server # - xmpp = Configuration.current.notification_methods['xmpp'] - xmpp.connect + xmpp.connect + # + # Join all chats and shit. Unless the connection failed. + # Configuration.current.people.each do |username, person| # # Ignore people without XMPP stanzas. @@ -56,11 +60,6 @@ module Mauve next unless person.xmpp # - # Can't do this unless we're ready. - # - next unless xmpp.ready? - - # # For each JID, either ensure they're on our roster, or that we're in # that chat room. # @@ -71,7 +70,8 @@ module Mauve end Configuration.current.people[username].xmpp = jid unless jid.nil? - end + + end if xmpp.ready? end diff --git a/lib/mauve/notifiers/xmpp.rb b/lib/mauve/notifiers/xmpp.rb index fa1751c..8254494 100644 --- a/lib/mauve/notifiers/xmpp.rb +++ b/lib/mauve/notifiers/xmpp.rb @@ -150,12 +150,7 @@ module Mauve unless ex.nil? or @closing logger.warn(["Caught",ex.class,ex.to_s,"during XMPP",where].join(" ")) logger.debug ex.backtrace.join("\n") - @closing = true - connect - @mucs.each do |jid, muc| - @mucs.delete(jid) - join_muc(muc[:jid], muc[:password]) - end + self.close end end rescue StandardError => ex @@ -566,11 +561,11 @@ EOF def do_parse_ack(msg) return "Sorry -- I don't understand your acknowledge command." unless - msg.body =~ /ack(?:nowledge)?\s+([\d,]+)\s+for\s+(\d+(?:\.\d+)?)\s+(work(?:ing)?|day(?:time)?|wall(?:-?clock)?)?\s*(day|hour|min(?:ute)?|sec(?:ond))s?(?:\s+because\s+(.*))?/i + msg.body =~ /ack(?:nowledge)?\s+([\d\D]+)\s+for\s+(\d+(?:\.\d+)?)\s+(work(?:ing)?|day(?:time)?|wall(?:-?clock)?)?\s*(day|hour|min(?:ute)?|sec(?:ond))s?(?:\s+because\s+(.*))?/i alerts, n_hours, type_hours, dhms, note = [$1,$2, $3, $4, $5] - alerts = alerts.split(",") + alerts = alerts.split(/\D/) n_hours = case dhms when /^day/ diff --git a/lib/mauve/pop3_server.rb b/lib/mauve/pop3_server.rb index 52f31d0..e7132f4 100644 --- a/lib/mauve/pop3_server.rb +++ b/lib/mauve/pop3_server.rb @@ -410,6 +410,8 @@ module Mauve end + protected + # # These are the messages in the mailbox. It looks for the first 100 alert_changed, and formats them into emails, and returns an array of # diff --git a/lib/mauve/version.rb b/lib/mauve/version.rb index 9a9355e..926d01f 100644 --- a/lib/mauve/version.rb +++ b/lib/mauve/version.rb @@ -5,6 +5,6 @@ module Mauve # # Current version - VERSION="3.5.9" + VERSION="3.5.10" end |