Bug 32922 - Remove space in shebang
Summary: Remove space in shebang
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Magnus Enger
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-09 07:51 UTC by Magnus Enger
Modified: 2023-12-28 20:43 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04
Circulation function:


Attachments
Bug 32922: Remove space in shebang (5.81 KB, patch)
2023-02-09 08:12 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 32922: Remove space in shebang (5.83 KB, patch)
2023-02-09 08:14 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 32922: Remove space in shebang (5.95 KB, patch)
2023-02-09 09:27 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 32922: Remove space in shebang (5.96 KB, patch)
2023-02-10 16:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 32922: (follow-up) Fix two additional occurences (1012 bytes, patch)
2023-02-10 16:46 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 29449: Show userid on "Personal details" tab (2.06 KB, patch)
2023-02-23 08:57 UTC, Magnus Enger
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2023-02-09 07:51:12 UTC
Some of our scripts have a space in the shebang: 

$ grep -rn --include=*.pl '#! /usr/' *
admin/library_groups.pl:1:#! /usr/bin/perl
admin/credit_types.pl:1:#! /usr/bin/perl
admin/debit_types.pl:1:#! /usr/bin/perl
admin/curbside_pickup.pl:1:#! /usr/bin/perl
admin/desks.pl:1:#! /usr/bin/perl
admin/cities.pl:1:#! /usr/bin/perl
admin/classsources.pl:1:#! /usr/bin/perl
admin/matching-rules.pl:1:#! /usr/bin/perl
admin/background_jobs.pl:1:#! /usr/bin/perl
admin/patron-attr-types.pl:1:#! /usr/bin/perl
circ/curbside_pickups.pl:1:#! /usr/bin/perl
erm/erm.pl:1:#! /usr/bin/perl
misc/cronjobs/delete_items.pl:1:#! /usr/bin/perl
misc/maintenance/check_syspref_cache.pl:1:#! /usr/bin/perl
misc/maintenance/compare_es_to_db.pl:1:#! /usr/bin/perl
misc/add_statistics_borrowers_categorycode.pl:1:#! /usr/bin/perl

It looks like this is not illegal (see e.g. https://unix.stackexchange.com/questions/276751/is-space-allowed-between-and-bin-bash-in-shebang) but it has been argued that we should be consistent (bug 26658) so we might want to fix this. Unless there is some reason for it that I am not aware of?
Comment 1 Magnus Enger 2023-02-09 08:12:52 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2023-02-09 08:14:34 UTC
Created attachment 146417 [details] [review]
Bug 32922: Remove space in shebang

Some of our scripts have a space in the "shebang" (first) line:

  #! /usr/bin/perl

This is not illegal, and it does work, but it is good to be
consistent, so this patch removes the space.

To test:
- Run: grep -rn --include=*.pl '#! /usr/' *
- See the list of files that have a space in the shebang
- Apply the patch
- Run the command again, there should be no output, meaning there
  are no more files with space in the shebang
- Have a look at the patch and check that it only changes the
  shebangs
- Sign off
Comment 3 Matt Blenkinsop 2023-02-09 09:27:44 UTC
Created attachment 146419 [details] [review]
Bug 32922: Remove space in shebang

Some of our scripts have a space in the "shebang" (first) line:

  #! /usr/bin/perl

This is not illegal, and it does work, but it is good to be
consistent, so this patch removes the space.

To test:
- Run: grep -rn --include=*.pl '#! /usr/' *
- See the list of files that have a space in the shebang
- Apply the patch
- Run the command again, there should be no output, meaning there
  are no more files with space in the shebang
- Have a look at the patch and check that it only changes the
  shebangs
- Sign off

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2023-02-10 16:46:39 UTC
Created attachment 146498 [details] [review]
Bug 32922: Remove space in shebang

Some of our scripts have a space in the "shebang" (first) line:

  #! /usr/bin/perl

This is not illegal, and it does work, but it is good to be
consistent, so this patch removes the space.

To test:
- Run: grep -rn --include=*.pl '#! /usr/' *
- See the list of files that have a space in the shebang
- Apply the patch
- Run the command again, there should be no output, meaning there
  are no more files with space in the shebang
- Have a look at the patch and check that it only changes the
  shebangs
- Sign off

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize (ashimema) 2023-02-10 16:46:42 UTC
Created attachment 146499 [details] [review]
Bug 32922: (follow-up) Fix two additional occurences

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize (ashimema) 2023-02-10 16:49:26 UTC
Oops.. just spotted this was SO'd by Matt.. but I've gone through a QA process on it already.

All working nicely and is a good general consistency improvement.

Passing QA.. Tomas, feel free to push back for an independent QA if you want it .
Comment 7 Tomás Cohen Arazi (tcohen) 2023-02-16 15:02:13 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 8 Magnus Enger 2023-02-23 08:57:37 UTC Comment hidden (obsolete)
Comment 9 Magnus Enger 2023-02-23 08:58:32 UTC Comment hidden (obsolete)
Comment 10 Martin Renvoize (ashimema) 2023-02-24 07:53:00 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release
Comment 11 Lucas Gass (lukeg) 2023-03-01 14:06:50 UTC
Does not apply to 22.05.x, no backport.