Bugzilla – Attachment 13435 Details for
Bug 7167
updatedatabase improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7167: We want to execute non-numeric version with the -all option
Bug-7167-We-want-to-execute-non-numeric-version-wi.patch (text/plain), 2.03 KB, created by
Chris Nighswonger
on 2012-11-13 16:01:41 UTC
(
hide
)
Description:
Bug 7167: We want to execute non-numeric version with the -all option
Filename:
MIME Type:
Creator:
Chris Nighswonger
Created:
2012-11-13 16:01:41 UTC
Size:
2.03 KB
patch
obsolete
>From e85c702ebf27b3ff1e0f22bd5169a5359054cf5e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 31 Jul 2012 16:57:13 +0200 >Subject: [PATCH] Bug 7167: We want to execute non-numeric version with the > -all option >Content-Type: text/plain; charset="utf-8" > >Dealing with Marcel comment 100: >> Note that the current code around line 52/53 does not >> handle that correctly: >> Argument "\x{74}\x{65}..." isn't numeric in numeric ge (>=) at >> installer/data/mysql/update.pl line 52. > >Now, a non-numeric DBRev will be applied if you provide the --all parameter, without throwing the error > >Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> >--- > C4/Update/Database.pm | 1 + > misc/bin/updatedb.pl | 5 ++++- > 2 files changed, 5 insertions(+), 1 deletion(-) > mode change 100644 => 100755 misc/bin/updatedb.pl > >diff --git a/C4/Update/Database.pm b/C4/Update/Database.pm >index c9c180e..78c5fb3 100644 >--- a/C4/Update/Database.pm >+++ b/C4/Update/Database.pm >@@ -515,6 +515,7 @@ sub TransformToNum { > > sub SetVersion { > my $new_version = TransformToNum(shift); >+ return unless $new_version =~ /\d\.\d+/; > my $current_version = TransformToNum( C4::Context->preference('Version') ); > unless ( C4::Context->preference('Version') ) { > my $finish = $dbh->prepare(qq{ >diff --git a/misc/bin/updatedb.pl b/misc/bin/updatedb.pl >old mode 100644 >new mode 100755 >index b79d1b4..8b613ec >--- a/misc/bin/updatedb.pl >+++ b/misc/bin/updatedb.pl >@@ -73,8 +73,11 @@ if ($all) { > : 0; > > for my $v (@$versions_available) { >+ # We execute ALL versions where version number >= min_version >+ # OR version is not a number > if ( not grep { $v eq $_->{version} } @$versions >- and C4::Update::Database::TransformToNum($v) >= $min_version ) >+ and ( not $v =~ /\d\.\d{2}\.\d{2}\.\d{3}/ or >+ C4::Update::Database::TransformToNum($v) >= $min_version ) ) > { > my $report = C4::Update::Database::execute_version $v; > push @reports, $report; >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7167
:
6377
|
6378
|
6379
|
6381
|
6414
|
6415
|
6416
|
6476
|
6477
|
6478
|
6479
|
6722
|
6832
|
7903
|
8178
|
9859
|
9860
|
9861
|
9862
|
10033
|
10034
|
10549
|
10666
|
10667
|
10668
|
10825
|
11129
|
11222
|
11223
|
11224
|
11225
|
11226
|
11227
|
11228
|
11229
|
11230
|
11231
|
11232
|
11235
|
11236
|
11237
|
11238
|
11239
|
11240
|
11241
|
11242
|
11243
|
11244
|
11245
|
11246
|
11571
|
13423
|
13424
|
13425
|
13426
|
13427
|
13428
|
13429
|
13430
|
13431
|
13432
|
13433
|
13434
|
13435
|
13436
|
13437
|
13456
|
13457
|
13509
|
13516
|
13517
|
13518
|
13519
|
13520
|
13521
|
13522
|
13523
|
13524
|
13525
|
13526
|
13527
|
13528
|
13529
|
13733
|
13734
|
13842
|
13845
|
13848
|
13851
|
13852
|
13853
|
13854
|
14310
|
16113
|
16114
|
16115
|
16116
|
16117
|
16596