Re: [patch] 3.2.1 several patches
Alexander Moisseev <[email protected]>
| Newsgroups | gmane.comp.sysutils.backup.backuppc.devel |
|---|---|
| Message-ID | <[email protected]> |
13.02.2013 17:55, Richard Shaw пишет: > On Mon, Feb 11, 2013 at 5:25 AM, Alexander Moisseev > <[email protected]> wrote: >> Some patches for BackupPC 3.2.1: > > I would be willing to test these on my home BackupPC system. Could you > provide a unified diff? > > Thanks, > Richard > All files attached to original post are unified format diffs. Files named patch-* where * indicates the pathname of the file that is patched. I made this patches for FreeBSD port sysutils/backuppc. If you asked for "all-in-one" patch, see it in attachment. Regards, Alexander ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ BackupPC-devel mailing list [email protected] List: https://lists.sourceforge.net/lists/listinfo/backuppc-devel Wiki: http://backuppc.wiki.sourceforge.net Project: http://backuppc.sourceforge.net/
BackupPC-3.2.1.patch
(text/plain, 7.2 KB)
diff -ruN BackupPC-3.2.1.orig/bin/BackupPC_zipCreate BackupPC-3.2.1/bin/BackupPC_zipCreate
--- BackupPC-3.2.1.orig/bin/BackupPC_zipCreate 2011-04-25 07:31:55.000000000 +0400
+++ BackupPC-3.2.1/bin/BackupPC_zipCreate 2013-02-13 19:15:14.000000000 +0400
@@ -21,7 +21,7 @@
# -r pathRemove path prefix that will be replaced with pathAdd
# -p pathAdd new path prefix
# -c level compression level (default is 0, no compression)
-# -e charset charset for encoding file names (default: cp1252)
+# -e charset charset for encoding file names (default: utf8)
#
# The -h, -n and -s options specify which dump is used to generate
# the zip archive. The -r and -p options can be used to relocate
@@ -93,7 +93,7 @@
-r pathRemove path prefix that will be replaced with pathAdd
-p pathAdd new path prefix
-c level compression level (default is 0, no compression)
- -e charset charset for encoding file names (default: cp1252)
+ -e charset charset for encoding file names (default: utf8)
EOF
exit(1);
}
@@ -135,7 +135,7 @@
exit(1);
}
-my $Charset = "cp1252";
+my $Charset = ""; # default: utf8
$Charset = $opts{e} if ( $opts{e} ne "" );
my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ );
@@ -311,6 +311,14 @@
# Specify the compression level for this member
$zipmember->desiredCompressionLevel($compLevel) if ($compLevel =~ /[0-9]/);
+ if ( $Charset =~ /^(?:utf[-_]?8)?$/i ) {
+ # Set general purpose bit 11 for UTF-8 code page
+ $zipmember->{bitFlag} = $zipmember->{bitFlag} | 0x0800 ;
+ } elsif ( $Charset =~ /^cp(?:437|720|737|775|85[02578]|86[069]|874|93[26]|949|950)$/i ) {
+ # Set "version made by" field to 0 (MS-DOS) for OEM code pages
+ $zipmember->fileAttributeFormat('FA_MSDOS');
+ }
+
# Finally Zip the member
$zipfh->addMember($zipmember);
}
diff -ruN BackupPC-3.2.1.orig/conf/config.pl BackupPC-3.2.1/conf/config.pl
--- BackupPC-3.2.1.orig/conf/config.pl 2011-04-25 07:31:55.000000000 +0400
+++ BackupPC-3.2.1/conf/config.pl 2013-02-13 19:15:14.000000000 +0400
@@ -976,7 +976,7 @@
# redirection and pipes; put that in a script if you need it.
#
$Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName'
- . ' $I_option -U $userName -E -N -d 1'
+ . ' $I_option -U $userName -E -d 1'
. ' -c tarmode\\ full -Tc$X_option - $fileList';
#
@@ -990,7 +990,7 @@
# redirection and pipes; put that in a script if you need it.
#
$Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName'
- . ' $I_option -U $userName -E -N -d 1'
+ . ' $I_option -U $userName -E -d 1'
. ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList';
#
@@ -1008,7 +1008,7 @@
# redirection and pipes; put that in a script if you need it.
#
$Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName'
- . ' $I_option -U $userName -E -N -d 1'
+ . ' $I_option -U $userName -E -d 1'
. ' -c tarmode\\ full -Tx -';
###########################################################################
diff -ruN BackupPC-3.2.1.orig/doc/BackupPC.html BackupPC-3.2.1/doc/BackupPC.html
--- BackupPC-3.2.1.orig/doc/BackupPC.html 2011-04-25 07:31:55.000000000 +0400
+++ BackupPC-3.2.1/doc/BackupPC.html 2013-02-13 19:15:14.000000000 +0400
@@ -1664,7 +1664,7 @@
-r pathRemove path prefix that will be replaced with pathAdd
-p pathAdd new path prefix
-c level compression level (default is 0, no compression)
- -e charset charset for encoding file names (default: cp1252)</pre>
+ -e charset charset for encoding file names (default: utf8)</pre>
<p>The command-line files and directories are relative to the specified
shareName. The zip file is written to stdout. The -h, -n and -s
options specify which dump is used to generate the zip archive. The
diff -ruN BackupPC-3.2.1.orig/doc/BackupPC.pod BackupPC-3.2.1/doc/BackupPC.pod
--- BackupPC-3.2.1.orig/doc/BackupPC.pod 2011-04-25 07:31:55.000000000 +0400
+++ BackupPC-3.2.1/doc/BackupPC.pod 2013-02-13 19:15:14.000000000 +0400
@@ -1729,7 +1729,7 @@
-r pathRemove path prefix that will be replaced with pathAdd
-p pathAdd new path prefix
-c level compression level (default is 0, no compression)
- -e charset charset for encoding file names (default: cp1252)
+ -e charset charset for encoding file names (default: utf8)
The command-line files and directories are relative to the specified
shareName. The zip file is written to stdout. The -h, -n and -s
diff -ruN BackupPC-3.2.1.orig/lib/BackupPC/CGI/Restore.pm BackupPC-3.2.1/lib/BackupPC/CGI/Restore.pm
--- BackupPC-3.2.1.orig/lib/BackupPC/CGI/Restore.pm 2011-04-25 07:31:55.000000000 +0400
+++ BackupPC-3.2.1/lib/BackupPC/CGI/Restore.pm 2013-02-13 19:15:14.000000000 +0400
@@ -233,6 +233,7 @@
"-n", $num,
"-c", $In{compressLevel},
"-s", $share,
+ "-e", $In{codePage},
@pathOpts,
@fileList
],
diff -ruN BackupPC-3.2.1.orig/lib/BackupPC/Lang/en.pm BackupPC-3.2.1/lib/BackupPC/Lang/en.pm
--- BackupPC-3.2.1.orig/lib/BackupPC/Lang/en.pm 2011-04-25 07:31:55.000000000 +0400
+++ BackupPC-3.2.1/lib/BackupPC/Lang/en.pm 2013-02-13 19:15:14.000000000 +0400
@@ -530,8 +530,16 @@
to \${EscHTML(\$pathHdr eq "" ? "/" : \$pathHdr)}
(otherwise archive will contain full paths).
<br>
-Compression (0=off, 1=fast,...,9=best)
-<input type="text" size="6" value="5" name="compressLevel">
+<table class="tableStnd" border="0">
+<tr>
+ <td>Compression (0=off, 1=fast,...,9=best)</td>
+ <td><input type="text" size="6" value="5" name="compressLevel"></td>
+</tr><tr>
+ <td>Code page (e.g. cp866)</td>
+ <td><input type="text" size="6" value="utf8" name="codePage"></td>
+</tr>
+</table>
+Note: for filenames with non latin characters OEM code page is compatible with most of the ZIP archivers.
<br>
<input type="submit" value="Download Zip File" name="ignore">
</form>
diff -ruN BackupPC-3.2.1.orig/lib/BackupPC/Lib.pm BackupPC-3.2.1/lib/BackupPC/Lib.pm
--- BackupPC-3.2.1.orig/lib/BackupPC/Lib.pm 2011-04-25 07:31:55.000000000 +0400
+++ BackupPC-3.2.1/lib/BackupPC/Lib.pm 2013-02-13 19:15:14.000000000 +0400
@@ -1409,7 +1409,7 @@
$conf->{$shareName} = [ $conf->{$shareName} ]
if ( ref($conf->{$shareName}) ne "ARRAY" );
- foreach my $param qw(BackupFilesOnly BackupFilesExclude) {
+ foreach my $param (qw(BackupFilesOnly BackupFilesExclude)) {
next if ( !defined($conf->{$param}) );
if ( ref($conf->{$param}) eq "HASH" ) {
#
diff -ruN BackupPC-3.2.1.orig/lib/BackupPC/Storage/Text.pm BackupPC-3.2.1/lib/BackupPC/Storage/Text.pm
--- BackupPC-3.2.1.orig/lib/BackupPC/Storage/Text.pm 2011-04-25 07:31:55.000000000 +0400
+++ BackupPC-3.2.1/lib/BackupPC/Storage/Text.pm 2013-02-13 19:15:14.000000000 +0400
@@ -298,7 +298,7 @@
#
# Promote BackupFilesOnly and BackupFilesExclude to hashes
#
- foreach my $param qw(BackupFilesOnly BackupFilesExclude) {
+ foreach my $param (qw(BackupFilesOnly BackupFilesExclude)) {
next if ( !defined($conf->{$param}) || ref($conf->{$param}) eq "HASH" );
$conf->{$param} = [ $conf->{$param} ]
if ( ref($conf->{$param}) ne "ARRAY" );