Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 580254

Summary: app-backup/backuppc-3.3.1-r1 with >=perl-5.22: Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /usr/share/BackupPC/lib/BackupPC/CGI/Browse.pm line 68.
Product: Gentoo Linux Reporter: Jochen Schlick <josch09>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED FIXED    
Severity: normal CC: slawomir.nizio, webmaster
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=1259481
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch that fixes >=perl-5.22 incompatibility
ebuild that applies the patch

Description Jochen Schlick 2016-04-16 18:30:04 UTC
the Backup Browser of BackupPC is not able to browse/display files (if perl >=5.22 is installed) because in /usr/lib/BackupPC/CGI/Browse.pm several "...defined(..).." are used. 

There is already a patch for this issue and it works with dev-lang/perl-5.22.1. 

https://bugzilla.redhat.com/show_bug.cgi?id=1259481
https://bugzilla.redhat.com/attachment.cgi?id=1104083&action=diff
Comment 1 Sławomir Nizio 2016-09-18 11:51:54 UTC
This is now fatal with Perl 5.22, ie., package is unusable.

And this should be enough:

diff --git a/lib/BackupPC/CGI/Browse.pm b/lib/BackupPC/CGI/Browse.pm
index 7309955..fea400f 100644
--- a/lib/BackupPC/CGI/Browse.pm
+++ b/lib/BackupPC/CGI/Browse.pm
@@ -65,7 +65,7 @@ sub action
     #
     # default to the newest backup
     #
-    if ( !defined($In{num}) && defined(@Backups) && @Backups > 0 ) {
+    if ( !defined($In{num}) && @Backups > 0 ) {
         $i = @Backups - 1;
         $num = $Backups[$i]{num};
     }
Comment 2 Till Korten 2016-11-22 20:27:25 UTC
Created attachment 454076 [details, diff]
patch that fixes >=perl-5.22 incompatibility

This patch fixes the incompatibility between backuppc-3.3.1 and >=perl5.22
see also https://bugzilla.redhat.com/show_bug.cgi?id=1259481
Comment 3 Till Korten 2016-11-22 20:28:28 UTC
Created attachment 454078 [details]
ebuild that applies the patch

here is an ebuild that applies the patch and fixed the issue for me.
Comment 4 Till Korten 2016-11-22 20:29:56 UTC
p.s. the patch file needs to be placed in /usr/portage/app-backup/backuppc/files/3.3.1/
Comment 5 Pacho Ramos gentoo-dev 2016-11-26 12:54:02 UTC
[master d53e5b6] app-backup/backuppc: Fix perl-5.22 compat (#580254 by Till Korten)
 2 files changed, 213 insertions(+)
 create mode 100644 app-backup/backuppc/backuppc-3.3.1-r3.ebuild
 create mode 100644 app-backup/backuppc/files/backuppc-3.3.1-perl522.patch
Comment 6 Till Korten 2016-11-27 08:31:03 UTC
Thanks Pacho for the quick response!