[Bug 26673] New: Remove Perl shebangs from Perl modules
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Bug ID: 26673 Summary: Remove Perl shebangs from Perl modules Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org I've noticed a number of Perl modules have shebangs in them. Unless there is a good reason for them to be there, they should be removed. Examples: C4/Barcodes/ValueBuilder.pm C4/SIP/Logger.pm C4/SIP/SIPServer.pm C4/ShelfBrowser.pm Koha/Z3950Responder.pm Koha/Z3950Responder/GenericSession.pm Koha/Z3950Responder/RPN.pm Koha/Z3950Responder/Session.pm Koha/Z3950Responder/ZebraSession.pm -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 111584 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111584&action=edit Bug 26673: Remove shebangs from Perl modules It's not needed. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Needs Signoff |Failed QA --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- FAIL C4/Barcodes/ValueBuilder.pm FAIL critic # Modules::RequireFilenameMatchesPackage: Got 1 violation(s). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joonas.kylmala@helsinki.fi --- Comment #3 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- (In reply to Jonathan Druart from comment #2)
FAIL C4/Barcodes/ValueBuilder.pm
FAIL critic
# Modules::RequireFilenameMatchesPackage: Got 1 violation(s).
Not caused by this change though, maybe you want to file separate bug for this and the same issue with Koha/Z3950Responder/RPN.pm, and actually not totally sure these are bugs. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- FAIL Koha/Z3950Responder/RPN.pm FAIL critic # Modules::RequireFilenameMatchesPackage: Got 1 violation(s). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #5 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- This patch missed one instance where the shebang is not needed: C4/TTParser.pm -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #111584|0 |1 is obsolete| | --- Comment #6 from David Cook <dcook@prosentient.com.au> --- Created attachment 111655 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111655&action=edit Bug 26673: Remove shebangs from Perl modules It's not needed. Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- Created attachment 111656 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111656&action=edit Bug 26673: Remove #!/usr/bin/env perl from .pm modules too -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #8 from David Cook <dcook@prosentient.com.au> --- (In reply to Joonas Kylmälä from comment #5)
This patch missed one instance where the shebang is not needed: C4/TTParser.pm
Nice catch. I've added a patch for that. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to Joonas Kylmälä from comment #3)
Not caused by this change though, maybe you want to file separate bug for this and the same issue with Koha/Z3950Responder/RPN.pm, and actually not totally sure these are bugs.
Yeah, I don't think we should fail this bug for those Perl critic failures. I'll open a new bug report for those though. In theory, C4/Barcodes/ValueBuilder.pm and Koha/Z3950Responder/RPN.pm would just become packages that "use" the subpackages that can be split off into their own files. (I'll take a look if there are any other packages that are guilty of the same Perl critic violation...) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|dcook@prosentient.com.au |koha-bugs@lists.koha-commun | |ity.org --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #9)
I'll open a new bug report for those though. In theory, C4/Barcodes/ValueBuilder.pm and Koha/Z3950Responder/RPN.pm would just become packages that "use" the subpackages that can be split off into their own files. (I'll take a look if there are any other packages that are guilty of the same Perl critic violation...)
Ok C4/Barcodes/ValueBuilder.pm was easy, but I just realized Koha/Z3950Responder/RPN.pm overrides a non-C4/non-Koha namespace. Blah. This is where our terrible codetree layout comes to bite us heh. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #11 from David Cook <dcook@prosentient.com.au> --- Ok I've opened Bug 26683 to deal with the Perl critic issues -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26683 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #111655|0 |1 is obsolete| | Attachment #111656|0 |1 is obsolete| | --- Comment #12 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 111677 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111677&action=edit Bug 26673: Remove shebangs from Perl modules It's not needed. Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #13 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 111678 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111678&action=edit Bug 26673: Remove #!/usr/bin/env perl from .pm modules too Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #111678|0 |1 is obsolete| | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 111810 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111810&action=edit Bug 26673: Remove #!/usr/bin/env perl from .pm modules too Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #111677|0 |1 is obsolete| | --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 111811 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111811&action=edit Bug 26673: Remove shebangs from Perl modules It's not needed. Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #111810|0 |1 is obsolete| | --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 111812 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111812&action=edit Bug 26673: Remove #!/usr/bin/env perl from .pm modules too Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Could we have a QA script check for this? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #18 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #17)
Could we have a QA script check for this?
Oooh that's a good idea! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #19 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- David, this change makes t/00-testcritic.t fail on # Failed test 'Test::Perl::Critic for "C4/Barcodes/ValueBuilder.pm"' # at /usr/share/perl5/Test/Perl/Critic.pm line 121. # # Package declaration must match filename at line 19, column 1. Correct the filename or package statement. (Severity: 5) # Failed test 'Test::Perl::Critic for "Koha/Z3950Responder/RPN.pm"' # at /usr/share/perl5/Test/Perl/Critic.pm line 121. # # Package declaration must match filename at line 1, column 1. Correct the filename or package statement. (Severity: 5) I am aware of bug 26683 but I'd like a quick fix to have the tests green now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 112814 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=112814&action=edit Bug 26673: Fix perlcritic complains This patch fixes the following perlcritic complain: Package declaration must match filename at line 19, column 1. Correct the filename or package statement. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 --- Comment #22 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #21)
Created attachment 112814 [details] [review] Bug 26673: Fix perlcritic complains
This patch fixes the following perlcritic complain: Package declaration must match filename at line 19, column 1. Correct the filename or package statement.
Pushed to master for 20.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #23 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz --- Comment #24 from Aleisha Amohia <aleisha@catalyst.net.nz> --- enhancement, not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00 |20.11.00, 20.05.06 released in| | Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28054 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28054 [Bug 28054] SIPServer.pm is a program and requires a shebang -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26673 Abdivasiyev Sunnatillo <abdivasiyevsunnatillo2008@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abdivasiyevsunnatillo2008@g | |mail.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org