Re: [PATCHv2] gitweb: gravatar support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]