summaryrefslogtreecommitdiff
path: root/sysutils/tob/patches/patch-aa
blob: 281ea3f92e6c11a34b2a1319b58ebc60ab0fbe1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
$NetBSD: patch-aa,v 1.3 2006/10/19 23:56:13 rillig Exp $

--- tob.orig	2003-06-06 22:05:57.000000000 +0200
+++ tob	2006-10-20 01:48:50.000000000 +0200
@@ -13,8 +13,8 @@
 #
 
 # File locations
-TOBLISTS=/var/lib/tob
-TOBHOME=/etc/tob
+TOBLISTS=@VARBASE@/tob
+TOBHOME=@PKG_SYSCONFDIR@/tob
 
 ############################################################################
 # Global settings, most of which can be overruled in the resource file:
@@ -77,13 +77,17 @@ then
     fi
 elif [ -x /usr/bin/mktemp ]
 then
-    TMPLIST=`mktemp -p tob`
+    case `uname -s` in
+    NetBSD)	prefarg="-t" ;;
+    *)		prefarg="-p" ;;
+    esac
+    TMPLIST=`mktemp $prefarg tob`
     rc1=$?
-    FILELIST=`mktemp -p tob`
+    FILELIST=`mktemp $prefarg tob`
     rc2=$?
-    TMPLIST1=`mktemp -p tob`
+    TMPLIST1=`mktemp $prefarg tob`
     rc3=$?
-    TMPLIST2=`mktemp -p tob`
+    TMPLIST2=`mktemp $prefarg tob`
     rc4=$?
     if [ $rc1 -ne 0 -o $rc2 -ne 0 -o $rc3 -ne 0 -o $rc4 -ne 0 ]
     then
@@ -131,7 +135,7 @@ POSTCMD=''
 VER=0.25
 
 # RCLIST: list of resource files which tob will search for
-RCLIST='/usr/local/etc/tob.rc /etc/tob/tob.rc /etc/tob.rc /usr/etc/tob.rc'
+RCLIST='@PKG_SYSCONFDIR@/tob/tob.rc /usr/local/etc/tob.rc /etc/tob/tob.rc /etc/tob.rc /usr/etc/tob.rc'
 
 ############################################################################
 # show a message to the screen
@@ -189,6 +193,10 @@ checkenv ()
     if [ "$EXT" = "" ] ; then
 	error "variable EXT is undefined"
     fi
+
+    case "$UID" in
+    "")	UID=`id -u` ;;
+    esac
     
     if [ "$NEEDROOT" = "yes" ] ; then
 	if [ $UID -ne 0 ]; then
@@ -583,10 +591,10 @@ full ()
 
 	cd $BACKUPDIR
 	for i in `find ${VOLUMENAME}_* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do
-		if [ $i == $UPTO ]; then
+		if [ $i = $UPTO ]; then
 			SEEN=1
 		fi
-		if [ $SEEN == '0' ]; then
+		if [ $SEEN = '0' ]; then
 			message "Deleted old backup $i"
 			$RM -f $i
 		fi
@@ -652,10 +660,10 @@ differential ()
 	cd $BACKUPDIR
 	$RM -f ${VOLUMENAME}_*inc*
 	for i in `find ${VOLUMENAME}_*diff* -mtime +$MAXBACKUPAGE -exec echo {} \;`; do
-		if [ $i == $UPTO ]; then
+		if [ $i = $UPTO ]; then
 			SEEN=1
 		fi
-		if [ $SEEN == '0' ]; then
+		if [ $SEEN = '0' ]; then
 			message "Deleting old backup $i"
 			$RM -f $i
 		fi