Skip to content
Browse files

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!
  • Loading branch information...
1 parent 5a125fa commit 76825433857b8ab68dc02cca970b51d074789bbe @sitaramc committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/gitolite.pm
View
5 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
# ----------------------------------------------------------------------------

0 comments on commit 7682543

Please sign in to comment.
Something went wrong with that request. Please try again.