Bug 359015 - [PATCH] fedora 23: kde-info2html exits with error (perl compatibility problem) -> info browsing fails "Cannot Initiate the info Protocol"
Summary: [PATCH] fedora 23: kde-info2html exits with error (perl compatibility problem...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: info (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Matthias Hoelzer-Kluepfel
URL: info:ld
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-05 10:31 UTC by gnb10
Modified: 2016-07-21 19:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 15.12.2


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gnb10 2016-02-05 10:31:32 UTC
On fedora 23 kde-info2html doesn't run due to a perl construct that is obsolete. Running it manually shows the error

Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at ./kde-info2html line 174.

Reproducible: Always

Steps to Reproduce:
1. type info:<topic> into konqueror URL bar

Actual Results:  
The requested operation could not be completed

Cannot Initiate the info Protocol

Technical Reason: Unable to Launch Process

Details of the Request:

URL: info:ld
Protocol: info
Date and Time: Friday 05 February 2016 10:27
Additional Information:
The following is displayed:

Description:

The program on your computer which provides access to the <strong>info</strong> protocol could not be started. This is usually due to technical reasons.

Expected Results:  
The requested info page should be displayed.


The perl version is

This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux-thread-multi
(with 14 registered patches, see perl -V for more detail)

The following simple-minded patch makes it run on fedora 23:

diff -u kde-info2html kde-info2html.new
--- kde-info2html       2015-12-14 07:08:50.000000000 +0000
+++ kde-info2html.new   2016-02-05 09:49:39.853746561 +0000
@@ -171,7 +171,7 @@
                next if $looking && !/\* Menu/;
                $looking = 0;
                my @item = &ParseMenuItem($_,'dir');
-               if (!defined(@item)) { next }
+               if (!@item) { next }
                my ($MenuLinkTag, $MenuLinkFile, $MenuLinkRef, $MenuLinkText) = @item;
                if ($MenuLinkRef eq $FileName) {
                        &Redirect($MenuLinkFile, $MenuLinkTag);
@@ -429,7 +429,7 @@
 sub MenuItem2HTML {
     my ($Line, $BaseInfoFile) = @_;
     my @parse_results = &ParseMenuItem($Line, $BaseInfoFile);
-    if (!defined (@parse_results)) { return $Line; }
+    if (!@parse_results) { return $Line; }
     my ($MenuLinkTag, $MenuLinkFile, $MenuLinkRef, $MenuLinkText) = @parse_results;
     #-- produce a HTML line
     return "<tr class=\"infomenutr\"><td class=\"infomenutd\" style=\"width:30%\"><ul><li><a href=\"info:/$MenuLinkFile/$MenuLinkTag\">$MenuLinkRef</a></ul></td><td class=\"infomenutd\">$MenuLinkText";
Comment 1 Tomas Trnka 2016-02-05 12:29:23 UTC
Hi, I've accidentally stumbled upon the same bug yesterday. You can get a fixed version of kde-runtime packages (using essentially the same patch as you proposed) from my COPR here:
https://copr.fedorainfracloud.org/coprs/tootea/earlybird/build/157954/
Comment 2 gnb10 2016-02-08 20:02:07 UTC
Hi Tomas, thank you for the information, I'll take a look.
Comment 3 Pino Toscano 2016-02-08 21:51:21 UTC
Git commit af92d6180d479d1e56bc549bbda30a3036687182 by Pino Toscano.
Committed on 08/02/2016 at 21:48.
Pushed by pino into branch 'Applications/15.12'.

info: remove extra defined(@array)

Such syntax is long deprecated and a fatal error in Perl 5.22.0 [1].
FIXED-IN: 15.12.2

[1] http://perldoc.perl.org/perl5220delta.html

M  +2    -2    info/kde-info2html

http://commits.kde.org/kio-extras/af92d6180d479d1e56bc549bbda30a3036687182
Comment 4 Tomas Trnka 2016-07-21 19:39:53 UTC
Git commit 36139181fff43c227023f4c03c1e1a31e1be9dda by Tomáš Trnka.
Committed on 21/07/2016 at 19:34.
Pushed by ttrnka into branch 'Applications/16.08'.

info: remove extra defined(@array)

Such syntax is long deprecated and a fatal error in Perl 5.22.0 [1].

This commit is the KDE4 equivalent of kio-extras.git commit
af92d6180d479d1e56bc549bbda30a3036687182.

[1] http://perldoc.perl.org/perl5220delta.html

M  +2    -2    kioslave/info/kde-info2html

http://commits.kde.org/kde-runtime/36139181fff43c227023f4c03c1e1a31e1be9dda