Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 333909 - app-backup/flexbackup-1.2.1-r9: Backups fail if target directory does not have a matching prune list
Summary: app-backup/flexbackup-1.2.1-r9: Backups fail if target directory does not hav...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Hans de Graaff
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340031
  Show dependency tree
 
Reported: 2010-08-22 07:28 UTC by Paul Colquhoun
Modified: 2010-10-09 11:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Colquhoun 2010-08-22 07:28:55 UTC
app-backup/flexbackup-1.2.1-r9 fails if any directory in the backup list does not have a prune list.

The -r9 update introduced a patch file that removed a 'defined()' test for the existence of a prune entry for each backup target. If a target does not have a prune entry, flexbackup fails with an error of "Can't use an undefined value as a HASH reference at /usr/bin/flexbackup line 4885."

Reproducible: Always

Steps to Reproduce:
1. Configure a backup set such as:  $set{'test'} = '/var /usr';
2. DO NOT define a prune entry for /var
3. Run flexbackup on the configured set:  flexbackup -set test -level incremental

Actual Results:  
Backup will fail at the first partition with error:

"Can't use an undefined value as a HASH reference at /usr/bin/flexbackup line 4885."

Expected Results:  
Backups should be done on all partitions in the set.

The -r9 ebuild incorporated a patch to remove a warning generated by perl 5.12. The patch changed 2 lines to remove a 'defined()' construct like this:

-    if (defined(%{$::prune{$prunekey}})) {
+    if (%{$::prune{$prunekey}}) {

The warning generated is:
"defined(%hash) is deprecated at /usr/bin/flexbackup line 4885.
        (Maybe you should just omit the defined()?)"

It appears that the warning is being generated in error, since the 'defined()' is not referencing a hash, but a specific element of a hash, just with extra syntax needed because of 'use strict'

The previous behavior can be restored by changing the patch to:

-    if (defined(%{$::prune{$prunekey}})) {
+    if (defined($prune{$prunekey}) {

and adding 'use vars qw( %prune );' at about line 102.

I have tested this under perl 5.12 and it supresses the warning message, as well as allowing backups on directories without explicit 'prune' lists.
Comment 1 Hans de Graaff gentoo-dev Security 2010-10-09 11:26:11 UTC
Thanks for the bug report, analysis and suggestion for fixing this. This should now be fixed in flexbackup-1.2.1-r10.