If we use eval instead of do for our .perl atomic update files, it will allow developers to put in the exact code that should go into updatedatabase.pl. The problem with do is that none of the variables defined in updatadatabase.pl are available, whereas with eval they are.
Created attachment 52132 [details] [review] Bug 16685 - Use eval instead of do for .perl atomicupdates If we use eval instead of do for our .perl atomic update files, it will allow developers to put in the exact code that should go into updatedatabase.pl. The problem with do is that none of the variables defined in updatadatabase.pl are available, whereas with eval they are. Test Plan: 1) Apply this patch 2) Create a .perl file in atomicupdates with the following in it: say "DBversion: $DBversion"; 3) Run updatadatabase.pl 4) Note the output 5) Add a syntax error to your atomic update 6) Run updatedatabase.pl 7) Note the error is displayed
I remember Jonathan saying that File::Slurp was 'bad'. It the same time, I can see it in several place, and recently added with Edifact. http://blogs.perl.org/users/leon_timmermans/2015/08/fileslurp-is-broken-and-wrong.html Path::Tiny is generally regarded as a better alternative.
Created attachment 52901 [details] [review] Bug 16685 - Use eval instead of do for .perl atomicupdates If we use eval instead of do for our .perl atomic update files, it will allow developers to put in the exact code that should go into updatedatabase.pl. The problem with do is that none of the variables defined in updatadatabase.pl are available, whereas with eval they are. Test Plan: 1) Apply this patch 2) Create a .perl file in atomicupdates with the following in it: say "DBversion: $DBversion"; 3) Run updatadatabase.pl 4) Note the output 5) Add a syntax error to your atomic update 6) Run updatedatabase.pl 7) Note the error is displayed
Created attachment 52902 [details] [review] Bug 16685 [QA Followup] - Use Path::Tiny::slurp instead of File::Slurp File::Slurp is considered better to use than File::Slurp. RM Note: The package version in wheezy is too old, the package version in jessie is just fine and should be added to the community repo if wheezy will be supported for the coming release.
Nice one Kyle, can u please rebase? I'd put the new dep somewhere alphabetically. Is it packaged already?
Created attachment 54540 [details] [review] Bug 16685 [QA Followup] - Use Path::Tiny::slurp instead of File::Slurp File::Slurp is considered better to use than File::Slurp. RM Note: The package version in wheezy is too old, the package version in jessie is just fine and should be added to the community repo if wheezy will be supported for the coming release.
Created attachment 54541 [details] [review] Bug 16685 [QA Followup] - Use Path::Tiny::slurp instead of File::Slurp File::Slurp is considered better to use than File::Slurp. RM Note: The package version in wheezy is too old, the package version in jessie is just fine and should be added to the community repo if wheezy will be supported for the coming release.
Rebased. Kitten saved.
Created attachment 54729 [details] [review] [SIGNED-OFF] Bug 16685 - Use eval instead of do for .perl atomicupdates If we use eval instead of do for our .perl atomic update files, it will allow developers to put in the exact code that should go into updatedatabase.pl. The problem with do is that none of the variables defined in updatadatabase.pl are available, whereas with eval they are. Test Plan: 1) Apply this patch 2) Create a .perl file in atomicupdates with the following in it: say "DBversion: $DBversion"; 3) Run updatadatabase.pl 4) Note the output 5) Add a syntax error to your atomic update 6) Run updatedatabase.pl 7) Note the error is displayed Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Created attachment 54730 [details] [review] [SIGNED-OFF] Bug 16685 [QA Followup] - Use Path::Tiny::slurp instead of File::Slurp File::Slurp is considered better to use than File::Slurp. RM Note: The package version in wheezy is too old, the package version in jessie is just fine and should be added to the community repo if wheezy will be supported for the coming release. Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Created attachment 54758 [details] [review] Bug 16685 - Use eval instead of do for .perl atomicupdates If we use eval instead of do for our .perl atomic update files, it will allow developers to put in the exact code that should go into updatedatabase.pl. The problem with do is that none of the variables defined in updatadatabase.pl are available, whereas with eval they are. Test Plan: 1) Apply this patch 2) Create a .perl file in atomicupdates with the following in it: say "DBversion: $DBversion"; 3) Run updatadatabase.pl 4) Note the output 5) Add a syntax error to your atomic update 6) Run updatedatabase.pl 7) Note the error is displayed Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 54759 [details] [review] Bug 16685 [QA Followup] - Use Path::Tiny::slurp instead of File::Slurp File::Slurp is considered better to use than File::Slurp. RM Note: The package version in wheezy is too old, the package version in jessie is just fine and should be added to the community repo if wheezy will be supported for the coming release. Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 16.11!
Created attachment 56219 [details] [review] Bug 16685 Path::Tiny Control file update (master)
Comment on attachment 56219 [details] [review] Bug 16685 Path::Tiny Control file update (master) Moving the control file patch to another bug
(In reply to Jonathan Druart from comment #12) > RM Note: The package version in wheezy is too old, the package version > in jessie is just fine and should be added to the community > repo if wheezy will be supported for the coming release. Wheezy will not be supported by 16.11.
This patchset breaks DB update on kohadevbox, see bug 17666