# HG changeset patch # User HIROSE Yuuji # Date 1359105092 -32400 # Node ID ec7d483d381dd438c1854dcfa7e95d201e149694 # Parent ff9e5fa124d26bf6506046548f29fd12bee9f467 Fix missing notification diff -r ff9e5fa124d2 -r ec7d483d381d after5.rb --- 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,