From b80d0aa456f7ddd5ef4ded01fb9384ecdab04355 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@biblibre.com>
Date: Mon, 27 Apr 2015 13:42:20 +0200
Subject: [PATCH] [PASSED QA] Bug 14066: Remove the Readonly[::XS] dependency
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The Readonly and Readonly::XS package are only used in Koha::Calendar.
IMO the added value of there packages does not justify their purpose.

Test plan:
1/ Remove Readonly and Readonly::XS
2/ Open the calendar and confirm you don't get any error concerning missing
dependency

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 C4/Installer/PerlDependencies.pm | 10 ----------
 Koha/Calendar.pm                 |  5 ++---
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm
index 79cbc14..4b2067e 100644
--- a/C4/Installer/PerlDependencies.pm
+++ b/C4/Installer/PerlDependencies.pm
@@ -237,16 +237,6 @@ our $PERL_DEPS = {
         'required' => '1',
         'min_ver'  => '0.08'
     },
-    'Readonly' => {
-        'usage'    => 'Core',
-        'required' => '1',
-        'min_ver'  => '1.03'
-    },
-    'Readonly::XS' => {
-        'usage'    => 'Core',
-        'required' => '0',
-        'min_ver'  => '1.02'
-    },
     'Graphics::Magick' => {
         'usage'    => 'Patron Card Creator Feature',
         'required' => '0',
diff --git a/Koha/Calendar.pm b/Koha/Calendar.pm
index 6013a25..451c6a3 100644
--- a/Koha/Calendar.pm
+++ b/Koha/Calendar.pm
@@ -8,7 +8,6 @@ use DateTime::Set;
 use DateTime::Duration;
 use C4::Context;
 use Carp;
-use Readonly;
 
 sub new {
     my ( $classname, %options ) = @_;
@@ -34,7 +33,7 @@ sub _init {
     );
     $weekly_closed_days_sth->execute( $branch );
     $self->{weekly_closed_days} = [ 0, 0, 0, 0, 0, 0, 0 ];
-    Readonly::Scalar my $sunday => 7;
+    my $sunday => 7;
     while ( my $tuple = $weekly_closed_days_sth->fetchrow_hashref ) {
         $self->{weekly_closed_days}->[ $tuple->{weekday} ] = 1;
     }
@@ -127,7 +126,7 @@ sub addDate {
 
     if ( $unit eq 'hours' ) {
         # Fixed for legacy support. Should be set as a branch parameter
-        Readonly::Scalar my $return_by_hour => 10;
+        my $return_by_hour => 10;
 
         $dt = $self->addHours($startdate, $add_duration, $return_by_hour);
     } else {
-- 
1.9.1