summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSitaram Chamarty <sitaram@atc.tcs.com>2011-10-21 11:59:58 +0530
committerSitaram Chamarty <sitaram@atc.tcs.com>2011-10-21 11:59:58 +0530
commit76825433857b8ab68dc02cca970b51d074789bbe (patch)
tree391e261e772bcd8291e3e61f0e9d85bacf9d0f26
parentIt's official now; Solaris sh is brain dead... (diff)
downloadgitolite-gentoo-76825433857b8ab68dc02cca970b51d074789bbe.tar.gz
gitolite-gentoo-76825433857b8ab68dc02cca970b51d074789bbe.tar.bz2
gitolite-gentoo-76825433857b8ab68dc02cca970b51d074789bbe.zip
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!
-rw-r--r--src/gitolite.pm5
1 files 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
# ----------------------------------------------------------------------------