git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Crane <git@aaroncrane.co.uk>
To: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Cc: git@vger.kernel.org, Jakub Narebski <jnareb@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCHv2] gitweb: gravatar support
Date: Sat, 20 Jun 2009 15:16:27 +0100	[thread overview]
Message-ID: <20090620141626.GK7675@aaroncrane.co.uk> (raw)
In-Reply-To: <1245435670-5688-1-git-send-email-giuseppe.bilotta@gmail.com>

Giuseppe Bilotta writes:
> +# check if gravatars are enabled and dependencies are satisfied
> +our $git_gravatar_enabled = gitweb_check_feature('gravatar') &&
> +	(eval { use Digest::MD5 qw(md5_hex); 1; });

This test for the availability of Digest::MD5 is broken: `use`
statements are executed at compile time, so the whole program will
fail if Digest::MD5 can't be loaded.

A possible fix would be to move the compile-time actions to run time:

    our $git_gravatar_enabled = gitweb_check_feature('gravatar') &&
         (eval { require Digest::MD5; Digest::MD5->import('md5_hex'); 1 });

However, I don't recommend doing that.  Digest::MD5 is a core module
in Perl 5.8.0 and later, so an installation of Perl 5.8 that doesn't
have it is broken.  Since gitweb.perl already needs 5.8 (because of
the `binmode STDOUT, ':utf8'` at the top, if nothing else) I see no
value in jumping through hoops to make this work in the essentially
impossible situation where Digest::MD5 is unavailable.

-- 
Aaron Crane ** http://aaroncrane.co.uk/

  parent reply	other threads:[~2009-06-20 14:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-19 18:21 [PATCHv2] gitweb: gravatar support Giuseppe Bilotta
2009-06-19 18:26 ` Johannes Schindelin
2009-06-19 18:36   ` Johannes Schindelin
2009-06-19 20:28 ` Junio C Hamano
2009-06-19 22:43   ` Giuseppe Bilotta
2009-06-20 19:24   ` Jakub Narebski
2009-06-20 10:57 ` Jakub Narebski
2009-06-20 14:16 ` Aaron Crane [this message]
2009-06-20 16:58   ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090620141626.GK7675@aaroncrane.co.uk \
    --to=git@aaroncrane.co.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=giuseppe.bilotta@gmail.com \
    --cc=jnareb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).