Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156464 - portage ebuild installs relative symbolic links rather than absolute ones
Summary: portage ebuild installs relative symbolic links rather than absolute ones
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-27 17:48 UTC by Eugene St Leger
Modified: 2006-11-27 20:08 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 Eugene St Leger 2006-11-27 17:48:35 UTC
Every time I reinstall portage, the symbolic links created in /usr/bin/ are broken, and I have to fix them.  I have /usr/ and /usr/lib/ on one partition, and I have moved /usr/bin/ to another partition and symbolically linked it.

partition 1: /usr/ and /usr/lib/
partition 2: /usr/bin/

# ls -lh /usr/bin/ | grep -i "\.\." | tr -s ' ' | cut -f9- -d' '
ebuild -> ../lib/portage/bin/ebuild
emerge -> ../lib/portage/bin/emerge
portageq -> ../lib/portage/bin/portageq
repoman -> ../lib/portage/bin/repoman
tbz2tool -> ../lib/portage/bin/tbz2tool
xpak -> ../lib/portage/bin/xpak

The problem is that .. is not uniquely determined in Unix.  /usr/bin/.. != /usr/ on my system, but rather /usr/bin/.. == /mnt/hda/hda4/gentoo/usr/.

src_install() in portage-2.1.2_rc2-r2.ebuild has the offending lines.

for x in ebuild emerge portageq repoman tbz2tool xpak; do
        dosym ../lib/portage/bin/${x} /usr/bin/${x}
done

for x in ${my_syms}; do
        dosym ../lib/portage/bin/${x} /usr/sbin/${x}
done

Most packages seem to use absolute symbolic links, and I think sys-apps/portage should do the same.

# emerge --info
Portage 2.1.2_rc2-r2 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.5-r0, 2.6.19-rc5-mm1 i686)
=================================================================
System uname: 2.6.19-rc5-mm1 i686 AMD Duron(TM)
Gentoo Base System version 1.12.6
Last Sync: Mon, 27 Nov 2006 07:50:01 +0000
ccache version 2.4 [disabled]
dev-lang/python:     2.4.4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r2
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17.50.0.6
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-tbird -mmmx -m3dnow -O2 -fomit-frame-pointer -floop-optimize -funroll-loops -fbranch-target-load-optimize -funswitch-loops -maccumulate-outgoing-args -minline-all-stringops -ffast-math -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=athlon-tbird -mmmx -m3dnow -O2 -fomit-frame-pointer -floop-optimize -funroll-loops -fbranch-target-load-optimize -funswitch-loops -maccumulate-outgoing-args -minline-all-stringops -ffast-math -pipe -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer parallel-fetch sandbox sfperms strict userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,-z,combreloc"
LINGUAS="en_GB"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 3dnow X Xaw3d a52 aac aalib acl acpi alsa apache2 apm arts async automount bash-completion berkdb bitmap-fonts bzip2 cdb cdparanoia cdr cli cracklib crypt cups curl dbus dga dio directfb dlloader dri dts dvb dvd dvdread eds elibc_glibc emacs emacs-w3 emboss encode esd exif expat fam fbcon ffmpeg fftw firefox flac flash foomaticdb fortran ftp gb gd gdbm ggi gif glut gnome gnutls gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hal iconv idn imagemagick imap imlib input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog jabber javascript joystick jpeg jpeg2k kde kernel_linux lcms ldap libcaca libg++ libnotify libwww linguas_en_GB lm_sensors logrotate mad mikmod mime ming mmx mng motif mp3 mpeg mpi msn mysql mysqli nas ncurses nls nptl offensive ogg openal opengl oss pam pcre pdf perl plotutils png posix pppd python qt3 qt4 quicktime readline reflection samba sasl scanner sdl session skey snmp speex spell spl ssl svg svga szip tcpd tetex theora threads tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU v4l vcd vhosts video_cards_fbdev video_cards_radeon video_cards_vesa video_cards_vga vorbis wifi win32codecs wmf wxwindows xine xinerama xml xorg xpm xprint xv xvid zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2006-11-27 17:53:04 UTC
This is by design, absolute symlinks create other problems. I'd recommend you get rid of that symlink and properly mount the partition at the right location.
Comment 2 SpanKY gentoo-dev 2006-11-27 20:08:04 UTC
each type has pro/cons, but generally with other packages we've been changing from relative to absolute symlinks when crossing certain path boundaries

however, it's assumed that you can use relative symlinks when working within the /usr subdir as the bin/lib/share subdirs should all be on the same partition:
/usr/bin/foo -> ../lib/foo (OK)
/usr/lib/bar -> ../bin/bar (OK)
/usr/lib/meow -> ../share/meow (OK)
/usr/bin/boo -> ../../bin/boo (not OK)

rather than using a symlink for /usr/bin, a bind mount would work better with minimal effort on your end