Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274760 - getting app-admin/eselect to work for prefix
Summary: getting app-admin/eselect to work for prefix
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords: InVCS
: 274505 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-20 02:34 UTC by Jacob Godserv
Modified: 2009-08-23 15:28 UTC (History)
2 users (show)

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


Attachments
Proposed eselect-1.1.1-r1 ebuild (eselect-1.1.1-r1.ebuild,2.30 KB, text/plain)
2009-06-20 02:35 UTC, Jacob Godserv
Details
Proposed fix for bug #274759 (eselect-1.1.1-buggy-bashcomp-dirs.patch,373 bytes, patch)
2009-06-20 02:37 UTC, Jacob Godserv
Details | Diff
Proposed eselect patch for Prefix support (eselect-1.1.1-prefix.patch,808 bytes, patch)
2009-06-20 02:39 UTC, Jacob Godserv
Details | Diff
eselect-1.1.1-prefix.patch (eselect-1.1.1-prefix.patch,27.83 KB, patch)
2009-06-20 15:34 UTC, Fabian Groffen
Details | Diff
Ebuild for pre-release version (eselect-1.2_pre1.ebuild,2.04 KB, text/plain)
2009-08-15 13:06 UTC, Ulrich Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Godserv 2009-06-20 02:34:48 UTC
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
Comment 1 Jacob Godserv 2009-06-20 02:35:54 UTC
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
Comment 2 Jacob Godserv 2009-06-20 02:37:09 UTC
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.
Comment 3 Jacob Godserv 2009-06-20 02:39:13 UTC
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
Comment 4 Fabian Groffen gentoo-dev 2009-06-20 12:32:16 UTC
I don't think we have to hardcode the prefix in like you did, as eselect is autoconfed
Comment 5 Fabian Groffen gentoo-dev 2009-06-20 15:34:28 UTC
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?
Comment 6 Fabian Groffen gentoo-dev 2009-06-20 15:35:35 UTC
ohw, please note that I forgot to add @PREFIX@ to bin/Makefile.in in the dosed.
Comment 7 Ulrich Müller gentoo-dev 2009-06-20 17:01:52 UTC
> @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?
Comment 8 Fabian Groffen gentoo-dev 2009-06-28 20:06:35 UTC
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.
Comment 9 Ulrich Müller gentoo-dev 2009-08-15 12:32:06 UTC
(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?
Comment 10 Ulrich Müller gentoo-dev 2009-08-15 13:06:42 UTC
Created attachment 201325 [details]
Ebuild for pre-release version
Comment 11 Jacob Godserv 2009-08-18 11:59:44 UTC
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.
Comment 12 Ulrich Müller gentoo-dev 2009-08-18 13:09:06 UTC
(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.
Comment 13 Jacob Godserv 2009-08-18 13:26:51 UTC
(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! :)
Comment 14 Ulrich Müller gentoo-dev 2009-08-19 19:29:41 UTC
eselect-1.2_rc1 committed to Portage tree.
Comment 15 Fabian Groffen gentoo-dev 2009-08-19 19:34:52 UTC
I will sync it today (unless I forget about it)
Comment 16 Fabian Groffen gentoo-dev 2009-08-19 20:54:45 UTC
synced and in tree, seems working fine!
Comment 17 Ulrich Müller gentoo-dev 2009-08-19 22:21:10 UTC
> synced and in tree, seems working fine!

Let's consider this bug as fixed then.
Comment 18 Ulrich Müller gentoo-dev 2009-08-23 15:28:21 UTC
*** Bug 274505 has been marked as a duplicate of this bug. ***