Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix addons shebang. #576

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

brauliohms
Copy link
Contributor

Follows fix shebangs in some files according to the packaging in Debian, because I am the maintainer of the package in Debian.

@Euro20179
Copy link
Collaborator

The script just sources the addons so the shebang is not very important, but if I'm going to merge this,
The #!/bin/sh shebangs should probably all just be #!/usr/bin/env sh. And scrapers/ani-category should use sh not bash

@brauliohms
Copy link
Contributor Author

The script scrapers/ani-category in line 107, lintian indicates is not posix, is a bash script.

@brauliohms
Copy link
Contributor Author

Follow the lintian msg:

bash-term-in-posix-shell '(ep_start+=' [usr/share/ytfzf/addons/scrapers/ani-category:107]

This script is marked as running under /bin/sh, but it seems to use a feature found in bash but not in the SUSv3 or POSIX shell specification.

@Euro20179
Copy link
Collaborator

According to this which I've used as a posix reference for this script, += inside arithmetic expansion is posix compliant.

Next, the shell shall treat this as an arithmetic expression and substitute the value of the expression. The arithmetic expression shall be processed according to the rules given in Arithmetic Precision and Operations, with the following exceptions:

  • Only signed long integer arithmetic is required.
  • Only the decimal-constant, octal-constant, and hexadecimal-constant constants specified in the ISO C standard, Section 6.4.4.1 are required to be recognized as constants.
  • The sizeof() operator and the prefix and postfix "++" and "--" operators are not required.
  • Selection, iteration, and jump statements are not supported.

From my testing += works in dash, bash, and busybox sh, and oksh (openbsd ksh).

Either way I can change it later

@brauliohms
Copy link
Contributor Author

Thanks, and it is really very controversial this limitation of what is POSIX or not.
And keep up the good work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants