From 66aaf86644c2e2d649a2fc1a7074cef577eefa70 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 2 Sep 2014 12:56:23 +0800 Subject: Bug 1056162: add bit.ly support to bmo --- extensions/Bitly/Config.pm | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'extensions/Bitly') diff --git a/extensions/Bitly/Config.pm b/extensions/Bitly/Config.pm index 0c834eed2..aff9d4b4b 100644 --- a/extensions/Bitly/Config.pm +++ b/extensions/Bitly/Config.pm @@ -8,14 +8,32 @@ package Bugzilla::Extension::Bitly; use strict; +use Bugzilla::Install::Util qw(vers_cmp); + use constant NAME => 'Bitly'; -use constant REQUIRED_MODULES => [ - { - package => 'LWP-Protocol-https', - module => 'LWP::Protocol::https', - version => 0 - }, -]; + +sub REQUIRED_MODULES { + my @required; + push @required, { + package => 'LWP', + module => 'LWP', + version => 5, + }; + # LWP 6 split https support into a separate package + if (Bugzilla::Install::Requirements::have_vers({ + package => 'LWP', + module => 'LWP', + version => 6, + })) { + push @required, { + package => 'LWP-Protocol-https', + module => 'LWP::Protocol::https', + version => 0 + }; + } + return \@required; +} + use constant OPTIONAL_MODULES => [ { package => 'Mozilla-CA', -- cgit v1.2.3-24-g4f1b