Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 276901 - app-shells/bash-completion not prefix aware
Summary: app-shells/bash-completion not prefix aware
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-07 09:54 UTC by Thomas Burkard
Modified: 2009-10-16 03:04 UTC (History)
1 user (show)

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


Attachments
modified patch with extra label on all absolute paths (bash-completion-1.0-gentoo.patch,2.13 KB, text/plain)
2009-07-15 20:46 UTC, Thomas Burkard
Details
modified ebuild containing extra `sed ` (bash-completion-1.0-r5.ebuild,3.30 KB, text/plain)
2009-07-15 20:47 UTC, Thomas Burkard
Details
modified ebuild containing extra `sed ` (bash-completion-1.0-r5.ebuild,3.33 KB, text/plain)
2009-07-15 21:06 UTC, Thomas Burkard
Details
adds @GENTOO_PORTAGE_EPREFIX@ to bash_completion.sh (bash-completion-1.0-prefix.patch,1.34 KB, patch)
2009-07-23 20:28 UTC, Thomas Burkard
Details | Diff
ebuild patch to utilize prefix patch (bash-completion-1.0-r5.ebuild.patch,650 bytes, patch)
2009-07-23 20:32 UTC, Thomas Burkard
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Burkard 2009-07-07 09:54:03 UTC
the installed file ${EPREFIX}/etc/profile.d/bash-completion.sh tries to access files in /usr/share and /etc.

the spurious code can be found in bash-completion-1.0-gentoo.patch. (the original code also contains absolute paths, but it is completely replaced by the patch.)


Reproducible: Always

Steps to Reproduce:
1.emerge bash-completion inside prefix as non-root
2.enable it by `eselect bashcomp enable base`
3.launch a new shell

Actual Results:  
complaints about missing files /usr/share/bash-completion/{.pre,.post}

Expected Results:  
find the files in ${EPREFIX}/usr/share/... instead

this might actually be an issue in the gentoo-x86 main tree, but it doesn't show up there, as the expected and the actual location match. in prefix this assumption does not hold anymore.
Comment 1 Thomas Burkard 2009-07-15 20:46:07 UTC
Created attachment 198100 [details]
modified patch with extra label on all absolute paths

this is a possible fix:

i added the string ":INSTALLROOT:" to all absolute paths inside the patch and an extra "sed -i" line to the ebuild replacing that string with ${ROOT} (resp. ${EROOT} in prefix)

i know, it's quite hacky, but it's the only solution i could imagine that does not involve heavier manipulations...

tested inside prefix ~x86-linux on ubuntu 9.04.
Comment 2 Thomas Burkard 2009-07-15 20:47:41 UTC
Created attachment 198101 [details]
modified ebuild containing extra `sed `
Comment 3 Thomas Burkard 2009-07-15 20:56:55 UTC
cc'ing shell-tools herd
Comment 4 Thomas Burkard 2009-07-15 21:06:29 UTC
Created attachment 198104 [details]
modified ebuild containing extra `sed `

erm, new version of the ebuild. the previous one was a mixture of x86 and prefix, so it won't work :-(

this version is based on x86 only, however untested... sorry for the noise.
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-07-22 21:23:28 UTC
(In reply to comment #4)
> Created an attachment (id=198104) [edit]
> modified ebuild containing extra `sed `
> 
> erm, new version of the ebuild. the previous one was a mixture of x86 and
> prefix, so it won't work :-(
> 
> this version is based on x86 only, however untested... sorry for the noise.
> 

Maybe a Gentoo Prefix patch would be better here that places @GENTOO_PORTAGE_EPREFIX@ instead of INSTALLROOT in the appropriate places. Then you simply need to call eprefixigy to change @GENTOO...@ to an abs path.

What do you think about that?
Comment 6 Thomas Burkard 2009-07-23 15:44:04 UTC
personally i don't like the deviation from the main tree, so i tried to fix it in gentoo-x86.

however if the policy says so (and if it helps to get it into the central repository more quickly ;-) ), i'll rework the fix based on prefix...
Comment 7 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-07-23 15:48:54 UTC
(In reply to comment #6)
> personally i don't like the deviation from the main tree, so i tried to fix it
> in gentoo-x86.

Yea, but given the state of bash-completion upstream..the gentoo patch won't get accepted. I would prefer to see a gentoo-prefix patch for this. Eventually, it could be merged to gentoo-x86 entirely. Two seperate patches are much easier for me to maintain when upstream releases a mega version bump (so many changes already in upstream git =/ )

> 
> however if the policy says so (and if it helps to get it into the central
> repository more quickly ;-) ), i'll rework the fix based on prefix...
> 

Comment 8 Thomas Burkard 2009-07-23 20:28:12 UTC
Created attachment 198945 [details, diff]
adds @GENTOO_PORTAGE_EPREFIX@ to bash_completion.sh

this is a patch for 'bash_completion.sh' to be applied *after* 'bash-completion-1.0-gentoo.patch' was applied
Comment 9 Thomas Burkard 2009-07-23 20:32:21 UTC
Created attachment 198947 [details, diff]
ebuild patch to utilize prefix patch

this is a patch for 'bash-completion-1.0-r5.ebuild'. it additionally applies 'bash-completion-1.0-prefix.patch' and then runs eprefixify on the according file.
Comment 10 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-10-16 03:04:29 UTC
Sorry for the delay! I added prefix compat to bash-completion-1.1 based on your work.