From 20b4fe2f66dbcca466760ed6348eb2774bb6ccf5 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Sun, 5 Mar 2017 10:21:58 +0000 Subject: [PATCH] add nospecial to ts iterate, centralise is-specialdir logic git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3882 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- webif/lib/auto/util.jim | 5 +---- webif/lib/system.class | 7 +++++++ webif/lib/ts.class | 6 ++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index 5d1f60b..a0e454e 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.4.0-15 +Version: 1.4.0-16 Architecture: mipsel 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.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.5),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.10),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.21-2),ffmpeg,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) diff --git a/webif/lib/auto/util.jim b/webif/lib/auto/util.jim index 13218d9..82754d6 100644 --- a/webif/lib/auto/util.jim +++ b/webif/lib/auto/util.jim @@ -119,10 +119,7 @@ proc ::auto::inuse {ts} { } proc ::auto::specialdir {dir} { - if {[string match {\[*} [string trimleft [file tail $dir]]]} { - return 1 - } - return 0 + return [system specialdir $dir] } proc ::auto::elapsed {start} { diff --git a/webif/lib/system.class b/webif/lib/system.class index 0c1fd22..ca2d67a 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -809,3 +809,10 @@ proc {system endop} {op} { return 0 } +proc {system specialdir} {dir} { + if {[string match {\[*} [string trimleft [file tail $dir]]]} { + return 1 + } + return 0 +} + diff --git a/webif/lib/ts.class b/webif/lib/ts.class index 54f4942..ce166e8 100644 --- a/webif/lib/ts.class +++ b/webif/lib/ts.class @@ -476,7 +476,7 @@ proc {ts resetnew} {dir} { close $fd } -proc {ts iterate} {callback {verbose 0} {dir ""}} {{rootdev 0}} { +proc {ts iterate} {callback {verbose 0} {dir ""} {nospecial 0}} {{rootdev 0}} { require system.class if {$dir eq ""} { set dir [system mediaroot] @@ -491,9 +491,11 @@ proc {ts iterate} {callback {verbose 0} {dir ""}} {{rootdev 0}} { if {$st(dev) != $rootdev} return } + if {$nospecial && [system specialdir $dir]} return + foreach entry [readdir -nocomplain $dir] { if {[file isdirectory "$dir/$entry"]} { - ts iterate $callback $verbose "$dir/$entry" + ts iterate $callback $verbose "$dir/$entry" $nospecial continue } if {![string match {*.ts} $entry]} continue