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

Debian post install script issues #8734

Open
Jmennius opened this issue Dec 10, 2024 · 2 comments
Open

Debian post install script issues #8734

Jmennius opened this issue Dec 10, 2024 · 2 comments

Comments

@Jmennius
Copy link

  • Electron-Builder Version: 26.0.0-alpha.7
  • Node Version: 22.11.0
  • Electron Version: ^33.2.0
  • Electron Type (current, beta, nightly): current
  • Target: x86_64, Debian package

When installing a package I see the following: /var/lib/dpkg/info/<package-name>.postinst: 30: [[: not found.
Essentially, the postisnt from fpm uses /bin/sh shebang, which is not bash by default on most Debian systems (Ubuntu as well).
So the script is running in the POSIX shell (or in compat mode at the very least), so some things do not work as expected.

At least for Debian packages:

  1. the shebang does not have any effect, it's just a comment, fpm will put the code from after-install.tpl inside a function.
  2. bash test builtin does not work because the shell is not bash.
  3. another bashism is type which is apparently and optional part of POSIX (or rather an extension)
@mmaietta
Copy link
Collaborator

Fantastic callout/discovery and details. Would you be willing to open a PR with the /bin/sh-supported command?

@Jmennius
Copy link
Author

Jmennius commented Dec 26, 2024

Fantastic callout/discovery and details. Would you be willing to open a PR with the /bin/sh-supported command?

In general, yes, but I'm kind of not sure when I would be able to :)

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

No branches or pull requests

2 participants