From 24e1ee5210379b880d8fc7cd3f2a286a5d5feb0a Mon Sep 17 00:00:00 2001 From: hummypkg Date: Thu, 15 Jan 2015 23:51:58 +0000 Subject: [PATCH] fix ualeventinfo handling git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2202 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- bin/version | 21 +++++++++++++++++ webif/include/modversion.jim | 1 + webif/lib/rsv.class | 45 +++++++++++++++++++----------------- webif/lib/system.class | 3 ++- 5 files changed, 49 insertions(+), 23 deletions(-) create mode 100755 bin/version diff --git a/CONTROL/control b/CONTROL/control index e3f90d8..806eee3 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.2.0 +Version: 1.2.0-1 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.14),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.0),hmt(>=1.2.0),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,mongoose diff --git a/bin/version b/bin/version new file mode 100755 index 0000000..3fa450b --- /dev/null +++ b/bin/version @@ -0,0 +1,21 @@ +#!/mod/bin/jimsh + +source /mod/webif/lib/setup +require system.class + +set modver [system modversion] +set modbuild [system modbuild] +if {$modbuild > 0} { + append modver " (build $modbuild)" +} +catch {set fhtcpversion [system fhtcpversion]} +catch {set kernelver [system kernelver]} + +puts " +Humax [system model] Fox T2 ([system hostname]) + Humax Version: $fhtcpversion (kernel $kernelver) + Custom firmware version: $modver + Web interface version: [system pkgver webif] + Serial Number: [system serialno] +" + diff --git a/webif/include/modversion.jim b/webif/include/modversion.jim index 1e37033..1205150 100755 --- a/webif/include/modversion.jim +++ b/webif/include/modversion.jim @@ -17,5 +17,6 @@ catch {set fhtcpversion [system fhtcpversion]} catch {set kernelver [system kernelver]} puts "
Humax Version: $fhtcpversion (kernel $kernelver)" puts "
Serial Number: [system serialno]" + puts "" diff --git a/webif/lib/rsv.class b/webif/lib/rsv.class index ab546c0..ffb49c1 100755 --- a/webif/lib/rsv.class +++ b/webif/lib/rsv.class @@ -21,7 +21,7 @@ $rsvdb query {attach database '/var/lib/humaxtv/rsvp.db' as pending} # version. catch { $rsvdb query {alter table pending add column action int} } -set binaryfields {aulEventToRecordInfo} +set binaryfields aulEventToRecordInfo class rsv { ulslot -1 @@ -61,14 +61,9 @@ if {![exists -proc binary]} { package require binary } rsv method aul {} { set aul {} - if {[regexp -nocase {^[0-9a-f]+$} $aulEventToRecordInfo} { - if {[catch { - set aulEventToRecordInfo [\ - binary format H* $aulEventToRecordInfo] - }]} return $aul - } - for {set i 0} {$i < [string length $aulEventToRecordInfo]} {incr i 16} { - binary scan [string range $aulEventToRecordInfo $i $($i + 15)] \ + for {set i 0} {$i < [string length $aulEventToRecordInfo]} { + incr i 16} { + binary scan [string range $aulEventToRecordInfo $i $($i + 15)]\ iiii service start end event_id catch {lappend aul [list $service $start $end $event_id]} } @@ -296,17 +291,16 @@ rsv method insert {{table pending} {force 0}} { } set vals {} + set bvals {} foreach field $fields { set f [$self get $field] if {$field in $::binaryfields && [string bytelength $f] > 1} { - if {![regexp -nocase {^[0-9a-f]+$} $f} { - binary scan $f H* f - } - lappend vals "X'$f'" + binary scan $f H* fx + lappend bvals $fx + lappend vals "X'%s'" } else { - # Escape any quotes and percents embedded in the data. - regsub -all {['%]} $f {&&} f - lappend vals "'$f'" + lappend bvals $f + lappend vals "'%s'" } } @@ -316,7 +310,10 @@ rsv method insert {{table pending} {force 0}} { append query [join $vals ","] append query ");" - $rsvdb query $query + #puts $query + #puts $bvals + + $rsvdb query $query {*}$bvals } proc {rsv list} {{table tbl_reservation} {extra ""}} { @@ -528,8 +525,7 @@ proc {rsv construct} {event type} { epg dbfetch dump -scrid [$event get series_crid] \ -sort start] { if {[set ecrid [$i get event_crid]] eq ""} { continue } - binary scan [rsv mkaul $i] H* ret - lappend events $ret + lappend events [rsv mkaul $i] list "1$::ccrid$ecrid" }] set args(szEventToRecord) "[join $progs "|"]|" @@ -660,7 +656,11 @@ proc {rsv restore} {file} { continue } incr i - lappend vars $f [lindex $vals $i] + set val [lindex $vals $i] + if {$f in $::binaryfields} { + set val [binary format H* $val] + } + lappend vars $f $val } # Don't restore DSO events. @@ -708,9 +708,11 @@ proc {rsv restore} {file} { # Find the new hsvc if possible. set _hsvc [rsv find_hsvc $lcn $channame] if {$_hsvc eq ""} continue + puts -nonewline " AUL $channame ($ohsvc" if {$ohsvc != $_hsvc} { - puts " AUL $channame ($ohsvc -> $_hsvc)" + puts -nonewline " -> $_hsvc" } + puts ")" append newaul [binary format iiii \ $_hsvc $start $end $eid] } @@ -722,6 +724,7 @@ proc {rsv restore} {file} { puts " Error inserting event, $msg" } } + puts "" } $rsvdb query {commit transaction;} diff --git a/webif/lib/system.class b/webif/lib/system.class index 477dd6a..695c9f5 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -111,8 +111,9 @@ proc {system kernelver} {} {{ver ""}} { "May 27 00:19:40 KST 2012" { format "HD_1.02.28" } "Jul 5 19:41:17 KST 2012" { format "HD_1.02.29" } "Oct 13 12:48:09 KST 2012" { format "HD_1.02.31" } + "Dec 9 14:15:07 KST 2014" { format "HD_1.03.02" } - default { format "Unknown - $ver" } + default { format "Unknown - $rver" } }] return $ver }