From 4aeb28a00cb060d1bc4419417d7a3e2b524f385a Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@biblibre.com>
Date: Tue, 31 Jul 2012 09:50:14 +0200
Subject: [PATCH] Bug 7167: Reimplementing Marcel's suggestions & fixes

 * Fixing the bugguy old version check (that was made against 3.0900000 instead of 3.0900027 -the last current kohaversion number
 * in the CLI script, if there is nothing to report, just say it

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
---
 C4/Auth.pm                     |    2 +-
 installer/data/mysql/update.pl |    2 +-
 installer/install.pl           |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/C4/Auth.pm b/C4/Auth.pm
index c23e87c..62479cf 100644
--- a/C4/Auth.pm
+++ b/C4/Auth.pm
@@ -587,7 +587,7 @@ sub version_check {
     }
 
     # check if you're uptodate, and if you're not, head to updater
-    my $koha39 =~ "3.0900000";
+    my $koha39 = "3.0900028";
 
     # Old updatedatabase method
     if (C4::Context->preference('Version') < $koha39) {
diff --git a/installer/data/mysql/update.pl b/installer/data/mysql/update.pl
index e8dac36..605fe6c 100644
--- a/installer/data/mysql/update.pl
+++ b/installer/data/mysql/update.pl
@@ -59,7 +59,7 @@ if ( $all ) {
 }
 
 if ( $version or $all ) {
-    say "Report:";
+    say @reports ? "Report:": "Nothing to report";
     for my $report ( @reports ) {
         my ( $v, $r ) = each %$report;
         if ( ref( $r ) eq 'HASH' ) {
diff --git a/installer/install.pl b/installer/install.pl
index 7a6849a..6b97cba 100755
--- a/installer/install.pl
+++ b/installer/install.pl
@@ -321,7 +321,7 @@ elsif ( $step && $step == 3 ) {
         warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n";
     }
 
-        my $koha39 =~ "3.0900000";
+        my $koha39 = "3.0900028";
         my $cmd;
         # Old updatedatabase method
         my $current_version = C4::Context->preference('Version');
@@ -329,7 +329,7 @@ elsif ( $step && $step == 3 ) {
             $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl";
             my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0);
             print_std( "updatedatabase.pl", $stdout_buf, $stderr_buf );
-
+            $current_version= $koha39;
         }
         $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/update.pl -all -min=$current_version";
         my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0);
-- 
1.7.9.5