From 76825433857b8ab68dc02cca970b51d074789bbe Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 21 Oct 2011 11:59:58 +0530 Subject: [PATCH] silently disable URI escaping if CGI::Util is not found e5c3b0e on a machine without CGI::Util makes gitolite unusable. I checked that it was part of perl core, since `corelist CGI::Util` returns `CGI::Util was first released with perl 5.006001`. But apparently Fedora (at least) splits out core perl itself into smaller chunks. And on my devbox I never noticed because I had gitweb installed, which pulled it in as a dep. I found this out when I tried to upgrade my own prod server! --- src/gitolite.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gitolite.pm b/src/gitolite.pm index 9d76f8c..d67cd13 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -48,8 +48,6 @@ use Data::Dumper; $Data::Dumper::Deepcopy = 1; $|++; -use CGI::Util qw(escape); - # ---------------------------------------------------------------------------- # find the rc file, then pull the libraries # ---------------------------------------------------------------------------- @@ -80,6 +78,9 @@ BEGIN { use lib $ENV{GL_BINDIR}; use gitolite_rc; +# silently disable URI escaping if the module is not found +$GITWEB_URI_ESCAPE &&= eval "use CGI::Util qw(escape); 1"; + # ---------------------------------------------------------------------------- # the big data structures we care about # ----------------------------------------------------------------------------