diff options
Diffstat (limited to 'app-backup/flexbackup')
14 files changed, 987 insertions, 0 deletions
diff --git a/app-backup/flexbackup/Manifest b/app-backup/flexbackup/Manifest new file mode 100644 index 000000000000..ee6efa3d7e8b --- /dev/null +++ b/app-backup/flexbackup/Manifest @@ -0,0 +1 @@ +DIST flexbackup-1.2.1.tar.gz 80158 SHA256 58282b21985be75f1219c5ff4906d217055ed8627ea3e2ffdfe7a2393bc9d2c3 SHA512 17630bc46657becdf5d5bde4852fd6cebe189fe54d381bda6471aa2e1db1ff082ba24461e2c22ba5805c2d93ac7f9805ffbdc4904da017f1b163cc21b5a3974b WHIRLPOOL 0beb123986579b5f5c9add2e1ccc02b11e687dfce7a093d550239aec50cf5a35cf15da066a6b0f23819a001dce222d5167874527411bb31bca405b55c8f2d171 diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-afio-large-files.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-afio-large-files.patch new file mode 100644 index 000000000000..bf5ea230c85c --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-afio-large-files.patch @@ -0,0 +1,13 @@ +Index: flexbackup +=================================================================== +--- flexbackup (revision 808) ++++ flexbackup (working copy) +@@ -1155,7 +1155,7 @@ + $cmd .= "$::path{afio} -o "; + $cmd .= "$no_compress "; + $cmd .= "-z "; +- $cmd .= "-1 m "; ++ $cmd .= "-1 mC "; + $cmd .= "$::afio_z_flag "; + $cmd .= "$::afio_verb_flag "; + $cmd .= "$::afio_sparse_flag "; diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-bash.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-bash.patch new file mode 100644 index 000000000000..a9da86a8e135 --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-bash.patch @@ -0,0 +1,18 @@ +--- flexbackup 2005-06-16 20:28:04.577086588 -0700 ++++ flexbackup 2005-06-16 22:21:14.787322560 -0700 +@@ -5396,10 +5396,10 @@ + my $shell = $1; + my $ver = $2; + if ($shell eq 'bash') { +- if ($ver =~ m/^2/) { +- $::shelltype{$host} = 'bash2'; +- } else { ++ if ($ver =~ m/^1/) { + $::shelltype{$host} = 'bash1'; ++ } else { ++ $::shelltype{$host} = 'bash2'; + } + } else { + $::shelltype{$host} = $shell; + + diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-lzma.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-lzma.patch new file mode 100644 index 000000000000..95fa79ba606d --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-lzma.patch @@ -0,0 +1,114 @@ +--- flexbackup 2003-10-10 15:12:09.000000000 +0100 ++++ flexbackup 2007-01-15 01:08:18.000000000 +0000 +@@ -687,6 +687,8 @@ + $filename .= ".zip"; + } elsif ($cfg::compress eq "compress") { + $filename .= ".Z"; ++ } elsif ($cfg::compress eq "lzma") { ++ $filename .= ".lzma"; + } + } elsif ($cfg::type eq "afio") { + # tag these a little different, the archive file itself isn't a +@@ -701,6 +703,8 @@ + $filename .= "-zip"; + } elsif ($cfg::compress eq "compress") { + $filename .= "-Z"; ++ } elsif ($cfg::compress eq "lzma") { ++ $filename .= "-lzma"; + } + } + +@@ -2700,7 +2704,7 @@ + # First check if things are defined in the config file + # Checks exist, true/false, or one of options + &checkvar(\$cfg::type,'type','dump afio cpio tar star pax zip ar shar lha copy rsync filelist','tar'); +- &checkvar(\$cfg::compress,'compress','gzip bzip2 lzop compress zip false hardware','gzip'); ++ &checkvar(\$cfg::compress,'compress','gzip bzip2 lzop compress zip false hardware lzma','gzip'); + &checkvar(\$cfg::compr_level,'compr_level','exist','4'); + &checkvar(\$cfg::verbose,'verbose','bool','true'); + &checkvar(\$cfg::sparse,'sparse','bool','true'); +@@ -3001,6 +3005,16 @@ + $::z = " | $::path{zip} -$cfg::compr_level - -"; + $::unz = "$::path{funzip} | "; + } ++ } elsif ($cfg::compress eq "lzma") { ++ $::path{'lzma'} = &checkinpath($cfg::compress); ++ push(@::remoteprogs, $::path{$cfg::compress}); ++ if ($cfg::compr_level !~ m/^[123456789]$/) { ++ push(@::errors,"\$compr_level must be set to 1-9"); ++ } else { ++ $::z = " | $::path{$cfg::compress} -$cfg::compr_level "; ++ } ++ $::unz = "$::path{$cfg::compress} -d | "; ++ + } else { + $::z = ""; + $::unz = ""; +@@ -3252,6 +3266,10 @@ + $::afio_z_flag = "-P $::path{$cfg::compress} -Q -c -Z"; + $::afio_unz_flag = "-P $::path{$cfg::compress} -Q -d -Q -c -Z"; + ++ } elsif ($cfg::compress eq "lzma") { ++ $::afio_z_flag = "-P $::path{$cfg::compress} -Q -$cfg::compr_level -Z"; ++ $::afio_unz_flag = "-P $::path{$cfg::compress} -Q -d -Z"; ++ + } + $::unz = ""; # Reset & just use this for reading the archive file. + +@@ -3415,7 +3433,7 @@ + $::path{'lha'} = &checkinpath('lha'); + push(@::remoteprogs, $::path{'lha'}); + +- if ($cfg::compress =~ /^(gzip|bzip2|lzop|compress|zip)$/) { ++ if ($cfg::compress =~ /^(gzip|bzip2|lzop|compress|zip|lzma)$/) { + warn("Using type \"lha\" with compress=$cfg::compress makes no sense"); + warn("Setting compression to false"); + $::unz = ""; +@@ -3781,7 +3799,7 @@ + + # Try and guess file types and commpression scheme + # might as well since we are reading from a file in this case +- if ($file =~ m/\.(dump|cpio|tar|star|pax|a|shar|filelist)\.(gz|bz2|lzo|Z|zip)$/) { ++ if ($file =~ m/\.(dump|cpio|tar|star|pax|a|shar|filelist)\.(gz|bz2|lzo|Z|zip|lzma)$/) { + $cfg::type = $1; + $cfg::compress = $2; + $cfg::type =~ s/^a$/ar/; +@@ -3789,16 +3807,18 @@ + $cfg::compress =~ s/bz2/bzip2/; + $cfg::compress =~ s/lzo/lzop/; + $cfg::compress =~ s/Z/compress/; ++ $cfg::compress =~ s/lzma/lzma/; + &log("| Auto-set to type=$cfg::type compress=$cfg::compress"); + &optioncheck(); # redo to set a few variables over + +- } elsif ($file =~ m/\.afio-(gz|bz2|lzo|Z|zip)$/) { ++ } elsif ($file =~ m/\.afio-(gz|bz2|lzo|Z|zip|lzma)$/) { + $cfg::type = "afio"; + $cfg::compress = $1; + $cfg::compress =~ s/gz/gzip/; + $cfg::compress =~ s/bz2/bzip2/; + $cfg::compress =~ s/lzo/lzop/; + $cfg::compress =~ s/Z/compress/; ++ $cfg::compress =~ s/lzma/lzma/; + &log("| Auto-set to type=$cfg::type compress=$cfg::compress"); + &optioncheck(); # redo to set a few variables over + +@@ -5686,3 +5706,5 @@ + + return($spinner[$index]); + } ++ ++ +--- flexbackup.conf 2007-01-15 01:11:36.000000000 +0000 ++++ flexbackup.conf.new 2007-01-15 01:21:46.000000000 +0000 +@@ -33,8 +33,8 @@ + $prune{'/'} = "tmp proc"; + + # Compression +-$compress = 'gzip'; # one of false/gzip/bzip2/lzop/zip/compress/hardware +-$compr_level = '4'; # compression level (1-9) (for gzip/bzip2/lzop/zip) ++$compress = 'gzip'; # one of false/gzip/bzip2/lzop/zip/compress/hardware/lzma ++$compr_level = '4'; # compression level (1-9) (for gzip/bzip2/lzop/zip/lzma) + + # Buffering program - to help streaming + $buffer = 'false'; # one of false/buffer/mbuffer diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-mbuffer-switch.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-mbuffer-switch.patch new file mode 100644 index 000000000000..d22e40f24c26 --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-mbuffer-switch.patch @@ -0,0 +1,130 @@ +Common subdirectories: flexbackup-1.2.1-r3/contrib and flexbackup-1.2.1-r4/contrib +diff -ubB flexbackup-1.2.1-r3/flexbackup flexbackup-1.2.1-r4/flexbackup +--- flexbackup-1.2.1-r3/flexbackup 2007-04-14 17:03:34.000000000 -0400 ++++ flexbackup-1.2.1-r4/flexbackup 2007-04-14 17:09:48.000000000 -0400 +@@ -442,7 +442,7 @@ + # Get rid of trailing / + $dir = &nuke_trailing_slash($dir); + +- # If level is icremental for the set, each dir might ++ # If level is incremental for the set, each dir might + # have a different numeric level + if (!defined($::set_incremental)) { + $level = $::level; +@@ -3090,7 +3090,7 @@ + push(@::remoteprogs, $::path{'mbuffer'}); + + my $megs = $cfg::buffer_megs . "M"; +- my $bufcmd = "$::path{mbuffer} -q -m $megs -p $cfg::buffer_fill_pct $mbuffer_blk_flag "; ++ my $bufcmd = "$::path{mbuffer} -q -m $megs -P $cfg::buffer_fill_pct $mbuffer_blk_flag "; + + $::buffer_cmd = " | $bufcmd"; + $::write_cmd = "$bufcmd -f -o "; +@@ -4884,18 +4884,24 @@ + } + + if (defined(%{$::prune{$prunekey}})) { ++ my $rex; + # FreeBSD needs -E (above) and no backslashes around the (|) chars + if ($::uname =~ /FreeBSD/) { +- $cmd .= '-regex "\./('; +- $cmd .= join('|', keys %{$::prune{$prunekey}}); +- $cmd .= ')/.*" '; +- } else { +- $cmd .= '-regex "\./\('; +- $cmd .= join('\|', keys %{$::prune{$prunekey}}); +- $cmd .= '\)/.*" '; +- } ++ $rex = '-regex "\./('; ++ $rex .= join('|', keys %{$::prune{$prunekey}}); ++ $rex .= ')/.*" '; ++ } else { ++ $rex = '-regex "\./\('; ++ $rex .= join('\|', keys %{$::prune{$prunekey}}); ++ $rex .= '\)/.*" '; ++ } ++ # Show what the darn thing is constructing for prune expressions. ++ &log("| \"find\" regex for pruning is: $rex"); ++ $cmd .= $rex; + $cmd .= '-prune -o '; + } else { ++ # Show what the darn thing is constructing for prune expressions. ++ &log("| No pruning defined for this tree."); + # Can't use find -depth with -prune (see single unix spec etc) + # (not toally required anyway, only if you are archiving dirs you + # don't have permissions on and are running as non-root) +diff -ubB flexbackup-1.2.1-r3/flexbackup.conf flexbackup-1.2.1-r4/flexbackup.conf +--- flexbackup-1.2.1-r3/flexbackup.conf 2007-04-14 17:03:35.000000000 -0400 ++++ flexbackup-1.2.1-r4/flexbackup.conf 2007-04-14 17:09:48.000000000 -0400 +@@ -30,6 +30,45 @@ + # A space-separated list of directories to prune from each backup. + # Key is a filesystem or host:dir spec as outlined above + # regular expressions allowed (not shell-type wildcards!) ++# ++# Note: These directories are actually regular expressions and must ++# match "find" output relative to the path of the current backup set. This ++# means that different exclusions are needed for different backup sets. ++# This is a little tricky, so, read on. ++# ++# The regular expressions are processed by "find" but, before "find" is run, ++# FlexBackup changes into the base directory of the backup set in progress. ++# FlexBackup then runs "find" with a path of "." which means all output lines ++# start with "./". To be helpful, FlexBackup packages each space-separated ++# prune directory as follows. If you have a prune list like this ++# ++# $prune{'/somedir'} = "one two three"; ++# ++# then, the constructed -regex argument to "find" looks like this ++# ++# -regex "\./\(one\|two\|three\)/.*" ++# ++# The last thing you need to know is that FlexBackup only uses the prune ++# terms that match the current base directory in the set you're backing ++# up. For example, if your backup set definition looks like this ++# ++# $set{'daily'} = "/home /root /var /usr"; ++# ++# and you want to do some exclusions in "/home" and "/var" (but not the other ++# directories), you must set up a prune list for those two directories ++# separately. For example, to exclude bert's and ernie's home directories plus ++# /var/tmp, you would need the following: ++# ++# $prune{'/home'} = "bert ernie"; ++# $prune{'/var'} = "tmp"; ++# ++# In particular, combining these *does not* work. For example, this ++# ++# $prune{'/'} = "home/bert home/ernie var/tmp"; ++# ++# does not work, unless, of course, your backup set is backing up "/", ++# which our example is not. ++# + $prune{'/'} = "tmp proc"; + + # Compression +@@ -84,7 +123,8 @@ + # True to try and preserve file access times during backup, if the selected + # archive program can do so. Note that if this is true, -cnewer checks (file + # permission/status changes only, not content) are turned off when deciding +-# which files to archive on the local system. ++# which files to archive on the local system. This is because preserving the ++# access time changes the permission/status change time in the filesystem. + $atime_preserve = 'false'; + + # Span across filesytems? ("dump" will ignore this option) +@@ -97,8 +137,13 @@ + # leading directories (the filesystem specs above or the "-dir" flag). + # Matches paths, not filenames, so put .* on the front/back as needed. + # Comment these out to exclude nothing. +-$exclude_expr[0] = '.*/[Cc]ache/.*'; +-$exclude_expr[1] = '.*~$'; ++# ++# Note: The first example line breaks portage in a restored backup because ++# "/usr/lib/portage/pym/cache" is not backed up. Way too general! The moral ++# of this story is, be very careful with global excludes. The second example ++# is probably okay. ++# $exclude_expr[0] = '.*/[Cc]ache/.*'; ++# $exclude_expr[1] = '.*~$'; + + # If true (default), and using a tape device, level zero "set" backups + # assume you want to erase and use a new tape for each set. If false, level diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-perl-5.12-deprecation-warning.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-perl-5.12-deprecation-warning.patch new file mode 100644 index 000000000000..2976eab916f1 --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-perl-5.12-deprecation-warning.patch @@ -0,0 +1,29 @@ +--- flexbackup.~1~ 2010-10-09 13:19:27.633694860 +0200 ++++ flexbackup 2010-10-09 13:21:52.396818511 +0200 +@@ -133,6 +133,9 @@ + # tar has a limit of this many chars in its volume label + $::tar_max_label = 99; + ++# Define the prune hash to avoid warnings with perl 5.12 ++use vars qw( %prune ); ++ + # Get commandline flags + %::opt = (); + if (! &::GetOptions(\%::opt, +@@ -1050,6 +1053,6 @@ + } else { + $prunekey = $dir; + } +- if (defined(%{$::prune{$prunekey}})) { ++ if (defined($prune{$prunekey})) { + &log("| NOTE: \$prune is ignored for type=dump"); + } +@@ -4885,7 +4885,7 @@ + $prunekey = $dir; + } + +- if (defined(%{$::prune{$prunekey}})) { ++ if (defined($prune{$prunekey})) { + my $rex; + # FreeBSD needs -E (above) and no backslashes around the (|) chars + if ($::uname =~ /FreeBSD/) { diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-perl-5.16-deprecation-warning.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-perl-5.16-deprecation-warning.patch new file mode 100644 index 000000000000..72d3abd838a7 --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-perl-5.16-deprecation-warning.patch @@ -0,0 +1,11 @@ +--- /usr/bin/flexbackup 2010-12-30 08:09:10.000000000 +0100 ++++ flexbackup 2013-12-24 15:44:25.000000000 +0100 +@@ -2688,7 +2688,7 @@ + } + + # Flag old config file +- if (defined(@cfg::filesystems) or defined($cfg::mt_var_blksize)) { ++ if (@cfg::filesystems or $cfg::mt_var_blksize) { + # so strict shuts up + my $junk = @cfg::filesystems; + $junk = $cfg::mt_var_blksize; diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-prune.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-prune.patch new file mode 100644 index 000000000000..35081932e6f1 --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-prune.patch @@ -0,0 +1,136 @@ +diff -ub flexbackup-old/flexbackup flexbackup-new/flexbackup +--- flexbackup-old/flexbackup 2007-05-11 20:14:13.000000000 -0400 ++++ flexbackup-new/flexbackup 2007-05-11 20:22:36.000000000 -0400 +@@ -3085,7 +3085,6 @@ + $::read_cmd = "$bufcmd $read_flags"; + + } elsif ($cfg::buffer eq "mbuffer") { +- + $::path{'mbuffer'} = &checkinpath('mbuffer'); + push(@::remoteprogs, $::path{'mbuffer'}); + +@@ -3101,7 +3100,6 @@ + } + } + } else { +- + # If buffering disabled, use dd or cat depending on if blocking turned off on not + if ($cfg::blksize eq '0') { + $::buffer_cmd = ""; +@@ -4887,18 +4885,19 @@ + my $rex; + # FreeBSD needs -E (above) and no backslashes around the (|) chars + if ($::uname =~ /FreeBSD/) { +- $rex = '-regex "\./('; ++ $rex = '"\./('; + $rex .= join('|', keys %{$::prune{$prunekey}}); +- $rex .= ')/.*" '; ++ $rex .= ')"'; + } else { +- $rex = '-regex "\./\('; ++ $rex = '"\./\('; + $rex .= join('\|', keys %{$::prune{$prunekey}}); +- $rex .= '\)/.*" '; ++ $rex .= '\)"'; + } + # Show what the darn thing is constructing for prune expressions. +- &log("| \"find\" regex for pruning is: $rex"); +- $cmd .= $rex; +- $cmd .= '-prune -o '; ++ &log("| \"find\" regex for pruning is:"); ++ &log("| $rex"); ++ &line(); ++ $cmd .= '-regex ' . $rex . ' -prune -o '; + } else { + # Show what the darn thing is constructing for prune expressions. + &log("| No pruning defined for this tree."); +diff -ub flexbackup-old/flexbackup.1 flexbackup-new/flexbackup.1 +--- flexbackup-old/flexbackup.1 2007-05-11 20:14:13.000000000 -0400 ++++ flexbackup-new/flexbackup.1 2007-05-11 20:09:58.000000000 -0400 +@@ -48,7 +48,7 @@ + Extract (restore) the files listed in text file \(dqfilelist\(dq into your + current working directory. + .TP +-\fBflexbackup\fR \fI-extract\fR \fI-flist\fR <\fIfilename\fR> ++\fBflexbackup\fR \fI-extract\fR \fI-onefile\fR <\fIfilename\fR> + Extract (restore) the single file named \(dqfilename\(dq into your current + working directory. + .TP +diff -ub flexbackup-old/flexbackup.conf flexbackup-new/flexbackup.conf +--- flexbackup-old/flexbackup.conf 2007-05-11 20:14:13.000000000 -0400 ++++ flexbackup-new/flexbackup.conf 2007-05-11 20:26:48.000000000 -0400 +@@ -28,10 +28,10 @@ + + # Subtree pruning + # A space-separated list of directories to prune from each backup. +-# Key is a filesystem or host:dir spec as outlined above +-# regular expressions allowed (not shell-type wildcards!) ++# Key is a filesystem or host:dir spec as outlined above. ++# Regular expressions are allowed (not shell-type wildcards!) + # +-# Note: These directories are actually regular expressions and must ++# Note: These "directories" are actually regular expressions and must + # match "find" output relative to the path of the current backup set. This + # means that different exclusions are needed for different backup sets. + # This is a little tricky, so, read on. +@@ -46,9 +46,11 @@ + # + # then, the constructed -regex argument to "find" looks like this + # +-# -regex "\./\(one\|two\|three\)/.*" ++# -regex "\./(one|two|three)" + # +-# The last thing you need to know is that FlexBackup only uses the prune ++# (with characters escaped as necessary depending on your environment). ++# ++# Another thing you need to know is that FlexBackup only uses the prune + # terms that match the current base directory in the set you're backing + # up. For example, if your backup set definition looks like this + # +@@ -66,9 +68,16 @@ + # + # $prune{'/'} = "home/bert home/ernie var/tmp"; + # +-# does not work, unless, of course, your backup set is backing up "/", ++# doesn't work, unless, of course, your backup set is backing up "/", + # which our example is not. + # ++# Many other complex and abstruse variations are possible. Here's one ++# interesting corner case. If you want to preserve a directory but none of its ++# contents, you can do it. Picking on ernie from our previous example, preserve ++# only his home directory: ++# ++# $prune{'/home'} = "ernie/.*"; ++# + $prune{'/'} = "tmp proc"; + + # Compression +@@ -138,10 +147,10 @@ + # Matches paths, not filenames, so put .* on the front/back as needed. + # Comment these out to exclude nothing. + # +-# Note: The first example line breaks portage in a restored backup because +-# "/usr/lib/portage/pym/cache" is not backed up. Way too general! The moral +-# of this story is, be very careful with global excludes. The second example +-# is probably okay. ++# Gentoo note: The first example line breaks portage in a restored backup ++# because "/usr/lib/portage/pym/cache" is not backed up. Way too general! ++# The moral of this story is, be very careful with global excludes. The ++# second example is probably okay. + # $exclude_expr[0] = '.*/[Cc]ache/.*'; + # $exclude_expr[1] = '.*~$'; + +diff -ub flexbackup-old/flexbackup.conf.5 flexbackup-new/flexbackup.conf.5 +--- flexbackup-old/flexbackup.conf.5 2007-05-11 20:14:13.000000000 -0400 ++++ flexbackup-new/flexbackup.conf.5 2007-05-11 20:09:58.000000000 -0400 +@@ -40,7 +40,9 @@ + \fB$prune{\fI'/'\fR}\fR = \fI'tmp proc'\fR; + Configure subtree pruning. A space-separated list of directories to prune from + each backup. Key is a filesystem/directory or \(dqhost:directory\(dq spec as +-outlined above regular expressions allowed (not shell-type wildcards!). ++outlined above. Regular expressions allowed (not shell-type wildcards!). There ++is additional explanation (and a lot of examples) in the provided configuration ++file. + .TP + \fB$compress\fR = \fI'false|gzip|bzip2|lzop|zip|compress|hardware'\fR; + .TQ diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-quieten.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-quieten.patch new file mode 100644 index 000000000000..4d9ad8f4e4c7 --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-quieten.patch @@ -0,0 +1,13 @@ +Index: flexbackup +=================================================================== +--- flexbackup (revision 814) ++++ flexbackup (revision 891) +@@ -2419,7 +2419,7 @@ + if (! -r "$configfile") { + die("config file $configfile: $OS_ERROR"); + } +- system("perl -c \"$configfile\""); ++ system("perl -c \"$configfile\" 2>&1"); + if ($CHILD_ERROR) { + die("syntax error in config file $configfile"); + } diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-remote-bufftest.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-remote-bufftest.patch new file mode 100644 index 000000000000..3d473b9810ce --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-remote-bufftest.patch @@ -0,0 +1,59 @@ +Common subdirectories: flexbackup-1.2.1-r4/contrib and flexbackup-1.2.1-r5/contrib +diff -ubB flexbackup-1.2.1-r4/flexbackup flexbackup-1.2.1-r5/flexbackup +--- flexbackup-1.2.1-r4/flexbackup 2007-04-14 17:09:48.000000000 -0400 ++++ flexbackup-1.2.1-r5/flexbackup 2007-04-14 17:23:20.000000000 -0400 +@@ -5276,6 +5276,7 @@ + my $tmp_script = "$cfg::tmpdir/buftest.$host.$PROCESS_ID.sh"; + my $retval = 0; + my $pipecmd; ++ my $explicit_success; + + $buffer_cmd =~ s:^\s*\|\s*::; + $buffer_cmd =~ s:\s*\|\s*$::; +@@ -5290,7 +5291,7 @@ + print SCR "res=\$?\n"; + print SCR "out=\`cat \$tmp_err\`\n"; + print SCR "if [ \$res -eq 0 ]; then\n"; +- print SCR " echo successful\n"; ++ print SCR " echo \"successful\"\n"; + print SCR "else\n"; + print SCR " echo \"unsuccessful: exit code \$res: \$out\" \n"; + print SCR "fi\n"; +@@ -5302,13 +5303,19 @@ + $pipecmd = "sh $tmp_script "; + } else { + print $::msg "| Checking '$cfg::buffer' on host $host... "; +- $pipecmd = "cat $tmp_script | ($::remoteshell $host 'cat > $tmp_script; sh $tmp_script; rm -f $tmp_script')"; ++ $pipecmd = "$::remoteshell $host '$::path{mkdir} -p $cfg::tmpdir'; cat $tmp_script | ($::remoteshell $host 'cat > $tmp_script; sh $tmp_script; rm -rf $cfg::tmpdir')"; + } + + if (!defined($::debug)) { + + open(PIPE,"$pipecmd |") || die; ++ ++ $explicit_success = 0; + while (<PIPE>) { ++ if (/^successful$/) { ++ $explicit_success = 1; ++ last; ++ } + if (/^unsuccessful: exit code (\d+): (.*)/) { + $retval = $1; + my $out = $2; +@@ -5337,11 +5344,15 @@ + print $::msg "\n(debug) $pipecmd\n"; + } + +- if ($retval == 0) { ++ if ($explicit_success) { + print $::msg "Ok\n"; + } else { ++ if ($retval == 0) { ++ push(@::errors, "Unanticipated problems encountered testing '$cfg::buffer' on host '$host'."); ++ } else { + print $::msg "Failed!\n"; + } ++ } + unlink("$tmp_script"); + + return($retval); diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-secure-tempfile.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-secure-tempfile.patch new file mode 100644 index 000000000000..9242f01efcfb --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-secure-tempfile.patch @@ -0,0 +1,72 @@ +--- a/flexbackup 2003-10-10 07:12:09.000000000 -0700 ++++ b/flexbackup 2006-05-14 13:14:54.000000000 -0700 +@@ -269,6 +269,7 @@ + untie(%::index); + } + ++system ('rm', '-rf', $cfg::tmpdir); + exit(0); + + ###################################################################### +@@ -811,6 +812,11 @@ + ($remove, @cmds) = &backup_filelist($label, $localdir, $title, $level, $remote); + } + ++ if(defined($remote)) { ++ # create our temporary directory as first remote command ++ unshift(@cmds, &maybe_remote_cmd("$::path{mkdir} -p $cfg::tmpdir", $remote)); ++ } ++ + # Nuke any tmp files used in the above routines + if ($remove ne '') { + push(@cmds, &maybe_remote_cmd("$::path{rm} -f $remove", $remote)); +@@ -827,6 +833,11 @@ + push(@cmds, &maybe_remote_cmd("$::path{rm} -f $pkglist", $remote)); + } + } ++ ++ if(defined($remote)) { ++ # remove temporary directory as our last remote command ++ push(@cmds, &maybe_remote_cmd("$::path{rm} -rf $cfg::tmpdir", $remote)); ++ } + + # Strip multiple spaces + foreach my $cmd (@cmds) { +@@ -2750,8 +2761,9 @@ + $::path{'find'} = &checkinpath('find'); + $::path{'dd'} = &checkinpath('dd'); + $::path{'printf'} = &checkinpath('printf'); ++ $::path{'mkdir'} = &checkinpath('mkdir'); + +- push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'})); ++ push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'},$::path{'mkdir'})); + + # Check device (or dir) + $::ftape = 0; +@@ -3442,6 +3454,15 @@ + push(@::errors,"\$tmpdir $cfg::tmpdir is not writable"); + } + ++ $cfg::hostname = `hostname`; ++ chomp($cfg::hostname); ++ ++ # Use a subdirectory of the user-specified directory as our tmpdir ++ # Also note that we make it closer to globally unique as we sometimes ++ # use this variable for remote systems, so PID isn't enough ++ $cfg::tmpdir = $cfg::tmpdir .'/flexbackup.'.$$.'.'.$cfg::hostname; ++ mkdir ($cfg::tmpdir) || die "Can't create temporary directory, $!"; ++ + # Levels + if (defined($::opt{'level'}) and + (defined($::opt{'incremental'}) or +@@ -5236,8 +5257,8 @@ + # Create a script which tests the buffer program + open(SCR,"> $tmp_script") || die; + print SCR "#!/bin/sh\n"; +- print SCR "tmp_data=/tmp/bufftest\$\$.txt\n"; +- print SCR "tmp_err=/tmp/bufftest\$\$.err\n"; ++ print SCR "tmp_data=\`tempfile\`\n"; ++ print SCR "tmp_err=\`tempfile\`\n"; + print SCR "echo testme > \$tmp_data\n"; + print SCR "$buffer_cmd > /dev/null 2> \$tmp_err < \$tmp_data\n"; + print SCR "res=\$?\n"; diff --git a/app-backup/flexbackup/files/flexbackup-1.2.1-spaces-in-filenames.patch b/app-backup/flexbackup/files/flexbackup-1.2.1-spaces-in-filenames.patch new file mode 100644 index 000000000000..1e9ea220ebf5 --- /dev/null +++ b/app-backup/flexbackup/files/flexbackup-1.2.1-spaces-in-filenames.patch @@ -0,0 +1,296 @@ +Index: flexbackup +=================================================================== +--- flexbackup (.../tags/flexbackup-1.2.1-r5) (revision 784) ++++ flexbackup (.../trunk) (revision 784) +@@ -1301,8 +1301,8 @@ + $cmd .= "$::unz"; + } + $cmd .= "("; +- $cmd .= "mkdir -p $::device ; "; +- $cmd .= "cd $::device ; "; ++ $cmd .= "mkdir -p \"$::device\" ; "; ++ $cmd .= "cd \"$::device\" ; "; + $cmd .= "$::path{cpio} -i "; + $cmd .= "-m "; + $cmd .= "-d "; +@@ -1351,9 +1351,8 @@ + + # Have to take leading './' off to make rsync's include/exclude work right + $cmd .= " | $::path{sed} -e \"s/\\.\\///g\" | "; +- + $cmd .= "$::path{rsync} "; +- $cmd .= "--include-from=- --exclude=* "; ++ $cmd .= "--files-from=- "; + $cmd .= "--archive "; + $cmd .= "$::rsync_verb_flag "; + $cmd .= "--delete --delete-excluded "; +@@ -1368,7 +1367,7 @@ + $cmd .= "$remote:"; + } + } +- $cmd .= "$dir/ $::device"; ++ $cmd .= "\"$dir/\" \"$::device\""; + + push(@cmds, $cmd); + +@@ -1658,7 +1657,9 @@ + my $tmpfile = "$cfg::tmpdir/ar.$PROCESS_ID"; + my $remove = ''; + +- &log("| NOTE: ar archives will not descend directories"); ++ &log("| NOTE: ar archives will not recurse into subdirectories,"); ++ &log("| which makes them inappropriate for most backups."); ++ &log("| Be sure this is what you want."); + + if (defined($remote) and ($level != 0)) { + my $time = &get_last_date($label, $level, 'numeric'); +@@ -1682,11 +1683,13 @@ + $cmd = "cd \"$dir\" && "; + $cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote, '-maxdepth 1 ! -type d'); + $cmd .= "> $filelist; "; ++ # Escape any spaces in filenames. ++ $cmd .= "$::path{sed} -i -e 's/ /\\\\ /g' $filelist; "; + + $cmd .= "$::path{ar} rc"; + $cmd .= "$::ar_verb_flag "; + $cmd .= "$tmpfile "; +- $cmd .= "`$::path{cat} $filelist`"; ++ $cmd .= "\@$filelist "; + $cmd .= "; $::path{cat} $tmpfile $::z"; + + # Buffer both sides if remote +@@ -1800,12 +1803,9 @@ + + $cmd = "cd \"$dir\" && "; + $cmd .= &file_list_cmd( $dir, $stamp, 'newline', $level, $remote); +- $cmd .= "> $filelist; "; +- +- $cmd .= "$::path{lha} a"; ++ $cmd .= " | $::path{lha} a"; + $cmd .= "$::lha_verb_flag "; + $cmd .= "$tmpfile "; +- $cmd .= "`$::path{cat} $filelist`"; + $cmd .= "; $::path{cat} $tmpfile $::z"; + + # Buffer both sides if remote +@@ -2766,6 +2766,7 @@ + $::path{'dd'} = &checkinpath('dd'); + $::path{'printf'} = &checkinpath('printf'); + $::path{'mkdir'} = &checkinpath('mkdir'); ++ $::path{'sed'} = &checkinpath('sed'); + + push(@::remoteprogs,($::path{'touch'},$::path{'rm'},$::path{'find'},$::path{'printf'},$::path{'mkdir'})); + +@@ -4894,9 +4895,9 @@ + $rex .= '\)"'; + } + # Show what the darn thing is constructing for prune expressions. +- &log("| \"find\" regex for pruning is:"); +- &log("| $rex"); +- &line(); ++ (my $temp = $rex) =~ s/\\([()|])/$1/g; ++ &log("| \"find\" regex for pruning (shell escaping omitted for clarity) is:"); ++ &log("| $temp"); + $cmd .= '-regex ' . $rex . ' -prune -o '; + } else { + # Show what the darn thing is constructing for prune expressions. +@@ -4906,6 +4907,7 @@ + # don't have permissions on and are running as non-root) + $cmd .= "-depth "; + } ++ &line(); + + $cmd .= "$::mountpoint_flag "; + $cmd .= "! -type s "; +@@ -5301,12 +5303,14 @@ + print $::msg "| Checking '$cfg::buffer' on this machine... "; + $pipecmd = "sh $tmp_script "; + } else { ++ $pipecmd = ++ "$::remoteshell $host '$::path{mkdir} -p $cfg::tmpdir'; " . ++ "cat $tmp_script | ($::remoteshell $host 'cat > $tmp_script; " . ++ "sh $tmp_script; rm -rf $cfg::tmpdir')"; + print $::msg "| Checking '$cfg::buffer' on host $host... "; +- $pipecmd = "$::remoteshell $host '$::path{mkdir} -p $cfg::tmpdir'; cat $tmp_script | ($::remoteshell $host 'cat > $tmp_script; sh $tmp_script; rm -rf $cfg::tmpdir')"; + } + + if (!defined($::debug)) { +- + open(PIPE,"$pipecmd |") || die; + + $explicit_success = 0; +Index: flexbackup.conf +=================================================================== +--- flexbackup.conf (.../tags/flexbackup-1.2.1-r5) (revision 784) ++++ flexbackup.conf (.../trunk) (revision 784) +@@ -12,19 +12,27 @@ + + # Configure backup "sets". + # Not needed if you use "-dir <dir>" to backup one tree at a time. +-# Each set is a simple space-separated list of filesystems +-# Remote filesystems should denoted as 'host:dir' +-# You can use anything (other than 'all') as set names +-# +-# Example: +-# $set{'set1'} = "/home /usr"; +-# $set{'set2'} = "/dir3 machine2:/dir4 machine3:/dir5"; ++# Each set is a simple space-separated list of filesystems. Remote filesystems ++# should denoted as 'host:dir'. If the filesystem name (local or remote) ++# contains spaces, then it should be enclosed in its entirety in double quotes. ++# Multiple quoted filesystems included in a set should be space separated just ++# like unquoted filesystem. The Perl '.' string concatenation operator can be ++# used to split excessively long lines. ++# ++# You can use anything (other than 'all') as set names. ++# ++# Examples: ++# $set{'set1'} = '/home /usr'; ++# $set{'set2'} = '/dir3 machine2:/dir4 machine3:/dir5'; ++# $set{'set3'} = ++# '"/mnt/winmachine1/Documents and Settings" ' . ++# '"/mnt/winmachine1/Program Files"'; + # + # "-set all" will back up all defined sets. If you are doing a full backup + # using tapes, each "set" will go onto a different tape and you will be + # prompted for tape change in between. + # +-$set{'backup'} = "/home"; ++$set{'backup'} = '/home'; + + # Subtree pruning + # A space-separated list of directories to prune from each backup. +@@ -42,7 +50,7 @@ + # start with "./". To be helpful, FlexBackup packages each space-separated + # prune directory as follows. If you have a prune list like this + # +-# $prune{'/somedir'} = "one two three"; ++# $prune{'/somedir'} = 'one two three'; + # + # then, the constructed -regex argument to "find" looks like this + # +@@ -54,31 +62,38 @@ + # terms that match the current base directory in the set you're backing + # up. For example, if your backup set definition looks like this + # +-# $set{'daily'} = "/home /root /var /usr"; ++# $set{'daily'} = '/home /root /var /usr'; + # + # and you want to do some exclusions in "/home" and "/var" (but not the other + # directories), you must set up a prune list for those two directories + # separately. For example, to exclude bert's and ernie's home directories plus + # /var/tmp, you would need the following: + # +-# $prune{'/home'} = "bert ernie"; +-# $prune{'/var'} = "tmp"; ++# $prune{'/home'} = 'bert ernie'; ++# $prune{'/var'} = 'tmp'; + # + # In particular, combining these *does not* work. For example, this + # +-# $prune{'/'} = "home/bert home/ernie var/tmp"; ++# $prune{'/'} = 'home/bert home/ernie var/tmp'; + # + # doesn't work, unless, of course, your backup set is backing up "/", + # which our example is not. + # ++# Like the $set configuration item, special handling is required for ++# directories with spaces in them. Double quotes should surround pruning ++# targets but not the key. Example: ++# ++# $prune{'/mnt/winmachine1/Documents and Settings'} = ++# '"user1/Local Settings/Temp" user2'; ++# + # Many other complex and abstruse variations are possible. Here's one + # interesting corner case. If you want to preserve a directory but none of its + # contents, you can do it. Picking on ernie from our previous example, preserve + # only his home directory: + # +-# $prune{'/home'} = "ernie/.*"; ++# $prune{'/home'} = 'ernie/.*'; + # +-$prune{'/'} = "tmp proc"; ++$prune{'/'} = 'tmp proc'; + + # Compression + $compress = 'gzip'; # one of false/gzip/bzip2/lzop/zip/compress/hardware/lzma +Index: flexbackup.conf.5 +=================================================================== +--- flexbackup.conf.5 (.../tags/flexbackup-1.2.1-r5) (revision 784) ++++ flexbackup.conf.5 (.../trunk) (revision 784) +@@ -24,25 +24,51 @@ + .TP + \fB$set{\fI'tag'\fR}\fR = \fI'/dir'\fR; + Configure backup \(dqsets\(dq. Not needed if \(dq-dir <dir>\(dq is used to +-backup one tree at a time. Each set is a simple space-separated list of +-filesystems/directories. Remote filesystems should be denoted as +-\(dqhost:directory\(dq. You can use anything (other than \fI'all'\fR) as set +-names. Using \(dq-set all\(dq will back up all defined sets. If you are doing +-a full backup using tapes, each \(dqset\(dq will go onto a different tape and +-you will be prompted for tape change in between. Examples: ++backup one tree at a time. ++Each set is a simple space-separated list of filesystems/directories. ++Remote filesystems should be denoted as \(dqhost:directory\(dq. ++You can use anything (other than \fI'all'\fR) as set names. ++Using \(dq-set all\(dq will back up all defined sets. ++If you are doing a full backup using tapes, each \(dqset\(dq will go onto a ++different tape and you will be prompted for tape change in between. ++Examples: + .RS + .PP + \fB$set{\fI'set1'\fI}\fR = \fI'/home /usr'\fR; + .br + \fB$set{\fI'set2'\fI}\fR = \fI'/dir3 machine2:/dir4 machine3:/dir5'\fR; ++.br ++.PP ++Directories (local or remote) with spaces in their names should be enclosed in ++their entirety in double quotes. ++Multiple quoted directories included in a set should be space separated just ++like unquoted directories. ++The Perl '.' string concatenation operator can be used to split excessively ++long sets. ++Example: ++.PP ++\fB$set{\fI'set3'\fI}\fR = \fI ++ '\(dq/mnt/winmachine1/Documents and Settings\(dq ' . ++ '\(dq/mnt/winmachine1/Program Files\(dq';\fR + .RE + .TP + \fB$prune{\fI'/'\fR}\fR = \fI'tmp proc'\fR; + Configure subtree pruning. A space-separated list of directories to prune from + each backup. Key is a filesystem/directory or \(dqhost:directory\(dq spec as +-outlined above. Regular expressions allowed (not shell-type wildcards!). There +-is additional explanation (and a lot of examples) in the provided configuration +-file. ++outlined above. Regular expressions allowed (not shell-type wildcards!). ++.RS ++.PP ++Like the \fB$set\fR configuration item, special handling is required for ++directories with spaces in them. Double quotes should surround pruning targets ++but not the key. Example: ++.PP ++\fB$prune{\fI'/mnt/winmachine1/Documents and Settings'\fI}\fR = ++ \fI'\(dquser1/Local Settings/Temp\(dq user2'\fR; ++.br ++.PP ++There are lots of examples and additional explanation in the provided sample ++configuration file. ++.RE + .TP + \fB$compress\fR = \fI'false|gzip|bzip2|lzop|zip|compress|hardware'\fR; + .TQ +@@ -207,7 +233,7 @@ + .RS + .TP + If GNU \fBtar\fR is called \fB\(dqgtar\(dq\fR on your system: +-\fB$path{'tar'} = 'gtar'; ++\fB$path{'tar'} = 'gtar';\fR + .TP + Or it can be used to \fB\(dqsudo\(dq\fR certain commands: + \fB$path{\fI'find'\fR}\fR = \fI'sudo find'\fR; +@@ -304,3 +330,6 @@ + Written by Edwin Huffstutler (edwinh@computer.org) + .SH "SEE ALSO" + \fBflexbackup\fR(1) ++.\" Local Variables: ++.\" mode: nroff ++.\" End: diff --git a/app-backup/flexbackup/flexbackup-1.2.1-r12.ebuild b/app-backup/flexbackup/flexbackup-1.2.1-r12.ebuild new file mode 100644 index 000000000000..e726f43950b5 --- /dev/null +++ b/app-backup/flexbackup/flexbackup-1.2.1-r12.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +inherit eutils versionator + +DESCRIPTION="Flexible backup script using perl" +HOMEPAGE="http://flexbackup.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 hppa ppc x86" +IUSE="" + +RDEPEND="app-arch/mt-st" +DEPEND="${RDEPEND}" + +src_unpack() { + unpack ${A} + cd "${S}" + + # Patch from upstream adds optional lzma compression mode. + epatch "${FILESDIR}"/${P}-lzma.patch + + # Fix bug #116510: cannot back up remote machines after patch CAN-2005-2965 + epatch "${FILESDIR}"/${P}-secure-tempfile.patch + + # Fix bug #96334: incorrectly determines bash 3.x to be bash 1.x + epatch "${FILESDIR}"/${P}-bash.patch + + # Fix bug #171205: specifies wrong command line option for mbuffer / other small enhancements + epatch "${FILESDIR}"/${P}-mbuffer-switch.patch + + # Fix bug #173672: remote host buffer test is broken + epatch "${FILESDIR}"/${P}-remote-bufftest.patch + + # Fix bug #178126: subtle subtree pruning issue / other small issues + epatch "${FILESDIR}"/${P}-prune.patch + + # Fix bug #184560: fails to back up targets with spaces in their names in some modes + epatch "${FILESDIR}"/${P}-spaces-in-filenames.patch + + # Fix bug #190357: fails on very large files with afio back end + epatch "${FILESDIR}"/${P}-afio-large-files.patch + + # Fix bug #235416: prevent normal status message during conf file read from going to stderr + epatch "${FILESDIR}"/${P}-quieten.patch + + # Fix bug #331673: perl 5.12 deprecation warnings. + epatch "${FILESDIR}"/${P}-perl-5.12-deprecation-warning.patch + + # Fix bug #495232: perl 5.16 deprecation warnings. + epatch "${FILESDIR}"/${P}-perl-5.16-deprecation-warning.patch + + sed -i \ + -e '/^\$type = /s:afio:tar:' \ + -e "/^\$buffer = /s:'buffer':'false':" \ + flexbackup.conf \ + || die "Failed to set modified configuration defaults." + + MY_PV=$(replace_all_version_separators '_') + sed -i \ + -e "/^[[:blank:]]*my \$ver = /s:${MY_PV}:&-${PR}:" \ + flexbackup \ + || die "Failed to apply ebuild revision to internal version string." +} + +src_install() { + dodir /etc /usr/bin /usr/share/man/man{1,5} + emake install \ + PREFIX="${D}"/usr \ + CONFFILE="${D}"/etc/flexbackup.conf \ + || die "emake install failed" + + dodoc CHANGES CREDITS README TODO + dohtml faq.html +} + +pkg_postinst() { + elog "Please edit your /etc/flexbackup.conf file to suit your" + elog "needs. If you are using devfs, the tape device should" + elog "be set to /dev/tapes/tape0/mtn. If you need to use any" + elog "archiver other than tar, please emerge it separately." +} diff --git a/app-backup/flexbackup/metadata.xml b/app-backup/flexbackup/metadata.xml new file mode 100644 index 000000000000..c1ddf236a3f1 --- /dev/null +++ b/app-backup/flexbackup/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>graaff@gentoo.org</email> + </maintainer> + <upstream> + <remote-id type="sourceforge">flexbackup</remote-id> + </upstream> +</pkgmetadata> |