Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 435006 - media-libs/qhull-2012.1-r1 - Installation of a symlink is blocked by a directory: '/usr/include/qhull'
Summary: media-libs/qhull-2012.1-r1 - Installation of a symlink is blocked by a direct...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-14 10:41 UTC by Yann Leprince
Modified: 2012-09-18 16:40 UTC (History)
1 user (show)

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 Yann Leprince 2012-09-14 10:41:18 UTC
When updating to media-libs/qhull-2012.1-r1 the following error message appears in the Portage output:

>>> Messages generated by process 3046 on 2012-09-14 12:22:09 CEST for package media-libs/qhull-2012.1-r1:

ERROR: preinst

Installation of a symlink is blocked by a directory:
  '/usr/include/qhull'
This symlink will be merged with a different name:
  '/usr/include/qhull.backup.0000'

Here is a listing of the files referred to in the message:
$ ls -ld /usr/include/qhull*
drwxr-xr-x 2 root root 4096 Sep 14 12:22 /usr/include/qhull
lrwxrwxrwx 1 root root    8 Sep 14 12:22 /usr/include/qhull.backup.0000 -> libqhull
$ ls -l /usr/include/qhull
total 0

Reproducible: Didn't try

Steps to Reproduce:
1. Upgrade to media-libs/qhull-2012.1-r1.
Actual Results:  
Error message appears.

Expected Results:  
Upgrade completes without error message.

$ emerge --info
Portage 2.1.11.9 (default/linux/amd64/10.0/desktop/gnome, gcc-4.5.4, glibc-2.15-r2, 3.4.9-gentoo x86_64)
=================================================================
System uname: Linux-3.4.9-gentoo-x86_64-Intel-R-_Core-TM-_i5-2430M_CPU_@_2.40GHz-with-gentoo-2.1
Timestamp of tree: Fri, 14 Sep 2012 00:45:01 +0000
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.8-r3
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.9.6-r3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo x-portage-overlay
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE Ximian-logos"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -ggdb1"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -ggdb1"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-march=native -O2 -pipe -ggdb1"
FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch webrsync-gpg xattr"
FFLAGS="-march=native -O2 -pipe -ggdb1"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://mirror.ovh.net/gentoo-distfiles/"
LANG="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr en"
MAKEOPTS="-j5 -l4"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-4"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/yann/portage-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cli colord consolekit cracklib crypt cups cxx dbus djvu dri dts dvd dvdr eds emacs emboss encode evo exif fam fat fftw firefox flac fontconfig fortran ftp gdbm gif gmp gnome gnome-keyring gnome-online-accounts gphoto2 graphviz gsettings gstreamer gtk gtk3 gtkstyle iconv ipv6 jbig jingle jpeg jpeg2k latex lcms ldap libnl libnotify lzma mad matroska mmx mng modules mp3 mp4 mpeg mtp mudflap multilib musepack nautilus ncurses networkmanager nls nptl nsplugin ogg opengl openmp pam pango pcmcia pcre pdf png policykit postscript ppds pppd qt3support qt4 readline scanner schroedinger sdl session smp socialweb sound speex spell sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 startup-notification subversion svg tcpd theora threads tiff truetype udev udisks unicode upower usb vaapi vorbis wifi wmf wxwidgets x264 xattr xcb xft xml xmp xv xvid zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="fr en" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Thomas Kahle (RETIRED) gentoo-dev 2012-09-17 02:13:11 UTC
Hi, thanks for your report, but I think this is not a bug, but just some old files still on your system.
Please unmerge all versions of qhull and check if you still have a directory 
/usr/include/qhull.  (you should not).  If you still have one, then please check with 
equery b /usr/include/qhull
if a package claims ownership.  If not, it is safe to delete that directory.
Please reopen if you still have problems after that procedure. Thanks.
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2012-09-17 05:28:01 UTC
it reproducable here.

emerge =qhull-2010*
emerge =qhull-2012*

and you get this bug.
Comment 3 Thomas Kahle (RETIRED) gentoo-dev 2012-09-17 15:31:44 UTC
(In reply to comment #2)
> it reproducable here.
> 
> emerge =qhull-2010*
> emerge =qhull-2012*
> 
> and you get this bug.

Hmm, is that a portage bug?  Since 

> emerge =qhull-2010*
> emerge -C qhull
> emerge =qhull-2012*

works I would think so.  The problem seems to be that on this upgrade path /usr/include/qhull changes from a directoy to a symlink and the symlink.
Comment 4 Zac Medico gentoo-dev 2012-09-17 16:43:10 UTC
(In reply to comment #3)
> Hmm, is that a portage bug?  Since works I would think so.  The problem seems
> to be that on this upgrade path /usr/include/qhull changes from a directoy to a
> symlink and the symlink.

That's the intended behavior, since PMS forbids packages to replace directories with symlinks (see bug #326685). Normally, it bails out at the collision-protect phase, but I guess the user temporarily disable collision protection.

You can use src_install and pkg_preinst to resolve the collision like this:

  src_install() {
    # remove symlink to avoid triggering collision-protect or protect-owned
    rm "${D}"/usr/include/qhull
  }

  pkg_preinst() {
    # remove directory in $ROOT that collides with symlink
    rm -rf "${ROOT}"usr/include/qhull
    # create symlink in $D to be merged where the directory was
    ln -s libqhull "${D}"/usr/include/qhull
  }
Comment 5 Thomas Kahle (RETIRED) gentoo-dev 2012-09-18 16:40:51 UTC
(In reply to comment #4)
> That's the intended behavior, since PMS forbids packages to replace
> directories with symlinks (see bug #326685). Normally, it bails out at the
> collision-protect phase, but I guess the user temporarily disable collision
> protection.

There are two separate things to consider:  This package has two versions 2010 and 2012 say.  When upgrading to version 2012, the directory /usr/include/qhull is moved to /usr/include/libqhull and for backwords compatibility a symlink is put in /usr/include/qhull.  Appearently this is forbidden by PMS.  Therefore I introduced 

pkg_preinst() {
    rm -rf "${ROOT}"usr/include/qhull
  }

in qhull version 2012.  Now, if a user tries to downgrade back to version 2010, they run into a collision protect situation.  Your source install method will not prevent this.  Therefore I used the same trick and added the same pkg_preinst to version one of the ebuild.  It is a hack, but I don't see another way to comply with PMS here.  I did the replacements in the stable versions since users who already installed this should not be affected.  I did not touch qhull-3.1-r1 since that is EAPI=0.  Downgrading from 2012 to this version is therefore not supported.