From fee00fdb7a4ebb52e90f739cca33def70497620e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 31 Jul 2010 15:54:25 -0400 Subject: Use Digest::SHA built into perl rather than external Digest::SHA1 to simplify dependencies. Closes: #591040 --- IkiWiki/Plugin/graphviz.pm | 4 ++-- IkiWiki/Plugin/search.pm | 6 +++--- IkiWiki/Plugin/sparkline.pm | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index dfd66a03e..4ed8b89f1 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -37,10 +37,10 @@ sub render_graph (\%) { $src .= "}\n"; # Use the sha1 of the graphviz code as part of its filename. - eval q{use Digest::SHA1}; + eval q{use Digest::SHA}; error($@) if $@; my $dest=$params{page}."/graph-". - IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($src)). + IkiWiki::possibly_foolish_untaint(Digest::SHA::sha1_hex($src)). ".png"; will_render($params{page}, $dest); diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index 1cf762fce..8fb9dff0c 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -190,15 +190,15 @@ sub pageterm ($) { # 240 is the number used by omindex to decide when to hash an # overlong term. This does not use a compatible hash method though. if (length $page > 240) { - eval q{use Digest::SHA1}; + eval q{use Digest::SHA}; if ($@) { - debug("search: ".sprintf(gettext("need Digest::SHA1 to index %s"), $page)) if $@; + debug("search: ".sprintf(gettext("need Digest::SHA to index %s"), $page)) if $@; return undef; } # Note no colon, therefore it's guaranteed to not overlap # with a page with the same name as the hash.. - return "U".lc(Digest::SHA1::sha1_hex($page)); + return "U".lc(Digest::SHA::sha1_hex($page)); } else { return "U:".$page; diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm index 1b1d04cba..e28d2605a 100644 --- a/IkiWiki/Plugin/sparkline.pm +++ b/IkiWiki/Plugin/sparkline.pm @@ -122,10 +122,10 @@ sub preprocess (@) { # Use the sha1 of the php code that generates the sparkline as # the base for its filename. - eval q{use Digest::SHA1}; + eval q{use Digest::SHA}; error($@) if $@; my $fn=$params{page}."/sparkline-". - IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($php)). + IkiWiki::possibly_foolish_untaint(Digest::SHA::sha1_hex($php)). ".png"; will_render($params{page}, $fn); -- cgit v1.2.3