Update gitweb.perl to current CGI.pm API
PATCH 1/1 Update gitweb.perl to current CGI.pm API
Hi all,
This simple two-line patch fixes a bug that makes gitweb unusable on
systems where the installed CGI.pm is version 4.04 or later (such as on Debian unstable). That version removed the startform method, which had previously been deprecated in favour of start_form since 2009.
I don't have any specific tests for that change, but it does help
fixing the testsuite of FusionForge (which includes a test of its Git plugin, involving gitweb).
For reference, this is Debian bug #765525 (http://bugs.debian.org/765525).
(I'm not subscribed to the git@vger mailing-list; please Cc me on
replies.)
Thanks,
Roland.
Quoted 1 line
From
1b74cfb8568927a307f165e428455789398f6d61Mon Sep 17 00:00:00 2001
From: Roland Mas <[email protected]>
Date: Thu, 16 Oct 2014 00:05:25 +0200
Subject: [PATCH] Update gitweb.perl to current CGI.pm API
CGI.pm 4.04 removed the startform method, which had previously been deprecated in favour of start_form. Updated gitweb.perl accordingly.
--- gitweb/gitweb.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
gitweb/gitweb.perl +2 -2
@@ -4100,7 +4100,7 @@ sub print_search_form { if ($use_pathinfo) { $action .= "/".esc_url($project); } - print $cgi->startform(-method => "get", -action => $action) . + print $cgi->start_form(-method => "get", -action => $action) . "<div class=\"search\">\n" . (!$use_pathinfo && $cgi->input({-name=>"p", -value=>$project, -type=>"hidden"}) . "\n") .
@@ -5510,7 +5510,7 @@ sub git_project_search_form { } print "<div class=\"projsearch\">\n"; - print $cgi->startform(-method => 'get', -action => $my_uri) . + print $cgi->start_form(-method => 'get', -action => $my_uri) . $cgi->hidden(-name => 'a', -value => 'project_list') . "\n"; print $cgi->hidden(-name => 'pf', -value => $project_filter). "\n" if (defined $project_filter);
Signature · 1 line
2.1.1
Looks sensible to me; Jakub, ack?
Quoted 55 lines · Roland Mas
Hi all,
This simple two-line patch fixes a bug that makes gitweb unusable on
systems where the installed CGI.pm is version 4.04 or later (such as on Debian unstable). That version removed the startform method, which had previously been deprecated in favour ofstart_formsince 2009.I don't have any specific tests for that change, but it does help
fixing the testsuite of FusionForge (which includes a test of its Git plugin, involving gitweb).For reference, this is Debian bug #765525 (http://bugs.debian.org/765525).
(I'm not subscribed to the git@vger mailing-list; please Cc me on
replies.)Thanks,
Roland.
From
1b74cfb8568927a307f165e428455789398f6d61Mon Sep 17 00:00:00 2001
From: Roland Mas <[email protected]>
Date: Thu, 16 Oct 2014 00:05:25 +0200
Subject: [PATCH] Update gitweb.perl to current CGI.pm APICGI.pm 4.04 removed the startform method, which had previously been deprecated in favour of
start_form. Updated gitweb.perl accordingly.Signed-off-by Roland Mas <[email protected]>--- gitweb/gitweb.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)gitweb/gitweb.perl +2
-2@@ -4100,7 +4100,7 @@ sub print_search_form { if ($use_pathinfo) { $action .= "/".esc_url($project); } - print $cgi->startform(-method => "get", -action => $action) . + print $cgi->start_form(-method => "get", -action => $action) . "<div class=\"search\">\n" . (!$use_pathinfo && $cgi->input({-name=>"p", -value=>$project, -type=>"hidden"}) . "\n") .@@ -5510,7 +5510,7 @@ sub git_project_search_form { } print "<div class=\"projsearch\">\n"; - print $cgi->startform(-method => 'get', -action => $my_uri) . + print $cgi->start_form(-method => 'get', -action => $my_uri) . $cgi->hidden(-name => 'a', -value => 'project_list') . "\n"; print $cgi->hidden(-name => 'pf', -value => $project_filter). "\n" if (defined $project_filter);
A message that is not in the archive (sent off-list or not yet received): CANQwDwdm6aMVC7U+nbbtS=J8M2fYOk_MECt_1=NX=pXdt06YjQ@mail.gmail.com
Junio C Hamano
Reviewed-by Jakub NarębskiQuoted 9 lines · Jakub Narębski
Quoted 2 lines · Junio C Hamano
Looks sensible to me; Jakub, ack?
Ack.
Nb. this code follows back to original gitweb.cgi by Kay Sievers, very early in the development (2005)
Thanks. I realize that Ack sounds as if "Yeah, I acknowledge and admit I was in the wrong earlier", but I didn't mean "I think this is your bug---do you think it is a good fix?" I just meant the latter half of that sentence.
Here is what I'll queue (note: I've retitled so that an entry in "git shortlog" would mean something).
Thanks, both.
-- >8 --
From: Roland Mas <[email protected]>
Subject: [PATCH] gitweb: use start_form, not startform that was removed in CGI.pm 4.04
CGI.pm 4.04 removed the startform method, which had previously been deprecated in favour of start_form. Changes file for CGI.pm says:
4.04 2014-09-04
[ REMOVED / DEPRECATIONS ]
- startform and endform methods removed (previously deprecated, you should be using the start_form and end_form methods)
--- gitweb/gitweb.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
gitweb/gitweb.perl +2 -2
@@ -4100,7 +4100,7 @@ sub print_search_form { if ($use_pathinfo) { $action .= "/".esc_url($project); } - print $cgi->startform(-method => "get", -action => $action) . + print $cgi->start_form(-method => "get", -action => $action) . "<div class=\"search\">\n" . (!$use_pathinfo && $cgi->input({-name=>"p", -value=>$project, -type=>"hidden"}) . "\n") .
@@ -5510,7 +5510,7 @@ sub git_project_search_form { } print "<div class=\"projsearch\">\n"; - print $cgi->startform(-method => 'get', -action => $my_uri) . + print $cgi->start_form(-method => 'get', -action => $my_uri) . $cgi->hidden(-name => 'a', -value => 'project_list') . "\n"; print $cgi->hidden(-name => 'pf', -value => $project_filter). "\n" if (defined $project_filter);
Signature · 1 line
2.1.2-561-gc401a55