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

Only read the first line for shbang. #1213

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smoser
Copy link
Contributor

@smoser smoser commented May 16, 2024

I noticed this when I was playing with a shbang program like:

#!/usr/bin/env busybox sh
echo hello world

Melange would give a warning like this:

Error reading shbang from usr/bin/hello-busybox:
a shbang of only '/usr/bin/env' with multiple arguments
(6 /usr/bin/env busybox sh echo "hello world")

@smoser smoser force-pushed the fix/only-one-line-in-shbang branch from 7dd2fcd to eed1e30 Compare May 16, 2024 13:55
I noticed this when I was playing with a shbang program like:

   #!/usr/bin/env busybox sh
   echo hello world

Melange would give a warning like this:

   Error reading shbang from usr/bin/hello-busybox:
      a shbang of only '/usr/bin/env' with multiple arguments
         (6 /usr/bin/env busybox sh echo "hello world")

The new message would be:

   Error reading shbang from usr/bin/hello-busybox:
      a shbang of only '/usr/bin/env' with multiple arguments
         (3 /usr/bin/env busybox sh)

Signed-off-by: Scott Moser <smoser@brickies.net>
@smoser smoser force-pushed the fix/only-one-line-in-shbang branch from eed1e30 to ad04838 Compare May 16, 2024 14:16
@imjasonh
Copy link
Member

Is there a test you could add to demonstrate the problem, and that this is the fix?

Do you have an idea if there are packages in the wild that will produce different provideses with this change? Or is this just about avoiding the misleading warning?

@smoser
Copy link
Contributor Author

smoser commented May 16, 2024

Is there a test you could add to demonstrate the problem, and that this is the fix?

Do you have an idea if there are packages in the wild that will produce different provideses with this change? Or is this just about avoiding the misleading warning?

i could add a test.l I'm pretty sure this only affects the error path, in which there will be no provides generated.

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