Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 90089 - dev-util/yacc sys-devel/bison collision
Summary: dev-util/yacc sys-devel/bison collision
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Patrice Clement (RETIRED)
URL:
Whiteboard:
Keywords: PullRequest
: 148537 159059 159867 192914 652782 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-22 18:20 UTC by Marco de Vito
Modified: 2022-12-03 13:23 UTC (History)
14 users (show)

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


Attachments
irc log of discussion of this issue with zmedico (README-yacc-bison-collision.txt,3.27 KB, text/plain)
2008-06-06 11:33 UTC, Peter Volkov (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco de Vito 2005-04-22 18:20:45 UTC
I could'nt merge dev-util/yacc-1.9.1-r2 - while emergig this package tried to overwrite files belonging to other packages. 

Need this package - i want to emerge apache

Reproducible: Always
Steps to Reproduce:
1.start the system
2.emerge -av apache
3.here we are, not possible to emerge dev-util/yacc-1.9.1-r2

Actual Results:  
not possible to emerge dev-util/yacc-1.9.1-r2


Expected Results:  
emerge dev-util/yacc-1.9.1-r2 and then install the apache-package

this package was not emerged because it wants to overwrite packeges that
belonging to other packages...
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-04-23 02:52:34 UTC
Post the exact error message, please. 
Comment 2 Marco de Vito 2005-04-24 16:25:25 UTC
bash-2.05b$ su
Password: 
bash-2.05b# emerge apache
Calculating dependencies ...done!
>>> emerge (1 of 2) dev-util/yacc-1.9.1-r2 to /
>>> md5 files   ;-) yacc-1.9.1-r2.ebuild
>>> md5 files   ;-) yacc-1.9.1-r1.ebuild
>>> md5 files   ;-) ChangeLog
>>> md5 files   ;-) files/digest-yacc-1.9.1-r1
>>> md5 files   ;-) files/digest-yacc-1.9.1-r2
>>> md5 files   ;-) files/mkstemp.patch
>>> md5 files   ;-) files/yacc-1.9.1-ia64.patch
>>> md5 src_uri ;-) yacc-1.9.1.tar.Z
>>> Unpacking source...
>>> Unpacking yacc-1.9.1.tar.Z to /var/tmp/portage/yacc-1.9.1-r2/work
 * Applying mkstemp.patch ...                                             [ ok ]
 * Applying yacc-1.9.1-ia64.patch ...                                     [ ok ]
>>> Source unpacked.
rm yacc
i686-pc-linux-gnu-gcc -march=athlon-xp -O3 -pipe -fomit-frame-pointer -o yacc cl
osure.c error.c lalr.c lr0.c main.c mkpar.c output.c reader.c skeleton.c symtab.
c verbose.c warshall.c
>>> Test phase [not enabled]: dev-util/yacc-1.9.1-r2

>>> Install yacc-1.9.1-r2 into /var/tmp/portage/yacc-1.9.1-r2/image/ category de
v-util
man:
prepallstrip:
strip: i686-pc-linux-gnu-strip --strip-unneeded
strip: i686-pc-linux-gnu-strip --strip-unneeded
   usr/bin/yacc
>>> Completed installing yacc-1.9.1-r2 into /var/tmp/portage/yacc-1.9.1-r2/image
/

* checking 9 files for package collisions
existing file /usr/bin/yacc is not owned by this package
* spent 0.000842809677124 seconds checking for file collisions
* This package is blocked because it wants to overwrite
* files belonging to other packages (see messages above).
* If you have no clue what this is all about report it 
* as a bug for this package on http://bugs.gentoo.org

package dev-util/yacc-1.9.1-r2 NOT merged

No package files given... Grabbing a set.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2005-04-25 02:47:37 UTC
Do you have sys-devel/bison installed? Is /usr/bin/yacc a symlink?
Comment 4 Seemant Kulleen (RETIRED) gentoo-dev 2005-04-25 04:43:35 UTC
Marco, please respond to the above comment
Comment 5 Marco de Vito 2005-04-27 01:43:46 UTC
bash-2.05b# emerge search bison
Searching...   
[ Results for search key : bison ]
[ Applications found : 1 ]
 
*  sys-devel/bison
      Latest version available: 1.875d
      Latest version installed: 1.875d
      Size of downloaded files: 862 kB
      Homepage:    http://www.gnu.org/software/bison/bison.html
      Description: A yacc-compatible parser generator
      License:     GPL-2


bash-2.05b# 
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2005-04-27 05:18:14 UTC
OK. See Bug 82849 (http://bugs.gentoo.org/show_bug.cgi?id=82849#c2 explains this). 

Clean solution: emerge -C sys-devel/bison && emerge dev-util/yacc && emerge sys-devel/bison

Quick
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2005-04-27 05:18:14 UTC
OK. See Bug 82849 (http://bugs.gentoo.org/show_bug.cgi?id=82849#c2 explains this). 

Clean solution: emerge -C sys-devel/bison && emerge dev-util/yacc && emerge sys-devel/bison

Quick´n´dirty solution: rm -f /usr/bin/yacc && emerge dev-util/yacc
Comment 8 SpanKY gentoo-dev 2005-04-27 21:05:25 UTC
yacc now contains code to remove & restore the /usr/bin/yacc symlink to /usr/bin/bison when emerging / unmerging

portage will require a change before this will work properly, but that shouldnt be a problem
Comment 9 Daniel Webert 2006-06-12 12:08:39 UTC
pong - still have 1-year-old package collisions overhere
Comment 10 SpanKY gentoo-dev 2006-06-24 23:34:42 UTC
nothing more we can do in the yacc ebuild
Comment 11 SpanKY gentoo-dev 2006-09-22 13:20:05 UTC
*** Bug 148537 has been marked as a duplicate of this bug. ***
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2006-12-25 01:32:03 UTC
*** Bug 159059 has been marked as a duplicate of this bug. ***
Comment 13 Raúl Porcel (RETIRED) gentoo-dev 2007-01-03 09:07:55 UTC
*** Bug 159867 has been marked as a duplicate of this bug. ***
Comment 14 Tobias Hahn 2007-02-20 21:01:20 UTC
IMHO, this is unsatisfactory and ugly. The clean solution would be an eselect-yacc or quick and dirty yacc DEPENDing, but not RDEPENDING on !bison. 
Comment 15 SpanKY gentoo-dev 2007-09-19 14:18:08 UTC
*** Bug 192914 has been marked as a duplicate of this bug. ***
Comment 16 Peter Volkov (RETIRED) gentoo-dev 2008-06-06 11:31:52 UTC
Mike, please, take a look at this bug.

I have to reopen this bug as portage will never handle managing symlinks in
pkg_preinstall/postinstall correctly. Quoting zmedico:

"collision-protect runs before preinst because we specifically want to avoid
executing any ebuild phases if there is a file collision"

Or take a look at his comments for bug #147446 where he explains this in more
details. This means that current fix does not and will never fix collision
protection issue.

I've talked with zmedico about this issue and he told that eselect module is
the most correct way of handling this issues. Such module is written and I'd
like somebody from basesystem to approve commit into the main tree. Take a look
at module itself and updated yacc/bison packages in my overlay. To simplify you
testing this here are comment you could cut&paste into your console:

cd /your/local/overlay
svn co http://overlays.gentoo.org/svn/dev/pva/dev-util/yacc dev-util/yacc
svn co http://overlays.gentoo.org/svn/dev/pva/sys-devel/bison sys-devel/bison
svn co http://overlays.gentoo.org/svn/dev/pva/app-admin/eselect-yacc app-admin/eselect-yacc
echo -e "sys-devel/bison\ndev-util/yacc\napp-admin/eselect-yacc" >> /etc/portage/package.keywords

Comment 17 Peter Volkov (RETIRED) gentoo-dev 2008-06-06 11:33:03 UTC
Created attachment 155711 [details]
irc log of discussion of this issue with zmedico
Comment 18 SpanKY gentoo-dev 2008-06-07 15:48:35 UTC
i already know that portage wont allow it, but without a clean solution, i'm not changing it

i dont really care about eselect modules ... if you want to change things, feel free ... doesnt matter to me
Comment 19 Ryan Hill (RETIRED) gentoo-dev 2008-07-22 03:41:31 UTC
i may be missing something obvious, but can we install yacc as oldyacc or something and then make /usr/bin/yacc a wrapper that runs

#!/bin/sh
if [[ -x /usr/bin/oldyacc ]]; then 
  exec /usr/bin/oldyacc "$@"
else
  exec /usr/bin/bison -y "$@"
fi

this would give the same functionality we have now.  if bison is installed yacc calls bison -y, unless yacc is also installed in which case you get yacc.

install the wrapper as part of bison, which is in base/packages meaning everyone should have it in system.  (are there any valid reasons for not having it installed?)
Comment 20 Ulrich Müller gentoo-dev 2010-08-27 15:34:49 UTC
(In reply to comment #16)
> I've talked with zmedico about this issue and he told that eselect module is
> the most correct way of handling this issues. Such module is written and I'd
> like somebody from basesystem to approve commit into the main tree. Take a
> look at module itself and updated yacc/bison packages in my overlay.

I'm not in basesystem, but anyway, here are some remarks about the eselect module:
- A relative symlink should be used, not an absolute one.
- The module should be updated to support eselect's --brief option.
  (See bug 154511 comment #5 for this, or kernel.eselect as an example.)
- In view of bison already being in the Prefix overlay, it might be wise to
  support Prefix, i.e. use EROOT and EPREFIX variables instead of ROOT.
Comment 21 Patrice Clement (RETIRED) gentoo-dev 2020-06-04 07:26:08 UTC
*** Bug 652782 has been marked as a duplicate of this bug. ***
Comment 22 Larry the Git Cow gentoo-dev 2022-12-02 21:16:10 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7aec318c57c9af54d5e454e9c7e93239415b5629

commit 7aec318c57c9af54d5e454e9c7e93239415b5629
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-12-02 04:40:00 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-12-02 21:09:50 +0000

    dev-util/yacc: support app-alternatives/yacc
    
    Closes: https://bugs.gentoo.org/90089
    Signed-off-by: Sam James <sam@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/28502
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-util/yacc/yacc-1.9.1-r7.ebuild | 44 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)