Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 329159

Summary: emerge -K refuses to honor -protect-owned and -collision-protect
Product: Gentoo Linux Reporter: Raymond Jennings <shentino>
Component: [OLD] Core systemAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: esigra
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 335925    
Attachments: emerge --info portage

Description Raymond Jennings 2010-07-20 20:14:24 UTC
After messing up and accidentally unmerging a python, I untarred it manually and then put it in /usr/portage/packages/dev-lang

Now I'm trying to run emerge -K to make sure all the files are recorded, and I've supplied FEATURES="-protect-owned -collision-protect" both on the command line and in make.conf but emerge is still doing a collision check even though I told it not to.

Reproducible: Always

Steps to Reproduce:
1.  see description

Actual Results:  
scans for collisions

Expected Results:  
doesn't scan for collisions.
Comment 1 Raymond Jennings 2010-07-20 20:17:12 UTC
Created attachment 239601 [details]
emerge --info portage
Comment 2 Zac Medico gentoo-dev 2010-07-20 22:42:25 UTC
There's a error message that's shown for any collisions, regardless of whether protect-owned or collision-protect are enabled. I guess we can add a way to disable the warning, but it's really not recommended to disable protect-owned anyway.
Comment 3 Raymond Jennings 2010-07-21 21:52:04 UTC
True, generally that is the case.

However, there is a special case where you need to manually untar a package to fix a broken portage.  This has a side effect of creating orphans that you know will be recorded by an emerge -K of the same package.

In this special case, and most likely others, even checking for collisions is superfluous, in which case specifying -collision-protect and -protect-owned together should be allowed to instruct portage not to do a collision check.

Mostly because checking for collisions that the admin already knows are bogus is a waste of CPU time.
Comment 4 Zac Medico gentoo-dev 2010-07-22 16:28:16 UTC
It's actually the owners lookup that wastes time, while the collision check is relatively quick. So, I'll go ahead and disable the owners lookup, while leaving the quick collision check in place. Also, the owners lookup is optimized for small numbers of files, so I plan to make it use a different algorithm for larger numbers of files.
Comment 5 Zac Medico gentoo-dev 2010-07-25 21:43:11 UTC
(In reply to comment #4)
> Also, the owners lookup is
> optimized for small numbers of files, so I plan to make it use a different
> algorithm for larger numbers of files.

This part is fixed here:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c4fdf0e53398e4917c64901da626ced4c6357010
Comment 6 Zac Medico gentoo-dev 2010-07-25 21:48:09 UTC
(In reply to comment #4)
> It's actually the owners lookup that wastes time, while the collision check is
> relatively quick. So, I'll go ahead and disable the owners lookup, while
> leaving the quick collision check in place.

The owners lookup is disabled here:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=39e813686999f4ea530938b500f5107fd5d78ab6
Comment 7 Zac Medico gentoo-dev 2010-08-23 06:31:09 UTC
This is in 2.2_rc68, but I'll leave this bug open until it's in an unmasked version.
Comment 8 Zac Medico gentoo-dev 2010-09-04 08:40:53 UTC
This is fixed in 2.1.9.
Comment 9 tomciaaa 2010-09-27 13:13:44 UTC
(In reply to comment #8)
> This is fixed in 2.1.9.
> 

Just for saving anyone else a painful moment of smacking oneself to the forehead:
as of today (27.09.2010) 2.1.9 is still masked and you need to use ACCEPT_KEYWORDS to actually install it.