changeset 78:ec7d483d381d draft

Fix missing notification
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 25 Jan 2013 18:11:32 +0900
parents ff9e5fa124d2
children 1acd9c926bd6
files after5.rb
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/after5.rb	Fri Jan 25 18:07:12 2013 +0900
+++ b/after5.rb	Fri Jan 25 18:11:32 2013 +0900
@@ -836,7 +836,7 @@
 	next unless user
 	ud = File.join(dd, user).untaint
 	next unless test(?d, ud)
-	ntl[user] = {}
+	ntl[user] = {} unless ntl.has_key?(user)
 	Dir.foreach(ud){|date|
 	  next if /^\./ =~ date
 	  unless /(\d\d\d\d+)-(\d+)-(\d+)-(\d\d\d\d)/ =~ date
@@ -2614,8 +2614,9 @@
     line = "-"*25
     indent = "    "
     now = Time.now
-    p "notifylist", @sc.notify_list(now) if $DEBUG
-    @sc.notify_list(now).each{|u, datehash|
+    ntlist = @sc.notify_list(now)
+    p "notifylist", ntlist if $DEBUG
+    ntlist.each{|u, datehash|
       dellist = []
       content = datehash.sort.collect{|date, filehash|
 	next unless /(\d\d\d\d+)-(\d+)-(\d+)-(\d\d\d\d)/ =~ date
@@ -2663,9 +2664,9 @@
 	end
       end
     }
-    if !(list=@sc.notify_list(now)).empty?
+    if !ntlist.empty?
       subj = @mybase+": Undeleted old cron files detected"
-      files = list.collect{|who, whash|
+      files = ntlist.collect{|who, whash|
 	whash.sort.collect{|date, fhash| fhash['file']}.join("\n")
       }.join("\n")
       sendMail(@opt['maintainer'], subj,

yatex.org