Bug 1806229 - #!/bin/sh used in update scriptlet
Summary: #!/bin/sh used in update scriptlet
Alias: None
Product: Fedora
Classification: Fedora
Component: qt5-qtbase
Version: 31
Hardware: Unspecified
OS: Linux
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2020-02-23 03:12 UTC by jimmydean886
Modified: 2020-02-27 18:50 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-02-27 15:23:07 UTC
Type: Bug

Attachments (Terms of Use)

Description jimmydean886 2020-02-23 03:12:40 UTC
Description of problem:
qt5-qtbase requires /bin/sh point to bash to complete.

My system uses /bin/dash since I've run into some compatibility issues with bash over the years with some of my own scripts, so I always symlink /bin/sh to that instead. Recently I noticed that on every Fedora machine I own qt5-qtbase fails to upgrade, but Void/Debian/Raspbian/Arch do not seem to have any issues. The error is always a bad file descriptor error, which suggests something in the update process is using bashisms and is pointed at /bin/sh as the script interpreter.

Version-Release number of selected component (if applicable):
Most recently I have seen this with the update to 5.13, but I believe it spans many releases. I do not know which one this started with.

How reproducible:

Steps to Reproduce:
1. Leave a system for a short time without updates (long enough for the package to up-rev)
2. Install dash (or another similarly narrowly posix-compliant shell)
3. Run: sudo rm /bin/sh; sudo ln -s /bin/dash /bin/sh
4: Run an update with dnf

Actual results:
Package upgrade fails.

Expected results:
Package update succeeds.

Additional info:

Comment 1 Rex Dieter 2020-02-23 03:57:57 UTC
Changing what bin/sh points to is likely unsupported.  See also https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_default_shell

Comment 2 Rex Dieter 2020-02-27 15:23:07 UTC
Besides, just using fairly standard scriptlets like:

if [ $1 -eq 0 ]; then
%{_sbindir}/update-alternatives  \
  --remove qtchooser-5 \

%{_sbindir}/update-alternatives  \
  --remove qtchooser-default \

Which many many fedora packages use, if this is problematic for you, many others will be too.  Again, strong recommendation to just not mess with #!/bin/sh


Comment 3 jimmydean886 2020-02-27 18:50:53 UTC
OK. Unfortunately, due to my environment leaving /bin/sh symlinked to bash is not an option for me. This is the only package that has ever shown a problem, so I had hope.

Sorry for wasting your time. I will use something else for now.

Note You need to log in before you can comment on or make changes to this bug.