]> gitweb.michael.orlitzky.com - mjo-overlay.git/blob - app-backup/backuppc/files/BackupPC-2.1.2pl2.diff
e98ff4f0e9c3cfb6f208db0540750f0bc3aa85f7
[mjo-overlay.git] / app-backup / backuppc / files / BackupPC-2.1.2pl2.diff
1 #
2 # BackupPC-2.1.2pl2.diff: BackupPC patch file generated
3 # on Sun Jun 18 19:36:32 2006.
4 #
5 # This patch file should be applied to a cleanly unpacked BackupPC
6 # version 2.1.2. Do not apply any old patch files; each
7 # patch file accumulates all previous changes.
8 #
9 # Example:
10 #
11 # # fetch BackupPC-2.1.2.tar.gz
12 # # fetch BackupPC-2.1.2pl2.diff
13 # tar zxvf BackupPC-2.1.2.tar.gz
14 # cd BackupPC-2.1.2
15 # patch -p0 < ../BackupPC-2.1.2pl2.diff
16 # perl configure.pl
17 #
18 # ChangeLog:
19 #
20 # - In conf/config.pl, changed --devices to -D in $Conf{RsyncArgs}
21 # and $Conf{RsyncRestoreArgs} to fix "fileListReceive failed" and
22 # "Can't open .../f%2f for empty output" errors with rsync 2.6.7+.
23 # Fix proposed by Justin Pessa and Vincent Ho, and confirmed by
24 # Dan Niles.
25 #
26 # - Added patch from Michael (mna.news) to ignore "file is unchanged"
27 # message from tar 1.15.x during incremental backups.
28 #
29 # - Fixed creation of .rsrc directories in bin/BackupPC_tarExtract
30 # when used with xtar on MacOS. Reported by Samuel Bancal and
31 # Matthew Radey, who helped with debugging.
32 #
33 # - Fixed bug in BackupPC_tarExtract for files >8GB in size whose
34 # lengths are multiples of 256. Reported by Jamie Myers and
35 # Marko Tukiainen, who both helped debugging the problem.
36 #
37 # - Fixed bug in lib/BackupPC/Xfer/RsyncFileIO.pm that caused
38 # incorrected deleted attributes to be set in directories
39 # where one of the files had an rsync phase 1 retry during
40 # an incremental. Reported by Tony Nelson.
41 #
42 --- bin/BackupPC_tarExtract 2005-09-05 16:21:21.000000000 -0700
43 +++ bin/BackupPC_tarExtract 2006-06-18 19:36:31.995945464 -0700
44 @@ -58,7 +58,7 @@
45 exit(1);
46 }
47 my $client = $1;
48 -if ( $ARGV[1] !~ /^([\w\s\.\/\$-]+)$/ ) {
49 +if ( $ARGV[1] !~ /^([\w\s.\/$(){}[\]-]+)$/ ) {
50 print("$0: bad share name '$ARGV[1]'\n");
51 exit(1);
52 }
53 @@ -101,7 +101,7 @@
54 # Copyright 1998 Stephen Zander. All rights reserved.
55 #
56 my $tar_unpack_header
57 - = 'Z100 A8 A8 A8 A12 A12 A8 A1 Z100 A6 A2 Z32 Z32 A8 A8 A155 x12';
58 + = 'Z100 A8 A8 A8 a12 A12 A8 A1 Z100 A6 A2 Z32 Z32 A8 A8 A155 x12';
59 my $tar_header_length = 512;
60
61 my $BufSize = 1048576; # 1MB or 2^20
62 @@ -251,7 +251,7 @@
63 $name = $longName if ( defined($longName) );
64 $linkname = $longLink if ( defined($longLink) );
65 $name =~ s{^\./+}{};
66 - $name =~ s{/+$}{};
67 + $name =~ s{/+\.?$}{};
68 $name =~ s{//+}{/}g;
69 return {
70 name => $name,
71 @@ -313,7 +313,7 @@
72 #
73 my($nRead);
74 #print("Reading $f->{name}, $f->{size} bytes, type $f->{type}\n");
75 - pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
76 + pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
77 my $poolWrite = BackupPC::PoolWrite->new($bpc,
78 "$OutDir/$ShareName/$f->{mangleName}",
79 $f->{size}, $Compress);
80 @@ -351,7 +351,7 @@
81 # a plain file.
82 #
83 $f->{size} = length($f->{linkname});
84 - pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
85 + pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
86 my $poolWrite = BackupPC::PoolWrite->new($bpc,
87 "$OutDir/$ShareName/$f->{mangleName}",
88 $f->{size}, $Compress);
89 @@ -369,7 +369,7 @@
90 # contents.
91 #
92 $f->{size} = length($f->{linkname});
93 - pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
94 + pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
95 my $poolWrite = BackupPC::PoolWrite->new($bpc,
96 "$OutDir/$ShareName/$f->{mangleName}",
97 $f->{size}, $Compress);
98 @@ -393,7 +393,7 @@
99 } else {
100 $data = "$f->{devmajor},$f->{devminor}";
101 }
102 - pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
103 + pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
104 my $poolWrite = BackupPC::PoolWrite->new($bpc,
105 "$OutDir/$ShareName/$f->{mangleName}",
106 length($data), $Compress);
107 @@ -487,17 +487,21 @@
108 #
109 sub pathCreate
110 {
111 - my($dir, $fullPath, $file, $f) = @_;
112 + my($dir, $fullPath, $f) = @_;
113
114 #
115 # Get parent directory of each of $dir and $fullPath
116 #
117 - $dir =~ s{/[^/]*$}{};
118 + # print("pathCreate: dir = $dir, fullPath = $fullPath\n");
119 + $dir =~ s{/([^/]*)$}{};
120 + my $file = $bpc->fileNameUnmangle($1);
121 $fullPath =~ s{/[^/]*$}{};
122 - return if ( -d $fullPath );
123 + return if ( -d $fullPath || $file eq "" );
124 + unlink($fullPath) if ( -e $fullPath );
125 mkpath($fullPath, 0, 0777);
126 $Attrib{$dir} = BackupPC::Attrib->new({ compress => $Compress })
127 if ( !defined($Attrib{$dir}) );
128 + # print("pathCreate: adding file = $file to dir = $dir\n");
129 $Attrib{$dir}->set($file, {
130 type => BPC_FTYPE_DIR,
131 mode => 0755,
132 --- lib/BackupPC/Lib.pm 2005-09-05 16:21:21.000000000 -0700
133 +++ lib/BackupPC/Lib.pm 2006-06-18 19:36:32.035939384 -0700
134 @@ -59,7 +59,7 @@
135 TopDir => $topDir || '__TOPDIR__',
136 BinDir => $installDir || '__INSTALLDIR__',
137 LibDir => $installDir || '__INSTALLDIR__',
138 - Version => '2.1.2',
139 + Version => '2.1.2pl2',
140 BackupFields => [qw(
141 num type startTime endTime
142 nFiles size nFilesExist sizeExist nFilesNew sizeNew
143 --- lib/BackupPC/Xfer/RsyncFileIO.pm 2005-09-05 16:21:21.000000000 -0700
144 +++ lib/BackupPC/Xfer/RsyncFileIO.pm 2006-06-18 19:36:32.120926464 -0700
145 @@ -405,6 +405,11 @@
146 my($fio, $d) = @_;
147 my($poolWrite);
148
149 + #
150 + # Don't write attributes on 2nd phase - they're already
151 + # taken care of during the first phase.
152 + #
153 + return if ( $fio->{phase} > 0 );
154 if ( !defined($d) ) {
155 #
156 # flush all entries (in reverse order)
157 @@ -932,6 +937,7 @@
158
159 close($fio->{rxInFd}) if ( defined($fio->{rxInFd}) );
160 unlink("$fio->{outDirSh}RStmp") if ( -f "$fio->{outDirSh}RStmp" );
161 + $fio->{phase} = $phase;
162
163 #
164 # Check the final md4 digest
165 --- lib/BackupPC/Xfer/Tar.pm 2005-09-05 16:21:21.000000000 -0700
166 +++ lib/BackupPC/Xfer/Tar.pm 2006-06-18 19:36:32.110927984 -0700
167 @@ -221,8 +221,13 @@
168 $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 2 );
169 $t->{fileCnt}++;
170 } else {
171 - $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 );
172 - $t->{xferErrCnt}++;
173 + #
174 + # Ignore annoying log message on incremental for tar 1.15.x
175 + #
176 + if ( !/: file is unchanged; not dumped$/ ) {
177 + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 );
178 + $t->{xferErrCnt}++;
179 + }
180 #
181 # If tar encounters a minor error, it will exit with a non-zero
182 # status. We still consider that ok. Remember if tar prints
183 --- conf/config.pl 2005-09-05 16:21:22.000000000 -0700
184 +++ conf/config.pl 2006-06-18 19:36:31.968949568 -0700
185 @@ -1052,7 +1052,7 @@
186 '--perms',
187 '--owner',
188 '--group',
189 - '--devices',
190 + '-D',
191 '--links',
192 '--times',
193 '--block-size=2048',
194 @@ -1086,7 +1086,7 @@
195 '--perms',
196 '--owner',
197 '--group',
198 - '--devices',
199 + '-D',
200 '--links',
201 '--times',
202 '--block-size=2048',