Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1513096 - Add virtual provide for /bin/ksh
Summary: Add virtual provide for /bin/ksh
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ksh
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Siteshwar Vashisht
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-14 18:11 UTC by arif
Modified: 2019-03-18 16:27 UTC (History)
7 users (show)

Fixed In Version: ksh-20120801-43.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-10 05:03:48 UTC


Attachments (Terms of Use)

Description arif 2017-11-14 18:11:56 UTC
This is a repeat of bug 1503048 which was closed as not-a-bug. However other shells do not follow the same behaviour. So either the ksh package is wrong or the other shell packages are wrong.

Description of problem:

In Fedora 27 the command "dnf provides /bin/ksh" does not find any results where as on 26 and below the command returns the ksh package as expected.  This problem causes packages that require /bin/ksh to fail installation.

As many scripts involve /bin/ksh this gets listed as a requirement for packages, which then fail to install.

Version-Release number of selected component (if applicable):
ksh-20120801-41.fc27.x86_64

How reproducible:


Steps to Reproduce:
dnf provides /bin/sh
dnf provides /bin/bash
dnf provides /bin/zsh
dnf provides /bin/ksh


Actual results:

All commands report their respective packages except for ksh

# dnf provides /bin/sh
bash-4.4.12-12.fc27.x86_64 : The GNU Bourne Again shell
Repo        : @System
Matched from:
Provide    : /bin/sh

bash-4.4.12-12.fc27.x86_64 : The GNU Bourne Again shell
Repo        : fedora
Matched from:
Provide    : /bin/sh

# dnf provides /bin/bash
Last metadata expiration check: 0:30:46 ago on Tue 14 Nov 2017 12:34:55 PM EST.
bash-4.4.12-12.fc27.x86_64 : The GNU Bourne Again shell
Repo        : @System
Matched from:
Provide    : /bin/bash

bash-4.4.12-12.fc27.x86_64 : The GNU Bourne Again shell
Repo        : fedora
Matched from:
Provide    : /bin/bash

# dnf provides /bin/ksh
Last metadata expiration check: 0:32:12 ago on Tue 14 Nov 2017 12:34:55 PM EST.
Error: No Matches found


Expected results:

Expect that the ksh package would work the same as bash, zsh, tcsh, etc..

Additional info:

Comment 1 Kamil Dudka 2017-11-15 09:02:29 UTC
(In reply to arif from comment #0)
> This problem causes packages that require /bin/ksh to fail installation.

Please provide the list of packages that require /bin/ksh.  I see no such packages in the official Fedora repos:

% sudo dnf repoquery --whatrequires /bin/ksh
Last metadata expiration check: 0:00:24 ago on Wed 15 Nov 2017 09:57:25 AM CET.

> As many scripts involve /bin/ksh this gets listed as a requirement for
> packages, which then fail to install.

You are mixing apples and oranges here.  If a script contains /bin/ksh in its shebang, it does not mean that the package owning the script needs to require /bin/ksh.  Such packages need to be fixed to require the ksh package instead.

Comment 2 Lars E. Pettersson 2017-11-15 19:53:21 UTC
Not in official repo, but Zfs on Linux do require it:

# dnf -y system-upgrade download --releasever=27
Fedora 27 - x86_64 - Updates                                                          2.3 MB/s | 7.5 MB     00:03    
Failed to synchronize cache for repo 'zfs', disabling.
Last metadata expiration check: 0:00:00 ago on Wed 15 Nov 2017 08:43:20 PM CET.
Error: 
 Problem: package zfs-dkms-0.7.3-1.fc26.noarch requires /bin/ksh, but none of the providers can be installed
  - ksh-20120801-35.fc26.x86_64 does not belong to a distupgrade repository
  - problem with installed package zfs-dkms-0.7.3-1.fc26.noarch
[root@tux ~]# rpm -q ksh
ksh-20120801-35.fc26.x86_64

On Fedora26:

#  dnf provides /bin/ksh
...
ksh-20120801-35.fc26.x86_64 : The Original ATT Korn Shell
Repo        : @System
Matched from:
Filename    : /bin/ksh

On Fedora27:

# dnf provides /bin/ksh
...
Error: No Matches found

Could this be fixed?

Comment 3 Kamil Dudka 2017-11-16 08:35:04 UTC
Please file a bug against Zfs on Linux wherever you got it from.

Comment 4 Lars E. Pettersson 2017-11-16 10:08:59 UTC
(In reply to Kamil Dudka from comment #3)
> Please file a bug against Zfs on Linux wherever you got it from.

???

Why can't this be fixed? The ksh package in 27 behaves in another way than it did in 26. Why has this been changed?

Comment 5 Kamil Dudka 2017-11-16 10:42:27 UTC
(In reply to Lars E. Pettersson from comment #4)
> Why can't this be fixed?

I am not saying that we cannot introduce a virtual Provides for /bin/ksh but it is not in contradiction with fixing the packages that require it for historical reasons.

Did you file the bug?

> The ksh package in 27 behaves in another way than
> it did in 26. Why has this been changed?

It must have been side effect of the following change:

https://src.fedoraproject.org/cgit/rpms/ksh.git/commit/?id=9bad5ead

Comment 6 Lars E. Pettersson 2017-11-16 11:01:09 UTC
(In reply to Kamil Dudka from comment #5)
> Did you file the bug?

Not yet.

> It must have been side effect of the following change:
> 
> https://src.fedoraproject.org/cgit/rpms/ksh.git/commit/?id=9bad5ead

OK, but why is ksh treated in another way than other shells? They seem to end up in /bin, why not also ksh? Or am I missing something?

Comment 7 Kamil Dudka 2017-11-16 11:16:33 UTC
Since Fedora 17, /bin is just a symlink to /usr/bin.  So, if /usr/bin/ksh is
available on your system, /bin/ksh must be available, too.  It is just RPM
dependencies (requires/provides) what makes ksh different between Fedora 26
and Fedora 27.

Comment 8 Lars E. Pettersson 2017-11-16 11:25:04 UTC
(In reply to Kamil Dudka from comment #7)
> It is just RPM
> dependencies (requires/provides) what makes ksh different between Fedora 26
> and Fedora 27.

Yes, and that seem to break things.

There is a difference between the shells though.

$ yum provides /bin/bash /usr/bin/bash
...
Repo        : @System
Matched from:
Filename    : /usr/bin/bash
Provide    : /bin/bash

and

$ yum provides /bin/ksh /usr/bin/ksh
...
Repo        : updates
Matched from:
Filename    : /usr/bin/ksh

So bash has the filename /usr/bin/bash and provides /bin/bash. ksh only has a filename of /usr/bin/ksh, but no provide of /bin/ksh

csh and tcsh behaves as bash (having both filename and provide), dash only has a filename of /bin/dash

So ksh and dash seem to be odd-balls right now, in regards to how shell rpm:s handle provides.

Comment 9 Kamil Dudka 2017-11-16 11:33:58 UTC
The point is that file dependencies should be avoided whenever possible anyway:

https://fedoraproject.org/wiki/Packaging:Guidelines#File_and_Directory_Dependencies

You did not tell us why Zfs on Linux needs to depend on /bin/ksh instead of ksh.

Comment 10 Lars E. Pettersson 2017-11-16 12:43:37 UTC
(In reply to Kamil Dudka from comment #9)
> The point is that file dependencies should be avoided whenever possible
> anyway:

Avoided, yes, but it does not say "not allowed", i.e. they should be setup in such a way that one could use filename dependency solving, if asked for it.

My point is that ksh behaves in another way than the other shells, except dash, for filename dependency solving, as I pointed out in comment #8. The other shells, except dash, will be shown as a provider if one ask them for /bin/<shell> or /usr/bin/<shell>. ksh will only be shown as a provider if one asks for /usr/bin/ksh

I.e. could the /bin/ksh provide be added? As has been done with bash, csh, and tcsh?

> You did not tell us why Zfs on Linux needs to depend on /bin/ksh instead of
> ksh.

I'm a user of ZFS for Linux and have no clue whatsoever why they have that dependency or why it is used in the way that it is used. But /bin/<shell> has been the normal place for shells for decades.

Comment 11 Kamil Dudka 2017-11-16 13:15:15 UTC
(In reply to Lars E. Pettersson from comment #10)
> I.e. could the /bin/ksh provide be added?

I think it could.

> I'm a user of ZFS for Linux and have no clue whatsoever why they have that
> dependency or why it is used in the way that it is used.

I wonder why a file system implementation requires ksh in the first place.

> But /bin/<shell> has been the normal place for shells for decades.

It still is if you talk about file system layout.  It is not when you talk about RPM dependencies.  The cited policy from Fedora Packaging Guidelines has not been changed (at least) since the first import in 2008.

Comment 12 Lars E. Pettersson 2017-11-16 13:20:46 UTC
(In reply to Kamil Dudka from comment #11)
> (In reply to Lars E. Pettersson from comment #10)
> > I.e. could the /bin/ksh provide be added?
> 
> I think it could.

$ grep Provides bash.spec ksh.spec
bash.spec:Provides: /bin/sh
bash.spec:Provides: /bin/bash

I.e. add
Provides: /bin/ksh

to ksh.spec

Comment 13 Kamil Dudka 2017-11-16 14:12:08 UTC
(In reply to Lars E. Pettersson from comment #12)
> I.e. add
> Provides: /bin/ksh
> 
> to ksh.spec

That is what I meant by "virtual Provides for /bin/ksh" in comment #5.

Comment 14 arif 2017-11-16 14:28:02 UTC
I filed this bug and yes we need to fix the dependant packages if possible.

However I would argue that the traditional system shells have a special status. The standard place to find them is in /bin and the ksh package itself does add /bin/ksh to /etc/shells.

The Fedora Packaging Guidelines says "Things that history has placed into /bin, /sbin, /lib, or /lib64 should be listed in the %files section as being in those directories." or use a "Virtual Provides" statement.

So adding a "virtual provides" would be perfect.

Comment 15 Lars E. Pettersson 2017-11-17 10:00:30 UTC
Could we expect to see an updated ksh package soon? Making it work they way as the majority of the other shells do? I mean, it's just a one-liner. Would be appreciated.

Comment 16 Lars E. Pettersson 2017-11-17 10:09:48 UTC
(In reply to Kamil Dudka from comment #3)
> Please file a bug against Zfs on Linux wherever you got it from.

FYI... https://github.com/zfsonlinux/zfs/issues/6878

Comment 17 Fedora Update System 2017-11-21 21:14:26 UTC
ksh-20120801-43.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-2094282f35

Comment 18 Fedora Update System 2017-11-22 21:39:57 UTC
ksh-20120801-43.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-2094282f35

Comment 19 arif 2017-11-27 17:24:47 UTC
The latest ksh package in testing works great. Thanks.

Comment 20 Lars E. Pettersson 2017-11-28 08:20:29 UTC
Thank you. Now it works as expected! Feedback left at Bohdi.

Comment 21 Fedora Update System 2017-12-10 05:03:48 UTC
ksh-20120801-43.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


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