The bashcomp.eselect module is able to determine where it is in a Prefixed environment pretty well, but it cannot properly determine where its modules are located. The following ebuild and patch have been tested on my machine and work. They are a proposed solution to this problem. The buggy-bashcomp-dirs patch fixes a bug I stumbled on and confused me for a while (patch submitted to eselect folks in bug #274759) and is required for this to work for now. Reproducible: Always Steps to Reproduce: 1. ./startprefix 2. emerge -1 '=app-admin/eselect-1.1.1' bzr 3. eselect bashcomp enable bzr Actual Results: It says "!!! Error: /usr/share/bash-completion/bzr doesn't exist" Expected Results: Blank output, with a new symlink to $EPREFIX/usr/share/bash-completion/bzr in ~/.bash_completion.d/ $ emerge --info Portage 2.2.00.13629-prefix (prefix/darwin/macos/10.5/x64, gcc-4.2.1, unavailable, 9.7.1 i386) ================================================================= System uname: Darwin-9.7.1-i386-64bit Timestamp of tree: Fri, 19 Jun 2009 21:42:19 +0000 distcc 2.18.5-Apple.1 i386-apple-darwin9.0 (protocols 1 and 2) (default port 3632) [disabled] app-shells/bash: 4.0_p24 dev-lang/python: 2.6.2-r1 dev-python/pycrypto: 2.0.1-r8 sys-devel/autoconf: 2.63-r01.1 sys-devel/automake: 1.9.6-r2, 1.10.2-r00.1 sys-devel/gcc-config: 1.4.1-r00.2 sys-devel/libtool: 2.2.6a-r00.1 ACCEPT_KEYWORDS="~x64-macos" CBUILD="x86_64-apple-darwin9" CFLAGS="-O2 -pipe -march=nocona -msse4.1" CHOST="x86_64-apple-darwin9" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-O2 -pipe -march=nocona -msse4.1" DISTDIR="/Users/jacob/Library/Gentoo/usr/portage/distfiles" EPREFIX="/Users/jacob/Library/Gentoo" FEATURES="assume-digests collision-protect distlocks fixpackages nostrip parallel-fetch preserve-libs protect-owned sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="en_US.UTF-8" LDFLAGS="" MAKEOPTS="-j3" PKGDIR="/Users/jacob/Library/Gentoo/usr/portage/packages" PORTAGE_CONFIGROOT="/Users/jacob/Library/Gentoo/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/Users/jacob/Library/Gentoo/var/tmp" PORTDIR="/Users/jacob/Library/Gentoo/usr/portage" SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix" USE="a52 aac aqua bash-completion cjk coreaudio cracklib divx fac midi mmx mmxext ncurses objc objc++ prefix readline sse sse2 ssl theora unicode x64-macos xulrunner xvid zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="Darwin" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Created attachment 195244 [details] Proposed eselect-1.1.1-r1 ebuild This ebuild requires the following patches to be placed into the usr/portage/app-admin/eselect/files/ directory
Created attachment 195245 [details, diff] Proposed fix for bug #274759 This is from bug #274759, and is needed for the next patch to work right.
Created attachment 195246 [details, diff] Proposed eselect patch for Prefix support This is the important component. This adds EPREFIX into usr/bin/eselect, and then adds EPREFIX support into bashcomp.eselect
I don't think we have to hardcode the prefix in like you did, as eselect is autoconfed
Created attachment 195288 [details, diff] eselect-1.1.1-prefix.patch eselect needed some heavy patching again :( @eselect team: would it be possible to include this patch (or a derivative) in the next eselect release?
ohw, please note that I forgot to add @PREFIX@ to bin/Makefile.in in the dosed.
> @eselect team: would it be possible to include this patch (or a derivative) > in the next eselect release? I don't really like this approach of using many different environment variables for passing directory paths from the core to the modules. It also obscures the code of the modules. I'd rather think about using autoconf also for the modules, or about having _one_ additional autoconf'd variable (maybe combined with ROOT where possible). Concerning the {editor,visual,pager}.eselect modules: can't you handle the prefix in the editor-variable.bash library instead?
ok, so just going back to the EPREFIX (to rule them all) approach? I don't mind which way we go, but going through the entirety of eselect is a hell, so just tell which way it will be.
(In reply to comment #8) > ok, so just going back to the EPREFIX (to rule them all) approach? Eselect now defines EPREFIX and EROOT (I've decided against the longer ESELECT_EPREFIX etc. because readability of the code would suffer). This is Changesets 607, 609, 610, and 611 in the eselect SVN. > [...] going through the entirety of eselect is a hell, [...] Just did this. I sympathise with you. ;-) Since such massive changes require testing, I've prepared a pre-release tarball that in <http://dev.gentoo.org/~ulm/distfiles/eselect-1.2_pre1.tar.bz2>. This version will _not_ be added to the main Portage tree. Can you please test if it works properly in Prefix?
Created attachment 201325 [details] Ebuild for pre-release version
With eselect ruby set 1, I get the following warning output. Note that gorg, which is written in ruby, runs just fine. $ eselect ruby set 1 !!! Warning: Could not set gem symlink It appears you do not have RubyGems installed for this profile. (For Ruby 1.8 you have to emerge >=dev-ruby/rubygems-1.2.0-r1) Successfully switched to profile: ruby18 Also, the rc module does not work correctly, of course, since it's in Prefix. I'm not sure if that should be left alone (and the init stuff fixed so things like sshd can be started in userland) or a warning added, or entirely removed. I'll leave that decision to you guys. Besides that, every other module acted as expected. This is on a ~x86-macos system.
(In reply to comment #11) > $ eselect ruby set 1 > !!! Warning: Could not set gem symlink > It appears you do not have RubyGems installed for this profile. > (For Ruby 1.8 you have to emerge >=dev-ruby/rubygems-1.2.0-r1) Do you have dev-ruby/rubygems installed on your system? If not, I think that the warning is normal. > Also, the rc module does not work correctly, of course, since it's in > Prefix. I'm not sure if that should be left alone (and the init stuff fixed > so things like sshd can be started in userland) or a warning added, or > entirely removed. Probably the same for the kernel module. Maybe the Prefix ebuild should remove the modules (and their man pages) that are not functional in Prefix. > Besides that, every other module acted as expected. That's good news. Thank you for testing.
(In reply to comment #12) > Do you have dev-ruby/rubygems installed on your system? If not, I think that > the warning is normal. I do not have rubygems installed. The warning seems to indicate I "need" it, but I'm ignoring it until I get something else to fail first. :) > That's good news. Thank you for testing. Thank you, and "grobian", for working on this obnoxious bug! :)
eselect-1.2_rc1 committed to Portage tree.
I will sync it today (unless I forget about it)
synced and in tree, seems working fine!
> synced and in tree, seems working fine! Let's consider this bug as fixed then.
*** Bug 274505 has been marked as a duplicate of this bug. ***