View | Details | Raw Unified | Return to bug 145588
Collapse All | Expand All

(-)./rdup/Makefile (-3 / +1 lines)
Lines 7-13 Link Here
7
#
7
#
8
8
9
PORTNAME=	rdup
9
PORTNAME=	rdup
10
PORTVERSION=	1.1.2
10
PORTVERSION=	1.1.4
11
CATEGORIES=	sysutils
11
CATEGORIES=	sysutils
12
MASTER_SITES=	http://miek.nl/projects/rdup/
12
MASTER_SITES=	http://miek.nl/projects/rdup/
13
13
Lines 39-45 Link Here
39
39
40
MAN7=		rdup-backups.7
40
MAN7=		rdup-backups.7
41
41
42
post-patch:
43
	@${REINPLACE_CMD} -e 's|/bin/bash|${LOCALBASE}/bin/bash|' ${WRKSRC}/sh/rdup-simple.in
44
42
45
.include <bsd.port.mk>
43
.include <bsd.port.mk>
(-)./rdup/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (rdup-1.1.2.tar.bz2) = 4e543871c6178d5edc597fcb628a24e7
1
MD5 (rdup-1.1.4.tar.bz2) = 295acf3674fe891873a95c4cf608b304
2
SHA256 (rdup-1.1.2.tar.bz2) = d5b2c4e7a4df62909a18ae70c241fb4bf3c405afa369dbd1259efd22eed9b327
2
SHA256 (rdup-1.1.4.tar.bz2) = 94a0b6de4aa5b25ba888347acd424c6b97343ff207a9587fc68fc1e4d5710500
3
SIZE (rdup-1.1.2.tar.bz2) = 357713
3
SIZE (rdup-1.1.4.tar.bz2) = 358160
(-)./rdup/files/patch-GNUmakefile.in (-2 / +2 lines)
Lines 1-5 Link Here
1
--- GNUmakefile.in.orig	2010-03-02 11:04:44.000000000 -0800
1
--- ./GNUmakefile.in.orig	2010-04-04 13:23:22.000000000 -0700
2
+++ GNUmakefile.in	2010-03-02 11:06:56.000000000 -0800
2
+++ ./GNUmakefile.in	2010-04-08 20:21:36.000000000 -0700
3
@@ -19,7 +19,7 @@
3
@@ -19,7 +19,7 @@
4
 sbindir=@sbindir@
4
 sbindir=@sbindir@
5
 mandir=@mandir@
5
 mandir=@mandir@
(-)./rdup/files/patch-rdup-simple.in (-11 lines)
Lines 1-11 Link Here
1
--- sh/rdup-simple.in.orig	2009-10-09 23:37:15.000000000 -0700
2
+++ sh/rdup-simple.in	2009-10-09 23:44:36.000000000 -0700
3
@@ -41,7 +41,7 @@
4
 }
5
 
6
 PROGNAME=$0
7
-NOW=`date +%Y%m/%d`
8
+NOW=`gdate +%Y%m/%d`
9
 DAYS=8
10
 ssh=
11
 trans=
(-)./rdup/files/patch-rdup-tr.c (+12 lines)
Line 0 Link Here
1
--- ./rdup-tr.c.orig	2010-04-04 13:23:22.000000000 -0700
2
+++ ./rdup-tr.c	2010-04-08 20:21:36.000000000 -0700
3
@@ -100,7 +100,8 @@
4
 	struct archive_entry *entry;
5
 	struct stat     *s;
6
 	struct rdup  *rdup_entry = NULL;
7
-	GSList *hlinks, *hl      = NULL;
8
+	GSList *hlinks = NULL;
9
+	GSList *hl = NULL;
10
 	GHashTable *trhash;		/* look up for encrypted/decrypted strs */
11
 
12
 	delim   = '\n';
(-)./rdup/files/patch-sh__rdup-simple.in (+195 lines)
Line 0 Link Here
1
--- ./sh/rdup-simple.in.orig	2010-04-04 13:23:22.000000000 -0700
2
+++ ./sh/rdup-simple.in	2010-04-08 20:34:49.000000000 -0700
3
@@ -1,4 +1,4 @@
4
-#!/bin/bash
5
+#!/bin/sh
6
 
7
 # updates a hardlinked backup
8
 # licensed under the GPL version 3
9
@@ -31,23 +31,24 @@
10
     TOPDIR="$1"
11
 
12
     if $dry; then exit 1; fi
13
-    [[ -z $TOPDIR ]] && exit 2
14
-    [[ -d $TOPDIR/$TODAY ]] && exit 0
15
+    [ -z "$TOPDIR" ] && exit 2
16
+    [ -d $TOPDIR/$TODAY ] && exit 0
17
 
18
     if ! mkdir -p $TOPDIR/$TODAY; then
19
 	exit 2
20
     fi
21
 
22
-    let i=1
23
-    while [[ $i -le $LOOKBACK ]]; do
24
-	    D=$(date $DATESTR --date "$i days ago")
25
-	    if [[ -d $TOPDIR/$D ]]; then
26
-		if ! cp -plr $TOPDIR/$D/* $TOPDIR/$TODAY; then
27
+    i=1
28
+    while [ $i -le $LOOKBACK ]; do
29
+	    adjust=$(printf %dd $i)
30
+	    D=$(date -v-$adjust $DATESTR)
31
+	    if [ -d $TOPDIR/$D ]; then
32
+		if ! cp -plR $TOPDIR/$D/* $TOPDIR/$TODAY; then
33
 		    exit 2
34
 		fi
35
 		exit 0
36
 	    fi
37
-	    let i=i+1
38
+	    i=$((i+1))
39
     done
40
     exit 1
41
 }
42
@@ -86,7 +87,7 @@
43
 }
44
 
45
 PROGNAME=$0
46
-NOW=`date +%Y%m/%d`
47
+NOW=$(date +%Y%m/%d)
48
 DAYS=8
49
 OPT_DRY=
50
 ssh=
51
@@ -105,7 +106,7 @@
52
         case $o in
53
 		a) atime=" -a " ;;
54
 		E)
55
-                if [[ -z "$OPTARG" ]]; then
56
+                if [ -z "$OPTARG" ]; then
57
                         echo2 "-E needs an argument"
58
                         exit 1
59
                 fi
60
@@ -116,12 +117,12 @@
61
 		pathtrans="-$o $OPTARG";
62
 		;;
63
                 k)
64
-                if [[ -z "$OPTARG" ]]; then
65
+                if [ -z "$OPTARG" ]; then
66
                         echo2 "-k needs an argument"
67
                         exit 1
68
                 fi
69
-                if [[ ! -r "$OPTARG" ]]; then
70
-                        echo2 "Cannot read keyfile \`$OPTARG': failed"
71
+                if [ ! -r "$OPTARG" ]; then
72
+                        echo2 "Cannot read keyfile \'$OPTARG': failed"
73
                         exit 1
74
                 fi
75
                 trans="$trans -Pmcrypt,-q,-f,$OPTARG"
76
@@ -144,7 +145,7 @@
77
 			exit 1
78
 		fi
79
 		# if there a no key, this will fail
80
-		if [[ $(gpg --list-keys | wc -l) -eq "0" ]]; then
81
+		if [ $(gpg --list-keys | wc -l) -eq "0" ]; then
82
 			echo2 "No gpg keys found"
83
 			exit 1
84
 		fi
85
@@ -163,9 +164,9 @@
86
 done
87
 shift $((OPTIND - 1))
88
 
89
-if [[ ${1:0:1} == "+" ]]; then
90
-        DAYS=${1:1}
91
-        if [[ $DAYS -lt 1 || $DAYS -gt 99 ]]; then
92
+if [ "${1%${1#?}}" = "+" ]; then
93
+        DAYS=${1#?}
94
+        if [ $DAYS -lt 1 ] || [ $DAYS -gt 99 ]; then
95
                 echo2 "+N needs to be a number [1..99]"
96
                 exit 1
97
         fi
98
@@ -174,7 +175,7 @@
99
         DAYS=8
100
 fi
101
 
102
-[[ $# -lt 2 ]] && usage && exit
103
+[ $# -lt 2 ] && usage && exit
104
 
105
 if $mcrypt; then
106
     if ! which mcrypt 2>/dev/null 1>&2; then
107
@@ -184,10 +185,10 @@
108
 fi
109
 
110
 i=1; last=$#; DIRS=
111
-while [[ $i -lt $last ]]; do
112
+while [ $i -lt $last ]; do
113
 	DIRS="$DIRS $1"
114
 	shift
115
-	((i=$i+1))
116
+	i=$((i+1))
117
 done
118
 # rdup [options] source destination
119
 #dest="ssh://elektron.atoom.net/directory"
120
@@ -197,50 +198,50 @@
121
 #dest="ssh://miekg@elektron.atoom.net/directory"
122
 
123
 dest=$1
124
-if [[ ${dest:0:6} == "ssh://" ]]; then
125
-	rest=${dest/ssh:\/\//}
126
+if [ "${dest%${dest#??????}}" = "ssh://" ]; then
127
+	rest=${dest#ssh://}
128
 	u=${rest%%@*}
129
 
130
-	if [[ "$u" == "$rest" ]]; then
131
+	if [ "$u" = "$rest" ]; then
132
             # no @ used, nullify $u
133
             u=
134
         fi
135
 
136
-	rest=${rest/$u@/}
137
-	h=`echo $rest | cut -s -f1 -d/`
138
-	BACKUPDIR=${rest/$h/}
139
+	rest=${rest#$u@}
140
+	h=$(echo $rest | cut -s -f1 -d/)
141
+	BACKUPDIR=${rest#$h}
142
 
143
-	if [[ -z $u ]]; then
144
+	if [ -z "$u" ]; then
145
 		ssh=" ssh -c blowfish -x $h"
146
 	else
147
 		ssh=" ssh -c blowfish -x $u@$h"
148
 	fi
149
 fi
150
-if [[ ${dest:0:7} == "file://" ]]; then
151
-	rest=${dest/file:\/\//}
152
+if [ "${dest%${dest#???????}}" = "file://" ]; then
153
+	rest=${dest#file://}
154
 	BACKUPDIR=$rest
155
 fi
156
-[[ ${dest:0:1} == "/" ]] && BACKUPDIR=$dest
157
+[ "${dest%${dest#?}}" = "/" ] && BACKUPDIR=$dest
158
 
159
 # no hits above, assume relative filename
160
-[[ -z $BACKUPDIR ]] && BACKUPDIR=$PWD/$dest
161
+[ -z "$BACKUPDIR" ] && BACKUPDIR=$PWD/$dest
162
 
163
 $link && copy_and_link $DAYS $BACKUPDIR
164
 
165
 # change all / to _ to make a valid filename
166
-STAMP=$etc/timestamp.${HOSTNAME}.${dest//\//_}
167
-LIST=$etc/list.${HOSTNAME}.${dest//\//_}
168
+STAMP=$etc/timestamp.${HOSTNAME}.$(echo $dest | tr / _)
169
+LIST=$etc/list.${HOSTNAME}.$(echo $dest | tr / _)
170
 
171
-[[ ! -d $etc ]] && mkdir $etc
172
+[ ! -d $etc ] && mkdir $etc
173
 
174
 # remote or not
175
-if [[ -z $ssh ]]; then
176
+if [ -z "$ssh" ]; then
177
         pipe="rdup-up$OPT $OPT_DRY $STRIP -t $BACKUPDIR/$NOW"
178
 else
179
         pipe="$ssh rdup-up$OPT $OPT_DRY $STRIP -t $BACKUPDIR/$NOW"
180
 fi
181
 # path encryption
182
-if [[ -n $pathtrans ]]; then
183
+if [ -n "$pathtrans" ]; then
184
 	pipe="rdup-tr $pathtrans | $pipe"
185
 fi
186
 
187
@@ -248,7 +249,7 @@
188
 
189
 if ! $force; then
190
 	# path is set at the top
191
-        if [[ -z $ssh ]]; then
192
+        if [ -z "$ssh" ]; then
193
 		$PROGNAME $OPT_DRY -L +$DAYS /dev/null $BACKUPDIR
194
 #		rdup-ln -l $DAYS $BACKUPDIR
195
                 purpose=$?
(-)./rdup/pkg-descr (-3 / +1 lines)
Lines 5-12 Link Here
5
removed, allowing for correct incremental backups.
5
removed, allowing for correct incremental backups.
6
6
7
An example script named rdup-simple is included to show how to 
7
An example script named rdup-simple is included to show how to 
8
implement a simple snapshot-style backup strategy.  This bash script requires 
8
implement a simple snapshot-style backup strategy.
9
GNU date and cp, which are not installed by this FreeBSD port. If you want to 
10
use the script, you should also install the sysutils/coreutils port.
11
9
12
WWW: http://miek.nl/projects/rdup
10
WWW: http://miek.nl/projects/rdup

Return to bug 145588