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

Bug 226307

Summary: Unable to unmerge packages referenced in a set with a different slot
Product: Portage Development Reporter: Marco Albanese <delian2>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: ag
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 144480, 210077    
Attachments: fix matching of sets against packages, analogous to bug 218854

Description Marco Albanese 2008-06-13 12:19:22 UTC
When I've tried to unmerge the kde-4.0.4 stuff emerge complain the package is related to a set.

Reproducible: Always

Steps to Reproduce:
1.Unmerge a package refereced in a set with a different slot
2.
3.

Actual Results:  
emerge -C =kde-base/sweeper-4.0.4
Not unmerging package kde-base/sweeper-4.0.4 as it is
still referenced by the following package sets:      
    kdeutils-meta                                    


>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

>>> Waiting 5 seconds before starting...
>>> (Control-C to abort)...             
>>> Unmerging in: 5 4 3 2 1             

 * GNU info directory index is up-to-date.
Traceback (most recent call last):        
  File "/usr/bin/emerge", line 18, in ?   
    retval = _emerge.emerge_main()        
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 9334, in emerge_main
    post_emerge(trees, mtimedb, os.EX_OK)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 6903, in post_emerge
    display_news_notification(trees)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 6821, in display_news_notification
    unreadItems = checkUpdatedNewsItems(
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 6994, in checkUpdatedNewsItems
    return manager.getUnreadItems( repo_id, update=True )
  File "/usr/lib/portage/pym/portage/news.py", line 133, in getUnreadItems
    self.updateItems(repoid)
  File "/usr/lib/portage/pym/portage/news.py", line 87, in updateItems
    config=self.config, vardb=self.vdb):
  File "/usr/lib/portage/pym/portage/news.py", line 202, in isRelevant
    if restriction.checkRestriction(**kwargs):
  File "/usr/lib/portage/pym/portage/news.py", line 281, in checkRestriction
    if vdb.match(self.cpv):
  File "/usr/lib/portage/pym/portage/dbapi/vartree.py", line 529, in match
    mydep = dep_expand(
  File "/usr/lib/portage/pym/portage/__init__.py", line 5911, in dep_expand
    return portage.dep.Atom(prefix + expanded + postfix)
  File "/usr/lib/portage/pym/portage/dep.py", line 400, in __init__
    raise InvalidAtom(s)
portage.exception.InvalidAtom: || ( app-office/akonadi kde-base/plasma )


Expected Results:  
unmerge the package

I've installed two slotted version of kde4: kde-4.0.4 and kde-svn(from the kde-live overlay).
When I've tried to unmerge the kde-4.0.4 stuff emerge says that:

Not unmerging package kde-base/XXXXXX-4.0.4 as it is
still referenced by the following package sets:

(with XXXXXX as the package name)
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2008-06-27 10:49:37 UTC
*** Bug 229689 has been marked as a duplicate of this bug. ***
Comment 2 Zac Medico gentoo-dev 2008-06-28 01:08:13 UTC
Created attachment 158707 [details, diff]
fix matching of sets against packages, analogous to bug 218854

I tested this by creating a jdk package set, like this:

mkdir -p /etc/portage/sets
echo dev-java/sun-jdk >> /etc/portage/sets/jdk
emerge --noreplace @jdk
emerge -C sun-jdk

It allowed me to unmerge the 1.5 slot but the 1.6 slot stayed installed because it was the highest version. Is there anything left to fix here or does this patch solve everything?
Comment 3 Marco Albanese 2008-06-28 07:50:40 UTC
How do I apply the patch?

I've copied it to /usr/lib/portage and run:
patch -p1 < set_slots.patch
but

can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?

Sorry for the triviality..
Comment 4 Zac Medico gentoo-dev 2008-06-28 08:10:28 UTC
If the patch is saved as /tmp/set_slots.patch, then it can be applied as follows:

cd /usr/lib/portage
patch -p0 < /tmp/set_slots.patch
Comment 5 Alessandro Guido 2008-06-28 09:04:35 UTC
(In reply to comment #4)
> If the patch is saved as /tmp/set_slots.patch, then it can be applied as
> follows:
> 
> cd /usr/lib/portage
> patch -p0 < /tmp/set_slots.patch
> 

It gives:

odino portage # patch -R -p0 <~iro/set_slots.patch
patching file pym/_emerge/__init__.py
Hunk #1 succeeded at 6384 (offset -152 lines).
Hunk #2 succeeded at 6626 (offset -152 lines).
Hunk #3 succeeded at 6636 (offset -152 lines).


Are those safe?
Comment 6 Alessandro Guido 2008-06-28 09:18:29 UTC
The patch fixes the problem for me.

> odino portage # patch -R -p0 <~iro/set_slots.patch
> patching file pym/_emerge/__init__.py
> Hunk #1 succeeded at 6384 (offset -152 lines).
> Hunk #2 succeeded at 6626 (offset -152 lines).
> Hunk #3 succeeded at 6636 (offset -152 lines).

sorry, I pasted the wrong ones. Theese are the
warning it gives me when applying against portage-2.2-rc1

# patch -p0 <~iro/set_slots.patch
patching file pym/_emerge/__init__.py
Hunk #1 succeeded at 6384 (offset -152 lines).
Hunk #2 succeeded at 6639 (offset -152 lines).
Hunk #3 succeeded at 6655 (offset -152 lines).
Comment 7 Zac Medico gentoo-dev 2008-06-28 10:40:55 UTC
(In reply to comment #6)
> # patch -p0 <~iro/set_slots.patch
> patching file pym/_emerge/__init__.py
> Hunk #1 succeeded at 6384 (offset -152 lines).
> Hunk #2 succeeded at 6639 (offset -152 lines).
> Hunk #3 succeeded at 6655 (offset -152 lines).
> 

Yes, it's safe. The hunks are offset because a few other changes have been made to the same file. It doesn't do any harm in this case.
Comment 8 Marco Albanese 2008-06-28 14:53:47 UTC
For me, the patch fix the problem :)

emerge -C sweeper

>>> These are the packages that would be unmerged:
Not unmerging package kde-base/sweeper-9999 as it is
still referenced by the following package sets:
    kdeutils-meta


 kde-base/sweeper
    selected: 4.0.4
   protected: none
     omitted: none

>>> 'Selected' packages are slated for removal.
>>> 'Protected' and 'omitted' packages will not be removed.

Thanks ;)
Comment 9 Zac Medico gentoo-dev 2008-07-12 10:25:17 UTC
Reopening until this is released.
Comment 10 Zac Medico gentoo-dev 2008-07-23 07:54:16 UTC
This is fixed in 2.2_rc2.
Comment 11 bugs.gentoo.org 2009-08-07 22:24:51 UTC
Still getting similar error with 2.2_rc36 when I execute:

emerge -C @kdebase, error message:

...
Not unmerging package kde-base/kdebase-data-4.2.4-r1 as it is
still referenced by the following package sets:
    world

Not unmerging package kde-base/kdm-4.2.4-r1 as it is
still referenced by the following package sets:
    world
....


(In reply to comment #10)
> This is fixed in 2.2_rc2.
> 

Comment 12 Zac Medico gentoo-dev 2009-08-07 22:34:41 UTC
(In reply to comment #11)

See bug #243020 and bug #279449.