summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schweizer <genstef@gentoo.org>2007-07-24 07:10:12 +0000
committerStefan Schweizer <genstef@gentoo.org>2007-07-24 07:10:12 +0000
commit83661289524bd992c82a9def8f8d1f1ae685af0a (patch)
treeed7d17fb58a0e80e5384a28692877b3dc83ad860 /app-backup/flexbackup
parentstabilize for antarus (diff)
downloadgentoo-2-83661289524bd992c82a9def8f8d1f1ae685af0a.tar.gz
gentoo-2-83661289524bd992c82a9def8f8d1f1ae685af0a.tar.bz2
gentoo-2-83661289524bd992c82a9def8f8d1f1ae685af0a.zip
New ebuild addresses bug #184560 (fails to backup targets with spaces in their names).
(Portage version: 2.1.3_rc9)
Diffstat (limited to 'app-backup/flexbackup')
-rw-r--r--app-backup/flexbackup/ChangeLog8
-rw-r--r--app-backup/flexbackup/files/digest-flexbackup-1.2.1-r63
-rw-r--r--app-backup/flexbackup/files/flexbackup-1.2.1-spaces-in-filenames.patch296
-rw-r--r--app-backup/flexbackup/flexbackup-1.2.1-r6.ebuild59
4 files changed, 365 insertions, 1 deletions
diff --git a/app-backup/flexbackup/ChangeLog b/app-backup/flexbackup/ChangeLog
index 87efdcfd29c4..2de68834f05d 100644
--- a/app-backup/flexbackup/ChangeLog
+++ b/app-backup/flexbackup/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-backup/flexbackup
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-backup/flexbackup/ChangeLog,v 1.15 2007/05/12 08:33:02 genstef Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-backup/flexbackup/ChangeLog,v 1.16 2007/07/24 07:10:12 genstef Exp $
+
+ 19 Jul 2007; John R. Graham (john_r_graham) <john_r_graham@mindspring.com>
+ +flexbackup-1.2.1-r6.ebuild,
+ +files/flexbackup-1.2.1-spaces-in-filenames.patch:
+ New ebuild addresses bug #184560 (fails to backup targets with spaces in
+ their names).
12 May 2007; John R. Graham (john_r_graham) <john_r_graham@mindspring.com>
+flexbackup-1.2.1-r5.ebuild, +files/flexbackup-1.2.1-prune.patch:
diff --git a/app-backup/flexbackup/files/digest-flexbackup-1.2.1-r6 b/app-backup/flexbackup/files/digest-flexbackup-1.2.1-r6
new file mode 100644
index 000000000000..92deefe369f4
--- /dev/null
+++ b/app-backup/flexbackup/files/digest-flexbackup-1.2.1-r6
@@ -0,0 +1,3 @@
+MD5 4955c89dbee354248f354a9bf0a480dd flexbackup-1.2.1.tar.gz 80158
+RMD160 d2a56ce6a3770498ef96ffbf75f65026b04f492c flexbackup-1.2.1.tar.gz 80158
+SHA256 58282b21985be75f1219c5ff4906d217055ed8627ea3e2ffdfe7a2393bc9d2c3 flexbackup-1.2.1.tar.gz 80158
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-r6.ebuild b/app-backup/flexbackup/flexbackup-1.2.1-r6.ebuild
new file mode 100644
index 000000000000..666a29564c98
--- /dev/null
+++ b/app-backup/flexbackup/flexbackup-1.2.1-r6.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-backup/flexbackup/flexbackup-1.2.1-r6.ebuild,v 1.1 2007/07/24 07:10:12 genstef Exp $
+
+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}"
+ epatch "${FILESDIR}"/${P}-lzma.patch
+ epatch "${FILESDIR}"/${P}-secure-tempfile.patch
+ epatch "${FILESDIR}"/${P}-bash.patch
+ epatch "${FILESDIR}"/${P}-mbuffer-switch.patch
+ epatch "${FILESDIR}"/${P}-remote-bufftest.patch
+ epatch "${FILESDIR}"/${P}-prune.patch
+ epatch "${FILESDIR}"/${P}-spaces-in-filenames.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."
+}