From e0ac834c7852035212cedb1a15cee96d88e23b88 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 2 Apr 2014 21:14:23 +0000 Subject: [PATCH] preserve more timestamps git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1832 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- var/mongoose/html/browse/decrypt/execute.jim | 2 ++ var/mongoose/html/browse/strip/execute.jim | 4 ++++ var/mongoose/lib/bin/auto | 2 ++ var/mongoose/lib/ts.class | 16 ++++++++++++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/CONTROL/control b/CONTROL/control index 88668ad..8777427 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.10-4 +Version: 1.0.10-5 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.10),mongoose(>=3.0.11),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),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.5-3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6) diff --git a/var/mongoose/html/browse/decrypt/execute.jim b/var/mongoose/html/browse/decrypt/execute.jim index 6c7acd7..207db04 100755 --- a/var/mongoose/html/browse/decrypt/execute.jim +++ b/var/mongoose/html/browse/decrypt/execute.jim @@ -50,12 +50,14 @@ foreach ext $tsgroup { } file rename "$rfile.decrypting" $rfile +file touch $rfile "$origdir/$tail.ts" foreach ext {nts hmt thm} { set sidecar "$shname.$ext" if {[file exists "$origdir/$sidecar"]} { puts "Copying back sidecar $ext" file copy "$origdir/$sidecar" "$dir/$sidecar" + file touch "$dir/$sidecar" "$origdir/$tail.ts" } } diff --git a/var/mongoose/html/browse/strip/execute.jim b/var/mongoose/html/browse/strip/execute.jim index d29f42f..e776bba 100755 --- a/var/mongoose/html/browse/strip/execute.jim +++ b/var/mongoose/html/browse/strip/execute.jim @@ -40,6 +40,10 @@ puts [exec /mod/bin/stripts \ "$dir/$shname" \ ] + +# Set the file time to match the old file +ts touchgroup "$dir/$shname.ts" "$origdir/$shname.ts" + set newname "$shname-[clock seconds]" puts "Renaming file group to $newname" ts renamegroup "$dir/$shname.ts" $newname diff --git a/var/mongoose/lib/bin/auto b/var/mongoose/lib/bin/auto index f9b18e2..8d926ed 100755 --- a/var/mongoose/lib/bin/auto +++ b/var/mongoose/lib/bin/auto @@ -239,6 +239,8 @@ proc do_shrink {ts} { foreach f [glob "$tmp/shrunk.*"] { set ext [file extension $f] file rename $f "${file}_shrunk${ext}" + # Set the file time to match the old file + file touch "${file}_shrunk${ext}" [$ts get file] } # Remove the old recording (-> bin if undelete is installed) diff --git a/var/mongoose/lib/ts.class b/var/mongoose/lib/ts.class index 69714b1..359c894 100644 --- a/var/mongoose/lib/ts.class +++ b/var/mongoose/lib/ts.class @@ -318,6 +318,22 @@ proc {ts renamegroup} {from to} { } } +proc {ts touchgroup} {target ref} { + global tsgroup + + set dir [file dirname $target] + set root [file rootname $target] + + # Catch from string without a . character in it + if {$root eq $target} { return } + + foreach ext $tsgroup { + set f "$root.$ext" + if {![file exists $f]} continue + file touch $f $ref + } +} + proc {ts genrelist} {} { return { 0 { Unclassified Unclassified }