RTx::Calendar bug and accompanying patch?

Hi,

I’ve just installed RTx::Calendar on a Debian Wheezy box using the
Debian packeged Digest::SHA perl module.
When I select the preferences link the module complains it is unable to
find the Digest::SHA1 module.

The following patch fixes the issue:

— a/html/Prefs/Calendar.html
+++ b/html/Prefs/Calendar.html
@@ -99,7 +99,13 @@ href="<%$RT::WebPath . ‘/Search/Build.html’%>">the
Query Builder
</&>

<%INIT>
-use Digest::SHA1;
+# Patch for Debian Wheezy modules
+# Attempt to load module SHA1 else try SHA
+if (eval {require Digest::SHA1;1;} ne 1) {
+} else {
+Digest::SHA->import();
+}
use RT::SavedSearches;

my $title = loc(“Calendar Prefs”);

Best Regards

Martin Wheldon
Greenhills IT Ltd.

Greenhills IT Ltd. is a limited company registered in England and
Wales.
Company Registration No: 06387214
Registered Offices: 2 Greenhills, Claxton, YORK, North Yorkshire, YO60
7SA

Hi,

I’ve just installed RTx::Calendar on a Debian Wheezy box using the
Debian packeged Digest::SHA perl module.
When I select the preferences link the module complains it is unable to
find the Digest::SHA1 module.

The Makefile.PL for RTx::Calendar specifies a dependency on
Digest::SHA1. Trying to satisfy it with Digest::SHA and getting a
failure is not a bug.

Debian decided to aggressively drop Digest::SHA1 from their packages.
You’ll need to install it from CPAN or continue to use a local patch to
switch RTx::Calendar to Digest::SHA. Many Perl packages Debian provides
are modified by them at install time to s/Digest::SHA1/Digest::SHA/g.

Since Debian is forcing folks’ hands on this, the RTx::Calendar dep
should just get changed to Digest::SHA instead of attempting to load it
completely undeclared after ::SHA1 fails.

Hi Thomas,

Hi,

I’ve just installed RTx::Calendar on a Debian Wheezy box using the
Debian packeged Digest::SHA perl module.
When I select the preferences link the module complains it is unable
to
find the Digest::SHA1 module.

The Makefile.PL for RTx::Calendar specifies a dependency on
Digest::SHA1. Trying to satisfy it with Digest::SHA and getting a
failure is not a bug.

Sorry, I haven’t made myself clear, applying the patch works around the
bug from what I can see
and the RTx::Calendar plugin works.

Debian decided to aggressively drop Digest::SHA1 from their packages.
You’ll need to install it from CPAN or continue to use a local patch
to
switch RTx::Calendar to Digest::SHA. Many Perl packages Debian
provides
are modified by them at install time to s/Digest::SHA1/Digest::SHA/g.

Since Debian is forcing folks’ hands on this, the RTx::Calendar dep
should just get changed to Digest::SHA instead of attempting to load
it
completely undeclared after ::SHA1 fails.

Completely agree. I’ve just removed the RTx::Calendars dependency on
Digest::SHA1 please see below.

diff --git a/Makefile.PL b/Makefile.PL
index e2d9432…003724d 100644
— a/Makefile.PL
+++ b/Makefile.PL
@@ -10,6 +10,7 @@ requires ‘DateTime’ => 0;
requires ‘DateTime::Set’ => 0;
requires ‘Data::ICal’ => 0;
requires ‘Date::ICal’ => 0;
+requires ‘Digest::SHA’ => 0;

no_index(package => ‘RT::Interface::Web::Menu’);

diff --git a/html/Prefs/Calendar.html b/html/Prefs/Calendar.html
index 2cf5d92…76ca3b6 100644
— a/html/Prefs/Calendar.html
+++ b/html/Prefs/Calendar.html
@@ -99,7 +99,7 @@ href=“<%$RT::WebPath . ‘/Search/Build.html’%>”>the
Query Builder
</&>

<%INIT>
-use Digest::SHA1;
+use Digest::SHA;
use RT::SavedSearches;

my $title = loc(“Calendar Prefs”);
@@ -118,7 +118,7 @@ if ($HiddenField && $HiddenField eq ‘Private’) {
}

if (defined $ChangeURL) {

  • my @args = $object->SetAttribute(Name => ‘ICalURL’, Content =>
    Digest::SHA1::sha1_base64(time));
  • my @args = $object->SetAttribute(Name => ‘ICalURL’, Content =>
    Digest::SHA::sha1_base64(time));
    } elsif (defined $ResetURL) {
    my @args = $object->DeleteAttribute(‘ICalURL’);
    }

Best Regards

Martin

Completely agree. I’ve just removed the RTx::Calendars dependency on
Digest::SHA1 please see below.

Yep, that’s pretty much what I just applied and pushed. It should be
getting indexed on CPAN shortly (missing perms myself), but you can grab
the 0.15 tarball here:
http://cpan.metacpan.org/authors/id/T/TS/TSIBLEY/RTx-Calendar-0.15.tar.gz

Hi Thomas,

Many thanks.

MartinOn 2013-04-23 20:55, Thomas Sibley wrote:

On 04/23/2013 12:18 PM, Martin Wheldon wrote:

Completely agree. I’ve just removed the RTx::Calendars dependency on
Digest::SHA1 please see below.

Yep, that’s pretty much what I just applied and pushed. It should be
getting indexed on CPAN shortly (missing perms myself), but you can
grab
the 0.15 tarball here:

http://cpan.metacpan.org/authors/id/T/TS/TSIBLEY/RTx-Calendar-0.15.tar.gz

!DSPAM:9,5176e83533231294615937!