Bug 1215289 - bash completion file adds a shell alias for python
bash completion file adds a shell alias for python
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Honza Silhan
Fedora Extras Quality Assurance
:
: 1216956 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-24 19:23 EDT by Garrett Holmstrom
Modified: 2015-05-08 03:27 EDT (History)
8 users (show)

See Also:
Fixed In Version: dnf-plugins-core-0.1.7-1.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-05-08 03:27:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Garrett Holmstrom 2015-04-24 19:23:08 EDT
Description of problem:

While looking through the bash completion file in dnf's git tree [1] I noticed the following snippet near the top of the file:

if [[ "$( readlink /usr/bin/dnf )" == "dnf-2" ]]; then
    alias dnf="dnf-2"
    alias python="python2"
else
    alias dnf="dnf-3"
    alias python="python3"
fi

This is going to define a shell alias for "python" that can differ from the version of python residing at /usr/bin/python.  Needless to say, that is rather dangerous and probably not what that script is intended to do.


Version-Release number of selected component (if applicable):

commit 3dd3693 [1]


[1] https://github.com/rpm-software-management/dnf/blob/3dd3693/etc/bash_completion.d/dnf-completion.bash
Comment 1 Orion Poplawski 2015-04-27 11:28:13 EDT
It also shouldn't alias dnf - this causes problems when switching from dnf-2 to dnf-3 or vice-versa.
Comment 2 Honza Silhan 2015-04-28 06:23:56 EDT
Thanks for the report. The aliases were the intention inside the script.
PR: https://github.com/rpm-software-management/dnf/pull/262
Now it should not affect the rest of the shell.
Comment 3 rejit.devel 2015-04-30 11:19:27 EDT
*** Bug 1216956 has been marked as a duplicate of this bug. ***
Comment 4 Fedora Update System 2015-05-02 09:49:52 EDT
dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22
Comment 5 Fedora Update System 2015-05-03 13:24:47 EDT
Package dnf-plugins-core-0.1.7-1.fc22, hawkey-0.5.5-1.fc22, dnf-1.0.0-1.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-plugins-core-0.1.7-1.fc22 hawkey-0.5.5-1.fc22 dnf-1.0.0-1.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-7483/dnf-plugins-core-0.1.7-1.fc22,hawkey-0.5.5-1.fc22,dnf-1.0.0-1.fc22
then log in and leave karma (feedback).
Comment 6 Fedora Update System 2015-05-08 03:27:29 EDT
dnf-plugins-core-0.1.7-1.fc22, hawkey-0.5.5-1.fc22, dnf-1.0.0-1.fc22 has been pushed to the Fedora 22 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.