Bugzilla – Attachment 160447 Details for
Bug 35681
Add support for colored messages in the output of updatedatabase
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35681: [TEST ONLY]: This is a dummy dbrev to force an update
Bug-35681-TEST-ONLY-This-is-a-dummy-dbrev-to-force.patch (text/plain), 3.55 KB, created by
Pedro Amorim
on 2024-01-03 10:32:45 UTC
(
hide
)
Description:
Bug 35681: [TEST ONLY]: This is a dummy dbrev to force an update
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-01-03 10:32:45 UTC
Size:
3.55 KB
patch
obsolete
>From 200cc8292020cc4495dc161277f575fc0ecb9bfc Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 2 Jan 2024 15:57:31 +0000 >Subject: [PATCH] Bug 35681: [TEST ONLY]: This is a dummy dbrev to force an > update > >This patch adds an atomic update file and also an equivilent db_rev and >increments the Koha.pm version too. > >Use it to test the output of updatedatebase, run via console or via the >browser. > >Test plan >1) Start KTD without the patches applied. >2) Apply this test patch >3) Run the detabase updates via the console and confirm it looks > reasonable and is colored. >4) Reset the database version in ktd > `koha-mysql kohadev` > `UPDATE systempreferences SET value = '23.1200002';` >5) Run the database updates via the browser; > `http://localhost:8081/cgi-bin/koha/installer/install.pl?step=3&op=updatestructure` >6) Confirm the presence of weird looking escape characters on screen. >7) Apply the next patch and run through steps 3 to 5 again, this time > confirming the browser output looks good. > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > Koha.pm | 2 +- > installer/data/mysql/atomicupdate/bug_35681.pl | 18 ++++++++++++++++++ > installer/data/mysql/db_revs/231200003.pl | 18 ++++++++++++++++++ > 3 files changed, 37 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_35681.pl > create mode 100755 installer/data/mysql/db_revs/231200003.pl > >diff --git a/Koha.pm b/Koha.pm >index acb0ca9ab9..d904cde577 100644 >--- a/Koha.pm >+++ b/Koha.pm >@@ -29,7 +29,7 @@ use vars qw{ $VERSION }; > # - #4 : the developer version. The 4th number is the database subversion. > # used by developers when the database changes. updatedatabase take care of the changes itself > # and is automatically called by Auth.pm when needed. >-$VERSION = "23.12.00.002"; >+$VERSION = "23.12.00.003"; > > sub version { > return $VERSION; >diff --git a/installer/data/mysql/atomicupdate/bug_35681.pl b/installer/data/mysql/atomicupdate/bug_35681.pl >new file mode 100755 >index 0000000000..12b71b7828 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_35681.pl >@@ -0,0 +1,18 @@ >+use Modern::Perl; >+ >+use Term::ANSIColor; >+ >+return { >+ bug_number => "35681", >+ description => "Test Atomic update output", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ say $out colored("Something in red is a warning", 'red'); >+ say $out colored("Somthing in yellow is a call to action", 'yellow'); >+ say $out colored("Something in blue is for information only", 'blue'); >+ say $out colored("You could use 'WHITE' too?", 'white'); >+ say $out "Or leave color off and stick to default"; >+ }, >+}; >diff --git a/installer/data/mysql/db_revs/231200003.pl b/installer/data/mysql/db_revs/231200003.pl >new file mode 100755 >index 0000000000..90a7a9908e >--- /dev/null >+++ b/installer/data/mysql/db_revs/231200003.pl >@@ -0,0 +1,18 @@ >+use Modern::Perl; >+ >+use Term::ANSIColor; >+ >+return { >+ bug_number => "35681", >+ description => "Test DB Rev output", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ say $out colored("Something in red is a warning", 'red'); >+ say $out colored("Somthing in yellow is a call to action", 'yellow'); >+ say $out colored("Something in blue is for information only", 'blue'); >+ say $out colored("You could use 'WHITE' too?", 'white'); >+ say $out "Or leave color off and stick to default"; >+ }, >+}; >-- >2.30.2
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 35681
:
160439
|
160440
|
160443
|
160444
|
160445
|
160447
|
160448
|
160449
|
160473
|
160503
|
160504
|
160505
|
160506
|
160750
|
160751
|
160772
|
164903
|
164904
|
164905
|
164906
|
164907
|
164908
|
164909
|
164942
|
164943
|
164944
|
164945
|
164946
|
164947
|
164948
|
164949