Skip to content

Commit 7d5b30e

Browse files
avargitster
authored andcommitted
gitweb: hard-depend on the Digest::MD5 5.8 module
Since my d48b284 ("perl: bump the required Perl version to 5.8 from 5.6.[21]", 2010-09-24), we've depended on 5.8, so there's no reason to conditionally require Digest::MD5 anymore. It was released with perl v5.7.3[1] The initial introduction of the dependency in e9fdd74 ("gitweb: (gr)avatar support", 2009-06-30) says as much, this also undoes part of the later 2e9c878 ("gitweb: Mention optional Perl modules in INSTALL", 2011-02-04) since gitweb will always be run on at least 5.8, so there's no need to mention Digest::MD5 as a required module in the documentation, let's instead say that we require perl 5.8. 1. $ corelist Digest::MD5 Data for 2015-02-14 Digest::MD5 was first released with perl v5.7.3 Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f0e19cb commit 7d5b30e

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

gitweb/INSTALL

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ Requirements
2929
------------
3030

3131
- Core git tools
32-
- Perl
32+
- Perl 5.8
3333
- Perl modules: CGI, Encode, Fcntl, File::Find, File::Basename.
3434
- web server
3535

3636
The following optional Perl modules are required for extra features
37-
- Digest::MD5 - for gravatar support
3837
- CGI::Fast and FCGI - for running gitweb as FastCGI script
3938
- HTML::TagCloud - for fancy tag cloud in project list view
4039
- HTTP::Date or Time::ParseDate - to support If-Modified-Since for feeds

gitweb/gitweb.perl

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
use File::Find qw();
2121
use File::Basename qw(basename);
2222
use Time::HiRes qw(gettimeofday tv_interval);
23+
use Digest::MD5 qw(md5_hex);
24+
2325
binmode STDOUT, ':utf8';
2426

2527
if (!defined($CGI::VERSION) || $CGI::VERSION < 4.08) {
@@ -490,7 +492,6 @@ sub evaluate_uri {
490492
# Currently available providers are gravatar and picon.
491493
# If an unknown provider is specified, the feature is disabled.
492494

493-
# Gravatar depends on Digest::MD5.
494495
# Picon currently relies on the indiana.edu database.
495496

496497
# To enable system wide have in $GITWEB_CONFIG
@@ -1166,18 +1167,8 @@ sub configure_gitweb_features {
11661167
our @snapshot_fmts = gitweb_get_feature('snapshot');
11671168
@snapshot_fmts = filter_snapshot_fmts(@snapshot_fmts);
11681169

1169-
# check that the avatar feature is set to a known provider name,
1170-
# and for each provider check if the dependencies are satisfied.
1171-
# if the provider name is invalid or the dependencies are not met,
1172-
# reset $git_avatar to the empty string.
11731170
our ($git_avatar) = gitweb_get_feature('avatar');
1174-
if ($git_avatar eq 'gravatar') {
1175-
$git_avatar = '' unless (eval { require Digest::MD5; 1; });
1176-
} elsif ($git_avatar eq 'picon') {
1177-
# no dependencies
1178-
} else {
1179-
$git_avatar = '';
1180-
}
1171+
$git_avatar = '' unless $git_avatar =~ /^(?:gravatar|picon)$/s;
11811172

11821173
our @extra_branch_refs = gitweb_get_feature('extra-branch-refs');
11831174
@extra_branch_refs = filter_and_validate_refs (@extra_branch_refs);
@@ -2167,7 +2158,7 @@ sub gravatar_url {
21672158
my $size = shift;
21682159
$avatar_cache{$email} ||=
21692160
"//www.gravatar.com/avatar/" .
2170-
Digest::MD5::md5_hex($email) . "?s=";
2161+
md5_hex($email) . "?s=";
21712162
return $avatar_cache{$email} . $size;
21722163
}
21732164

0 commit comments

Comments
 (0)