The script queries for the 'Installed:' string, which only appears on english setups.
Created attachment 12566 [details] [review] Bug 8840 - ubuntu-pkg-check.sh script doesn't work on non englush setups Using dpkg -s to query for installed packages works in languages other than english. Added some switches (and checks for them) too. Sponsored-by: Universidad Nacional de Córdoba
Created attachment 12594 [details] [review] Bug 8840 - ubuntu-pkg-check.sh script doesn't work on non english setups Using dpkg to query for installed packages works in languages other than english. Added some switches to conveniently display the needed apt-get command for installing Koha's dependencies: -r | --report Report the status of Koha's dependencies -ic | --install-command Display the install command for the missing dependencies -h | --help Display this help message Regards To+ Sponsored-by: Universidad Nacional de Córdoba
Created attachment 12599 [details] [review] Replaced ubuntu-pkg-check.sh with one that works properly. Test ------ Prove The Problem ================= 1) Fresh install of Ubuntu 12.04 (Spanish) 2) ./install_misc/ubuntu-pkg-check.sh -- This is to get the base output to compare. 3) sudo apt-get install libyaml-perl 4) ./install_misc/ubuntu-pkg-check.sh -- Identical output, even though we installed a dependency! 5) apply patch 6) ./install_misc/ubuntu-packages.sh -r -- Should be one line difference now! 5) Fresh install of Ubuntu 12.04 (English) 6) ./install_misc/ubuntu-pkg-check.sh -- Indentical to first output, no dependencies installed yet. 7) sudo apt-get install libyaml-perl 8) ./install_misc/ubuntu-pkg-check.sh -- It should match the one line difference output. 9) apply patch 10) ./install_misc/ubuntu-packages.sh -r -- It should match the one line difference output. Test New Features (Help) ======================== 11) ./install_misc/ubuntu-packages.sh -h 12) echo $? -- It should give a nice help screen. And the echo result of 0. 13) ./install_misc/ubuntu-packages.sh 14) echo $? -- It should give a nice help screen. And the echo result of 1 -- based you gave incorrect parameters. 15) ./install_misc/ubuntu-packages.sh -badparm 16) echo $? -- It should give a nice help screen. And the echo result of 1 -- based you gave incorrect parameters. Test New Features (Sudo apt-get command output) =============================================== 17) ./install_misc/ubuntu-packages.sh -ic -- It should output an appropriate sudo apt-get command to install the dependencies. 18) Cut and paste the command, then press enter! -- install everything! 19) ./install_misc/ubuntu-packages.sh -ic -- It should say it thinks everything is installed, and tell you to run a koha_perl_deps.pl -m -u. -- Yes, koha_perl_deps.pl may list outstanding items. That's a different bug report to come.
Revised/Clarified Test Plan --------------------------- Prove The Problem ================= 1) Fresh install of Ubuntu 12.04 (Spanish) 2) ./install_misc/ubuntu-pkg-check.sh -- This is to get the base output to compare. -- a whole bunch of library name = none. 3) sudo apt-get install libyaml-perl 4) ./install_misc/ubuntu-pkg-check.sh -- Identical output, even though we installed a dependency! 5) apply patch 6) ./install_misc/ubuntu-packages.sh -r -- libyaml-perl should show the correct version number. 7) Fresh install of Ubuntu 12.04 (English) 8) ./install_misc/ubuntu-pkg-check.sh -- Indentical to first output, no dependencies installed yet. 9) sudo apt-get install libyaml-perl 10) ./install_misc/ubuntu-pkg-check.sh -- libyaml-perl should show the correct version number. 11) apply patch 12) ./install_misc/ubuntu-packages.sh -r -- libyaml-perl should show the correct version number. Test New Features (Help) ======================== 13) ./install_misc/ubuntu-packages.sh -h 14) echo $? -- It should give a nice help screen. And the echo result of 0. 15) ./install_misc/ubuntu-packages.sh 16) echo $? -- It should give a nice help screen. And the echo result of 1 -- based you gave incorrect parameters. 17) ./install_misc/ubuntu-packages.sh -badparm 18) echo $? -- It should give a nice help screen. And the echo result of 1 -- based you gave incorrect parameters. Test New Features (Sudo apt-get command output) =============================================== 19) ./install_misc/ubuntu-packages.sh -ic -- It should output an appropriate sudo apt-get command to install the dependencies. 20) Cut and paste the command, then press enter! -- install everything! 21) ./install_misc/ubuntu-packages.sh -ic -- It should say it thinks everything is installed, and tell you to run a koha_perl_deps.pl -m -u.
Created attachment 12610 [details] [review] Bug 8840 - ubuntu-pkg-check.sh fix and extend functionality First, reworked it into a newer script with parameters: ubuntu-packages.sh -r This will generate output identical to the old script, except that it is fixed for non-english setups. ubuntu-packages.sh -h This adds a brief help, which all scripts should have. ubuntu-packages.sh -ic This helps handle a multi-arch problem by printing out a relevant command for installing missing dependencies.
I just noticed a minor typo in the comments. "dor" instead of "dot". I'll let you fix it, Tomás. And don't forget to set the status to "Needs Signoff" when you do. I don't think either of us should sign it off, since we both worked on this.
Created attachment 12613 [details] [review] Bug 8840 - ubuntu-pkg-check.sh fix and extend functionality Fixed a problem with package queries. First, reworked it into a newer script with parameters: ubuntu-packages.sh -r This will generate output identical to the old script, except that it is fixed for non-english setups. ubuntu-packages.sh -h This adds a brief help, which all scripts should have. ubuntu-packages.sh -ic This helps handle a multi-arch problem by printing out a relevant command for installing missing dependencies.
Created attachment 13200 [details] [review] Bug 8840 - ubuntu-pkg-check.sh fix and extend functionality First, reworked it into a newer script with parameters: ubuntu-packages.sh -r This will generate output identical to the old script, except that it is fixed for non-english setups. ubuntu-packages.sh -h This adds a brief help, which all scripts should have. ubuntu-packages.sh -ic This helps handle a multi-arch problem by printing out a relevant command for installing missing dependencies. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Hi Tomas, I looked into your patch, testing on an Ubuntu 12.04 installation in German. -h -r and -ic seem to work nicely. On my system all dependencies were installed, so I took a look at the ubuntu.12.04.packages file and picked something to remove it. 'sudo apt-get remove libyaml-perl' After this step ./koha_perl_deps.pl -c -a reports missing packages: Test::YAML::Valid 0 0.04 No YAML 0 0.71 Yes Next I ran your script: ./install_misc/ubuntu-packages.sh -ic # Using the ./install_misc/ubuntu.12.04.packages file as source #............................................................................................................................................ # All dependencies installed! # Please confirm the version numbers are sufficient # By running koha_perl_deps.pl -m -u. So it doesn't seem to detect the missing package? Maybe I am doing something wrong, please take a look at the patch and my test plan.
Greetings, Your testplan is flawed in that you didn't confirm there were no missing discrepancies between CheckDependencies.pm and the ubuntu[.blah].packages file. This patch should generate identical perl library output as koha_perl_deps *IF* all the perl dependencies listed in CheckDependencies.pm are also listed in the .packages file. Sadly, you can't just count, because sometimes multiple libraries are contained in a single package. For example, Blah::Blah might also be in Blah's libBlah-perl package. And the .packages files (ubuntu.12.04.packages and ubuntu.packages) should generally be identical, though I could see ubuntu.packages being larger as it also may have to deal with older installations. Though, I think we've been lazy and just copying the latest .packages file to it. :) What you have stumbled upon is the installation mess that needs cleaning up, and this is a tiny step towards it. GPML...
Created attachment 14171 [details] [review] Tweak to patch to solve false "All dependencies installed!" I re-read the code and noticed that it was not accumulating MISSING_PATCHES. I was also concerned that perhaps the != might not work properly. This needs to be applied on top of the other patch. Test Plan --------- 1) Installed perl libraries nicely for a git install. 2) ./koha_perl_deps.pl -m -u Only lists Data::Pagination missing and String::Random too low version. 3) sudo apt-get remove libyaml-syck-perl Triggers removal of yaml syck and date manip. 4) ./koha_perl_deps.pl -m -u Now four things listed. 5) ~/kohaclone/install_misc$ ./ubuntu-packages.sh -ic # Using the ./ubuntu.12.04.packages file as source #............................................................................................................................................ # Copy and paste the following command to install all Koha's dependencies on your system: # Note: this command will run with admin privileges. Make sure your user has sudo rights sudo apt-get install libyaml-syck-perl libdate-manip-perl 6) be happy that this is what was removed and needs to be added.
Created attachment 14176 [details] [review] Fix and extend script functionality Patch 1/2
Created attachment 14177 [details] [review] Correct incorrect reporting
This is almost signed.
After applying the patches, I get: $ perl koha_perl_deps.pl -m -u Installed Required Module is Module Name Version Version Required -------------------------------------------------------------------------------------------- CHI 0 * 0.36 No CHI::Driver::Memcached 0 * 0.12 No Data::Pagination 0 * 0.44 No -------------------------------------------------------------------------------------------- Total modules reported: 3 * Module is missing or requires an upgrade. $ ./install_misc/ubuntu-packages.sh -ic # Using the ./install_misc/ubuntu.12.04.packages file as source #............................................................................................................................................ # Copy and paste the following command to install all Koha's dependencies on your system: # Note: this command will run with admin privileges. Make sure your user has sudo rights sudo apt-get install libchi-perl libchi-driver-memcached-perl So the two tools agree on CHI and CHI::Driver::Memcached, but ubuntu-packages.sh does not pick up the missing Data::Pagination. As this dependency is not listed in ubuntu.12.04.packages this is actually to be expected, and as far as I understand, fixing the lists of dependencies is beyond the scope of this bug. ubuntu-packages.sh -h gives the help message ubuntu-packages.sh -r prints dependencies and versions As far as I can tell ubuntu-packages.sh does what it is supposed to do so I'll sign off.
Created attachment 16539 [details] [review] Bug 8840 - [SIGNED-OFF] ubuntu-pkg-check.sh fix and extend functionality First, reworked it into a newer script with parameters: ubuntu-packages.sh -r This will generate output identical to the old script, except that it is fixed for non-english setups. ubuntu-packages.sh -h This adds a brief help, which all scripts should have. ubuntu-packages.sh -ic This helps handle a multi-arch problem by printing out a relevant command for installing missing dependencies. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Works as advertised, see Bugzilla for details.
Created attachment 16540 [details] [review] Bug 8840 - [SIGNED-OFF] Patch to solve false "All dependencies installed!" Reordered logic to accumulate MISSING_PATCHES variable and tweak condition to be certain it was not failing. Signed-off-by: Magnus Enger <magnus@enger.priv.no> Works as advertised, see Bugzilla for details.
Created attachment 18096 [details] [review] Bug 8840 - [SIGNED-OFF] ubuntu-pkg-check.sh fix and extend functionality First, reworked it into a newer script with parameters: ubuntu-packages.sh -r This will generate output identical to the old script, except that it is fixed for non-english setups. ubuntu-packages.sh -h This adds a brief help, which all scripts should have. ubuntu-packages.sh -ic This helps handle a multi-arch problem by printing out a relevant command for installing missing dependencies. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Works as advertised, see Bugzilla for details.
Created attachment 18097 [details] [review] [PASSED QA] Bug 8840 - [SIGNED-OFF] Patch to solve false "All dependencies installed!" Reordered logic to accumulate MISSING_PATCHES variable and tweak condition to be certain it was not failing. Signed-off-by: Magnus Enger <magnus@enger.priv.no> Works as advertised, see Bugzilla for details. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This patch has been pushed to master and 3.12.x.