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!
This commit is contained in:
Sitaram Chamarty 2011-10-21 11:59:58 +05:30
parent 5a125fac96
commit 7682543385

View file

@ -48,8 +48,6 @@ use Data::Dumper;
$Data::Dumper::Deepcopy = 1; $Data::Dumper::Deepcopy = 1;
$|++; $|++;
use CGI::Util qw(escape);
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# find the rc file, then pull the libraries # find the rc file, then pull the libraries
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
@ -80,6 +78,9 @@ BEGIN {
use lib $ENV{GL_BINDIR}; use lib $ENV{GL_BINDIR};
use gitolite_rc; 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 # the big data structures we care about
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------