vdr/nvram-wakeup/debian/patches 03_set_timer.dpatch 00list

Tobias Grimm pkg-vdr-dvb-changes@lists.alioth.debian.org
Thu, 08 Jul 2004 20:45:41 +0000


Update of /cvsroot/pkg-vdr-dvb/vdr/nvram-wakeup/debian/patches
In directory haydn:/tmp/cvs-serv18929/patches

Modified Files:
	00list 
Added Files:
	03_set_timer.dpatch 
Log Message:
added patch patch for set_timer

--- NEW FILE: 03_set_timer.dpatch ---
#! /bin/sh -e
## 03_set_timer.dpatch by Tobias Grimm <tg@e-tobi.net>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: fixes the paths in set_timer to refer to time in /usr/sbin and
## DP: writing its data between two reboots to /var/tmp/

if [ $# -lt 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"

case "$1" in
    -patch) patch -p1 ${patch_opts} < $0;;
    -unpatch) patch -R -p1 ${patch_opts} < $0;;
    *)
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
        exit 1;;
esac

exit 0

@DPATCH@
diff -Nur nvram-wakeup.orig/set_timer nvram-wakeup/set_timer
--- nvram-wakeup.orig/set_timer	2003-09-18 21:45:54.000000000 +0200
+++ nvram-wakeup/set_timer	2004-07-09 00:17:54.000000000 +0200
@@ -19,9 +19,9 @@
 # $PATH_TO_SET_TIMER/set_timer $1 $2
 #
 # and add the following line to your start script before vdr is started
-# /usr/local/bin/set_timer
+# /usr/sbin/set_timer
 #
-# The time command from nvram-wakeup is needed in /usr/local/bin
+# The time command from nvram-wakeup is needed in /usr/sbin
 #
 # Thanks to Sergei Haller for nvram-wakeup and the time and ideas to develop
 # this script
@@ -31,7 +31,7 @@
   exit 1
 fi
 
-if [ ! -x /usr/local/bin/time ] ; then
+if [ ! -x /usr/sbin/time ] ; then
   echo "$0 needs the time command from nvram-wakeup"
   exit 1
 fi
@@ -45,19 +45,19 @@
 # if a time_diff file exists the clock is set to the wakeup time and
 # must be corrected before any further action
 #
-if [ -f /video/time_diff ] ; then
+if [ -f /var/tmp/time_diff ] ; then
   
   # the difference stored 
-  time_diff=`cat /video/time_diff`
+  time_diff=`cat /var/tmp/time_diff`
   
   # add the difference to the curent time and change it in the date format
   set_time=$(( $cur_time + $time_diff ))
-  set_date=` /usr/local/bin/time $set_time | grep "^(local" | \
+  set_date=` /usr/sbin/time $set_time | grep "^(local" | \
     cut -f2- -d')' `
   
   # correct the time and if all is right remove the time_diff file
   # because there is no longer a difference
-  hwclock --set --date "$set_date" && hwclock --hctosys && rm /video/time_diff
+  hwclock --set --date "$set_date" && hwclock --hctosys && rm /var/tmp/time_diff
 fi  
 
 # if there is a parameter given, it is assumed the system schould boot 
@@ -87,11 +87,11 @@
   time_diff=$(( $cur_time - $set_time ))
 
   # convert time to date format
-  set_date=` /usr/local/bin/time $set_time | grep "^(local" | \
+  set_date=` /usr/sbin/time $set_time | grep "^(local" | \
     cut -f2- -d')' `
   
   # set date and if it is correct write the time_diff file
   # date --set="$set_date" && \ # add this if a script updates the hwclock 
   hwclock --set --date "$set_date" && \
-    echo $time_diff > /video/time_diff
+    echo $time_diff > /var/tmp/time_diff
 fi

Index: 00list
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/vdr/nvram-wakeup/debian/patches/00list,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- 00list	6 Jul 2004 23:53:19 -0000	1.2
+++ 00list	8 Jul 2004 20:45:39 -0000	1.3
@@ -1,2 +1,3 @@
 01_Makefile-fix
 02_nvram-wakep-mb.c
+03_set_timer