Bug 1215289 - bash completion file adds a shell alias for python
Summary: bash completion file adds a shell alias for python
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Honza Silhan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1216956 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-24 23:23 UTC by Garrett Holmstrom
Modified: 2015-05-08 07:27 UTC (History)
8 users (show)

Fixed In Version: dnf-plugins-core-0.1.7-1.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-08 07:27:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Garrett Holmstrom 2015-04-24 23:23:08 UTC
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 15:28:13 UTC
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 10:23:56 UTC
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 15:19:27 UTC
*** Bug 1216956 has been marked as a duplicate of this bug. ***

Comment 4 Fedora Update System 2015-05-02 13:49:52 UTC
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 17:24:47 UTC
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 07:27:29 UTC
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.