Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 172194 - sys-apps/portage - env-update doesn't remove duplicate PATH entries
Summary: sys-apps/portage - env-update doesn't remove duplicate PATH entries
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Lowest enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 181949 187293
  Show dependency tree
 
Reported: 2007-03-25 16:49 UTC by Arvid Norlander
Modified: 2007-06-09 05:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Norlander 2007-03-25 16:49:35 UTC
env-update doesn't seem to remove duplicates in PATH and other colon separated variables. This results in a long and messy PATH (as well as MANPATH and some others).
My PATH end up looking like this:
/usr/kde/3.5/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1:/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin:/usr/kde/3.5/bin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/qt/3/bin:/usr/games/bin:/usr/share/omniORB/bin/scripts:/opt/vmware/server/bin

As you can see these two files are nearly identical, that cause the dupes of qt:

tux /etc/env.d # cat 45qt3
PATH=/usr/qt/3/bin
ROOTPATH=/usr/qt/3/bin
LDPATH=/usr/qt/3/lib:/usr/qt/3/lib64:/usr/qt/3/lib32
QMAKESPEC=linux-g++
MANPATH=/usr/qt/3/doc/man
PKG_CONFIG_PATH=/usr/qt/3/lib64/pkgconfig
tux /etc/env.d # cat 45qt3-emul
PATH=/usr/qt/3/bin
ROOTPATH=/usr/qt/3/bin
LDPATH=/usr/qt/3/lib:/usr/qt/3/lib64:/usr/qt/3/lib32
QMAKESPEC=linux-g++
MANPATH=/usr/qt/3/doc/man
PKG_CONFIG_PATH=/usr/qt/3/lib32/pkgconfig

The packages these belong to:
x11-libs/qt-3.3.6-r4 (/etc/env.d/45qt3)
app-emulation/emul-linux-x86-qtlibs-10.0 (/etc/env.d/45qt3-emul)

As it is possible for someone to have only one of these, it is not possible to just remove one, instead env-update should not add dupes. 

Reproducible: Always

Steps to Reproduce:
1. Have some packages that add the same path to PATH installed (for example: app-emulation/emul-linux-x86-qtlibs and x11-libs/qt)
2. Open a terminal and type: echo "$PATH"

Actual Results:  
/usr/kde/3.5/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1:/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin:/usr/kde/3.5/bin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/qt/3/bin:/usr/games/bin:/usr/share/omniORB/bin/scripts:/opt/vmware/server/bin

Expected Results:  
Only the first of each path should be in the path, any later ones are redunant:
/usr/kde/3.5/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.1:/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin:/usr/qt/3/bin:/usr/games/bin:/usr/share/omniORB/bin/scripts:/opt/vmware/server/bin

I don't know if this cause any loss of performance or if it is just a "visual" bug. Unless there are :-separated variables that have to contain duplicates a fix for this should be simple to add to the env-update code in /usr/lib/portage/pym/portage.py (somewhere below line 564, I can't code python so I don't know how to exactly fix it).
Comment 1 Zac Medico gentoo-dev 2007-06-09 05:28:37 UTC
This has been released in 2.1.2.10.