From 2c62699f00d10b3e063c67206b356333d40e20d8 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Tue, 26 Nov 2013 21:47:58 +0000 Subject: [PATCH] update hexdump and fix dict merge problem git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1723 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- var/mongoose/html/m/lib/header.jim | 3 +-- var/mongoose/lib/hexdump | 38 ++++++++++-------------------- var/mongoose/lib/overrides | 10 ++++++++ var/mongoose/lib/setup | 2 +- 5 files changed, 25 insertions(+), 30 deletions(-) create mode 100644 var/mongoose/lib/overrides diff --git a/CONTROL/control b/CONTROL/control index 33a8c1d..844ac7f 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.7-7 +Version: 1.0.7-8 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.4),mongoose(>=3.0-9),jim(>=0.74-2),jim-oo,jim-sqlite3(>=0.74-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6) diff --git a/var/mongoose/html/m/lib/header.jim b/var/mongoose/html/m/lib/header.jim index 50408b9..240f3c7 100755 --- a/var/mongoose/html/m/lib/header.jim +++ b/var/mongoose/html/m/lib/header.jim @@ -16,8 +16,7 @@ puts " puts { - + diff --git a/var/mongoose/lib/hexdump b/var/mongoose/lib/hexdump index aecf461..5824e27 100644 --- a/var/mongoose/lib/hexdump +++ b/var/mongoose/lib/hexdump @@ -1,30 +1,16 @@ package require binary -proc hexdump {str} { - set s "" - set addr 0 - - append s "[format "%07x" $addr]: " - set t "" - for {set i 0} {$i < [string length $str]} {incr i} { - if {$i > 0 && [expr $i % 16] == 0} { - append s " $t\n" - append s "[format "%07x" $addr]: " - incr addr 16 - set t "" - } elseif {$i > 0 && [expr $i % 2] == 0} { - append s " " - } - - set char [string index $str $i] - binary scan $char H2 cc - append s $cc - if {[string is print $char]} { - append t $char - } else { - append t "." - } - } - puts $s +proc hexdump data { + set dump "" + set n 0 + while {$n < [string bytelength $data]} { + set bytes [string byterange $data $n $($n+15)] + binary scan $bytes H* hex + set hex [regexp -all -inline .. $hex] + regsub -all -- {[^a-z]} $bytes . ascii + append dump [format "%04X: %-48s %-16s\n" $n $hex $ascii] + incr n 16 + } + puts $dump } diff --git a/var/mongoose/lib/overrides b/var/mongoose/lib/overrides new file mode 100644 index 0000000..13dd576 --- /dev/null +++ b/var/mongoose/lib/overrides @@ -0,0 +1,10 @@ + +proc {dict merge} {dict args} { + foreach d $args { + foreach k [dict keys $d] { + dict set dict $k [dict get $d $k] + } + } + return $dict +} + diff --git a/var/mongoose/lib/setup b/var/mongoose/lib/setup index 961dbcd..8a0cb78 100644 --- a/var/mongoose/lib/setup +++ b/var/mongoose/lib/setup @@ -54,6 +54,6 @@ if {![exists -proc require]} { } } - require fileops + require fileops overrides }