Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 580254 - 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.
Summary: app-backup/backuppc-3.3.1-r1 with >=perl-5.22: Can't use 'defined(@array)' (M...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-16 18:30 UTC by Jochen Schlick
Modified: 2016-11-27 08:31 UTC (History)
2 users (show)

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


Attachments
patch that fixes >=perl-5.22 incompatibility (01-fix_perl_deprecated_defined_Browse.pm.patch,607 bytes, patch)
2016-11-22 20:27 UTC, Till Korten
Details | Diff
ebuild that applies the patch (backuppc-3.3.1-r3.ebuild,5.32 KB, text/plain)
2016-11-22 20:28 UTC, Till Korten
Details

Note You need to log in before you can comment on or make changes to this bug.
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!