pkgsrc/sysutils/tob/patches/patch-aa

83 lines
2.2 KiB
Text

$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