Bug 1288411 - Latest "which" package (which-2.20-10.fc22) breaks backwards compatibility.
Summary: Latest "which" package (which-2.20-10.fc22) breaks backwards compatibility.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: which
Version: 22
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-04 06:48 UTC by thestrider
Modified: 2016-06-28 12:22 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-28 12:22:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description thestrider 2015-12-04 06:48:38 UTC
Description of problem: The latest F22 "which" package (and possibly some other recent "which" releases) breaks backwards compatibility by enforcing an alias.

## BEGIN ALIAS ##
alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
## END ALIAS ##

This alias gets set in the file "/etc/profile.d/which2.sh", which is installed as part of the "which" package.  Since the aliased "which" command reads aliases itself, the output will at times break the expected convention for a vanilla call, and this breaks other programs.

E.g., in previous versions of which, one can issue the call `rpm -qf $(which <SOME_FILE>)` to retrieve the package name associated with a given file.  This is now broken, when the file is a command with an associated alias (e.g. 'ls' or 'which' itself).  This is just one simple example.  There must certainly be many additional custom user scripts which are now broken, having assumed that a vanilla call to `which` would return vanilla output.

Version-Release number of selected component (if applicable):2.20-10.fc22


How reproducible: Self-evident by calling `which which`, or by reading the contents of "/etc/profile.d/which2.sh".


Steps to Reproduce:
1. Self-evident. See above.
2.
3.

Actual results: For `which which`, the actual output is the following:

## BEGIN `which which ` OUTPUT ###
alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
	/usr/bin/which
## END `which which ` OUTPUT ###



Expected results:  For `which which`, the expected output is the following:

## BEGIN `which which ` OUTPUT ###
/usr/bin/which
## END `which which ` OUTPUT ###


Additional info:

Comment 1 Than Ngo 2016-06-28 12:22:12 UTC
i don't see any compatibility in the new version, it behaves the same like before.
The default alias for which is read-alias and read-functions. You can disable read-alias for youi case.


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