Bug 5617

Summary: fix-perl-path.pl misses some files
Product: Koha Reporter: Jason Sherman <jsn.sherman>
Component: Installation and upgrade (command-line installer)Assignee: Galen Charlton <gmcharlt>
Status: CLOSED WONTFIX QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: P5 - low CC: bgkriegel, dcook, jonathan.druart, nick, robin, tomascohen
Version: Main   
Hardware: All   
OS: Linux   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 5617: Fix existing wrong shebangs
Bug 5617: Use /usr/bin/env perl for **/*.pl scripts
Bug 5617: Use /usr/bin/env perl for all other occurrences
Bug 5617: Remove useless script fix-perl-path.PL

Description Jason Sherman 2011-01-13 17:30:43 UTC
When upgrading from 3.0.6 to 3.2.01 (on Ubuntu 8.04), I found that I needed to roll my own perl.  Upon running the upgrade, I found that fix-per-path.pl left the system perl shebang line on the following files:

/usr/share/koha/intranet/cgi-bin/admin/aqbookfund.pl
/usr/share/koha/intranet/cgi-bin/admin/aqbudget.pl
/usr/share/koha/intranet/cgi-bin/labels/label-profiles.pl
/usr/share/koha/intranet/cgi-bin/labels/label-manager.pl
/usr/share/koha/intranet/cgi-bin/labels/pcard-member-search.pl
/usr/share/koha/intranet/cgi-bin/labels/label-save-template.pl
/usr/share/koha/intranet/cgi-bin/labels/label-templates.pl
/usr/share/koha/intranet/cgi-bin/labels/label-create-profile.pl
/usr/share/koha/intranet/cgi-bin/labels/label-create-layout.pl
/usr/share/koha/intranet/cgi-bin/labels/label-print-pdf.pl
/usr/share/koha/intranet/cgi-bin/labels/label-print-csv.pl
/usr/share/koha/intranet/cgi-bin/labels/label-create-template.pl
/usr/share/koha/intranet/cgi-bin/catalogue/recentacquisitions.pl
/usr/share/koha/intranet/cgi-bin/serials/subscription-history.pl
/usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase30.pl
/usr/share/koha/intranet/cgi-bin/suggestion/acceptorreject.pl
/usr/share/koha/intranet/cgi-bin/reports/itemtypes.plugin
/usr/share/koha/intranet/cgi-bin/reports/issues_by_borrower_category.plugin
/usr/share/koha/intranet/cgi-bin/svc/bib
/usr/share/koha/intranet/cgi-bin/svc/new_bib
/usr/share/koha/intranet/cgi-bin/svc/bib_profile
/usr/share/koha/intranet/cgi-bin/svc/config/systempreferences
/usr/share/koha/intranet/cgi-bin/svc/authentication
/usr/share/koha/intranet/cgi-bin/tools/runreport.pl
/usr/share/koha/intranet/cgi-bin/tools/scheduler.pl.bak
/usr/share/koha/intranet/cgi-bin/acqui/spent.pl
/usr/share/koha/intranet/cgi-bin/acqui/bookfund.pl
/usr/share/koha/intranet/cgi-bin/acqui/pdfformat/layout2pages.pm
/usr/share/koha/intranet/cgi-bin/acqui/pdfformat/layout3pages.pm
/usr/share/koha/misc/translator/translate
/usr/share/koha/misc/translator/install.pl
/usr/share/koha/misc/translator/install-code.pl
/usr/share/koha/bin/cronjobs/runreport.pl.bak -w
/usr/share/koha/opac/cgi-bin/opac/unapi
/usr/share/koha/opac/cgi-bin/opac/opac-logout.pl
/usr/share/koha/opac/cgi-bin/opac/sco/abort.pl
/usr/share/koha/opac/cgi-bin/opac/sco/sco-circ.pl
/usr/share/koha/opac/cgi-bin/opac/sco/printer.pl
/usr/share/koha/opac/cgi-bin/opac/opac-recentacquisitions.pl
/usr/share/koha/opac/cgi-bin/opac/opac-detailprint.pl
Comment 1 Galen Charlton 2011-04-05 18:20:39 UTC
A couple things are going on here:

[1] The script only checks files whose extension is .pl.  This is why svc/bib, e.g., was missed.
[2] About half of the scripts in your list (e.g., admin/aqbookfund.pl) were present in 3.0.x but are not present in 3.2.x.  fix-perl-path.PL is usually invoked from the makefile, and also only touches files in the manifest.
Comment 2 Bernardo Gonzalez Kriegel 2012-04-13 01:22:44 UTC
Update: this are the files with system perl shebang not changed by fix-perl-path-pl on newer versions


[master install - 2012-04-12]
bin/maintenance/borrowers-force-messaging-defaults
bin/admin/koha-preferences
intranet/cgi-bin/installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt2 (shebang "#! /usr/bin/perl" with space)
intranet/cgi-bin/installer/data/mysql/atomicupdate/bug_7284_authority_linking_pt1 (shebang "#! /usr/bin/perl" with space)
intranet/cgi-bin/reports/issues_by_borrower_category.plugin
intranet/cgi-bin/reports/itemtypes.plugin
intranet/cgi-bin/acqui/pdfformat/layout2pages.pm
intranet/cgi-bin/acqui/pdfformat/layout3pages.pm
intranet/cgi-bin/svc/authentication
intranet/cgi-bin/svc/new_bib
intranet/cgi-bin/svc/bib_profile
intranet/cgi-bin/svc/import_bib
intranet/cgi-bin/svc/config/systempreferences
intranet/cgi-bin/svc/bib
lib/C4/ShelfBrowser.pm
misc/translator/translate
opac/cgi-bin/opac/unapi

[Koha 3.6.4]
bin/maintenance/borrowers-force-messaging-defaults
bin/admin/koha-preferences
intranet/cgi-bin/reports/issues_by_borrower_category.plugin
intranet/cgi-bin/reports/itemtypes.plugin
intranet/cgi-bin/acqui/pdfformat/layout2pages.pm
intranet/cgi-bin/acqui/pdfformat/layout3pages.pm
intranet/cgi-bin/svc/authentication
intranet/cgi-bin/svc/new_bib
intranet/cgi-bin/svc/bib_profile
intranet/cgi-bin/svc/config/systempreferences
intranet/cgi-bin/svc/bib
lib/C4/ShelfBrowser.pm
misc/translator/translate
opac/cgi-bin/opac/unapi

[Koha 3.4.7]
bin/maintenance/borrowers-force-messaging-defaults
bin/admin/koha-preferences
intranet/cgi-bin/reports/issues_by_borrower_category.plugin
intranet/cgi-bin/reports/itemtypes.plugin
intranet/cgi-bin/acqui/pdfformat/layout2pages.pm
intranet/cgi-bin/acqui/pdfformat/layout3pages.pm
intranet/cgi-bin/svc/authentication
intranet/cgi-bin/svc/new_bib
intranet/cgi-bin/svc/bib_profile
intranet/cgi-bin/svc/config/systempreferences
intranet/cgi-bin/svc/bib
lib/C4/ShelfBrowser.pm
misc/translator/translate
opac/cgi-bin/opac/unapi
Comment 3 Jonathan Druart 2015-03-26 14:49:02 UTC
Created attachment 37275 [details] [review]
Bug 5617: Fix existing wrong shebangs
Comment 4 Jonathan Druart 2015-03-26 14:49:08 UTC
Created attachment 37276 [details] [review]
Bug 5617: Use /usr/bin/env perl for **/*.pl scripts
Comment 5 Jonathan Druart 2015-03-26 14:49:13 UTC
Created attachment 37277 [details] [review]
Bug 5617: Use /usr/bin/env perl for all other occurrences
Comment 6 Jonathan Druart 2015-03-26 14:49:17 UTC
Created attachment 37278 [details] [review]
Bug 5617: Remove useless script fix-perl-path.PL

It's now useless
Comment 7 Jonathan Druart 2015-03-26 14:51:58 UTC
Tomas, Robin,

I thought this one was easy to fix replacing the current shebang with /usr/bin/env perl
But it seems there are a lot of pros and cons (https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/58 for instance).

Could I get your opinion on this?
Comment 8 Robin Sheat 2015-03-26 22:49:17 UTC
(In reply to Jonathan Druart from comment #7)
> Tomas, Robin,
> 
> I thought this one was easy to fix replacing the current shebang with
> /usr/bin/env perl
> But it seems there are a lot of pros and cons
> (https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/58 for
> instance).
> 
> Could I get your opinion on this?

I don't have a strong opinion, but I think we probably shouldn't go with /usr/bin/env based on that thread. If the problem is that fix-perl-path.pl is missing some files, then that should probably be fixed to use file(1) or grep or something to detect what needs to be changed.

Would it be better to have MakeMaker do its thing and let it take care of the problem? In that case, rerunning the install would have sorted it, and I don't think that's too high of a bar when you're dealing with rolling with a custom perl.
Comment 9 Jonathan Druart 2015-03-27 08:30:12 UTC
(In reply to Robin Sheat from comment #8)
> I don't have a strong opinion, but I think we probably shouldn't go with
> /usr/bin/env based on that thread. If the problem is that fix-perl-path.pl
> is missing some files, then that should probably be fixed to use file(1) or
> grep or something to detect what needs to be changed.
> 
> Would it be better to have MakeMaker do its thing and let it take care of
> the problem? In that case, rerunning the install would have sorted it, and I
> don't think that's too high of a bar when you're dealing with rolling with a
> custom perl.

Ok thanks.
I don't know if it is worth spending time on it, nobody has reported this problem.
Comment 10 Nick Clemens 2019-06-11 13:08:56 UTC
Closing this one, seems to be no longer an issue?
Comment 11 David Cook 2020-10-16 03:18:27 UTC
This one is interesting in terms of deciding what's the correct shebang and how well Koha may work in "virtual environments". 

As we move away from CGI, this becomes less important.