Fix notify log display (from prpr)

This commit is contained in:
HummyPkg 2018-02-11 13:46:00 +00:00
parent 26150bda5a
commit 7477fe1956
2 changed files with 8 additions and 12 deletions

View File

@ -1,7 +1,7 @@
Package: webif Package: webif
Priority: optional Priority: optional
Section: web Section: web
Version: 1.4.2-11 Version: 1.4.2-12
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hpkg.tv Maintainer: af123@hpkg.tv
Depends: tcpfix,webif-channelicons(>=1.1.25),lighttpd(>=1.4.39-1),jim(>=0.77),jim-oo(>=0.77),jim-sqlite3(>=0.77),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.11),webif-charts(>=1.2-1),stripts(>=1.3.1),tmenu(>=1.21-2),ffmpeg(>=2.8),id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95),sqlite3(>=3.15.1),jim-xconv Depends: tcpfix,webif-channelicons(>=1.1.25),lighttpd(>=1.4.39-1),jim(>=0.77),jim-oo(>=0.77),jim-sqlite3(>=0.77),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.11),webif-charts(>=1.2-1),stripts(>=1.3.1),tmenu(>=1.21-2),ffmpeg(>=2.8),id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95),sqlite3(>=3.15.1),jim-xconv

View File

@ -16,23 +16,19 @@ You have pending system notifications:
set lines {} set lines {}
set seen {} set seen {}
set i 0
foreach line [split [file read /mod/tmp/notify.log] "\n"] { foreach line [split [file read /mod/tmp/notify.log] "\n"] {
set rest [lassign [split $line -] date] set rest [join [lassign [split $line -] date] -]
if {$rest eq ""} { set rest $date } if {$rest eq ""} { set rest $date }
if {[dict exists $seen $rest]} { set mul [incr seen($rest)]
incr seen($rest)
} else {
set seen($rest) 1
}
set lines($rest) "$line"
set mul $seen($rest)
if {$mul > 1} { if {$mul > 1} {
append lines($rest) " ($mul instances)" append line " ($mul instances)"
} }
set lines($rest) [list [incr i] $line]
} }
foreach {line msg} $lines { foreach line [lsort -integer -index 0 [dict values $lines]] {
puts $msg puts [lindex $line 1]
} }
puts { puts {