public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Short cut for unmerging all packages that are not longer in the tree
@ 2009-10-22 11:14 Helmut Jarausch
  2009-10-22 13:42 ` Johannes Kimmel
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Helmut Jarausch @ 2009-10-22 11:14 UTC (permalink / raw
  To: gentoo-user

Hi,

is there an easy way to unmerge all packages which are no longer in 
the current portage tree.
(Those make problems on update world)

Many thanks for a hint,
Helmut.

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree
  2009-10-22 13:42 ` Johannes Kimmel
@ 2009-10-22 12:09   ` Alan McKinnon
  2009-10-22 13:58     ` Jesús Guerrero
  0 siblings, 1 reply; 8+ messages in thread
From: Alan McKinnon @ 2009-10-22 12:09 UTC (permalink / raw
  To: gentoo-user

On Thursday 22 October 2009 15:42:41 Johannes Kimmel wrote:
> Helmut Jarausch wrote:
> > Hi,
> >
> > is there an easy way to unmerge all packages which are no longer in
> > the current portage tree.
> > (Those make problems on update world)
> >
> > Many thanks for a hint,
> > Helmut.
> 
> if packages are not in the portage tree, they should not be pulled in
> anymore. therefore "emerge --depclean" could help.

depclean only removes packages that it knows for a fact are no longer needed. 
This means

- not in world
- not linked to by anything
- not depended on by anything

"not in the tree" is not part of that list. If you have a package in world 
that is not in the tree anymore, depclean will leave it as is. It will remove 
ancient mere deps that are somehow still lying around though

-- 
alan dot mckinnon at gmail dot com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree
  2009-10-22 11:14 [gentoo-user] Short cut for unmerging all packages that are not longer in the tree Helmut Jarausch
@ 2009-10-22 13:42 ` Johannes Kimmel
  2009-10-22 12:09   ` Alan McKinnon
  2009-10-22 14:05 ` [gentoo-user] " Nikos Chantziaras
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Johannes Kimmel @ 2009-10-22 13:42 UTC (permalink / raw
  To: gentoo-user

Helmut Jarausch wrote:
> Hi,
>
> is there an easy way to unmerge all packages which are no longer in 
> the current portage tree.
> (Those make problems on update world)
>
> Many thanks for a hint,
> Helmut.
>
>   
if packages are not in the portage tree, they should not be pulled in
anymore. therefore "emerge --depclean" could help.

Johannes



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree
  2009-10-22 12:09   ` Alan McKinnon
@ 2009-10-22 13:58     ` Jesús Guerrero
  2009-10-22 14:13       ` Alan McKinnon
  0 siblings, 1 reply; 8+ messages in thread
From: Jesús Guerrero @ 2009-10-22 13:58 UTC (permalink / raw
  To: gentoo-user

On Thu, 22 Oct 2009 14:09:31 +0200, Alan McKinnon
<alan.mckinnon@gmail.com>
wrote:
> On Thursday 22 October 2009 15:42:41 Johannes Kimmel wrote:
>> Helmut Jarausch wrote:
>> > Hi,
>> >
>> > is there an easy way to unmerge all packages which are no longer in
>> > the current portage tree.
>> > (Those make problems on update world)
>> >
>> > Many thanks for a hint,
>> > Helmut.
>> 
>> if packages are not in the portage tree, they should not be pulled in
>> anymore. therefore "emerge --depclean" could help.
> 
> depclean only removes packages that it knows for a fact are no longer
> needed. 
> This means
> 
> - not in world
> - not linked to by anything
> - not depended on by anything
> 
> "not in the tree" is not part of that list. If you have a package in
world 
> that is not in the tree anymore, depclean will leave it as is. It will
> remove 
> ancient mere deps that are somehow still lying around though

Yep, if the package is in world, delclean will not help.

You could always do it the bash way. I have no idea if there's any tool
out there that will make this easier, but it's simple enough to script it,
something like this should work:

qlist -I --nocolor | while read pkg; do
  if [ ! -d "/var/portage/$pkg" ]; then
    echo "$pkg is not in portage"
  fi
done

This will not catch overlays, but it could be easily extended to do so,
it's just a generic (and untested) example. It should work I guess. It just
dumps the list of installed packages, then tries to find a dir with the
same name under your portage directory and if it doesn't exist then the
package name is printed.

-- 
Jesús Guerrero



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [gentoo-user]  Re: Short cut for unmerging all packages that are not longer in the tree
  2009-10-22 11:14 [gentoo-user] Short cut for unmerging all packages that are not longer in the tree Helmut Jarausch
  2009-10-22 13:42 ` Johannes Kimmel
@ 2009-10-22 14:05 ` Nikos Chantziaras
  2009-10-22 14:16 ` [gentoo-user] " Neil Bothwick
  2009-10-22 14:39 ` Helmut Jarausch
  3 siblings, 0 replies; 8+ messages in thread
From: Nikos Chantziaras @ 2009-10-22 14:05 UTC (permalink / raw
  To: gentoo-user

On 10/22/2009 02:14 PM, Helmut Jarausch wrote:
> Hi,
>
> is there an easy way to unmerge all packages which are no longer in
> the current portage tree.
> (Those make problems on update world)
>
> Many thanks for a hint,
> Helmut.

Quick 'n dirty one-liner:

   for f in $(qlist -IC); do stat /usr/portage/"$f" > /dev/null; done

For packages not in the tree, you will get something like:

   stat: cannot stat `/usr/portage/x11-themes/foobar': No such file
   or directory

meaning that x11-themes/foobar is not in the tree.  Of course this 
doesn't check overlays.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree
  2009-10-22 13:58     ` Jesús Guerrero
@ 2009-10-22 14:13       ` Alan McKinnon
  0 siblings, 0 replies; 8+ messages in thread
From: Alan McKinnon @ 2009-10-22 14:13 UTC (permalink / raw
  To: gentoo-user

On Thursday 22 October 2009 15:58:17 Jesús Guerrero wrote:
> > depclean only removes packages that it knows for a fact are no longer
> > needed. 
> > This means
> > 
> > - not in world
> > - not linked to by anything
> > - not depended on by anything
> > 
> > "not in the tree" is not part of that list. If you have a package in
> 
> world 
> 
> > that is not in the tree anymore, depclean will leave it as is. It will
> > remove 
> > ancient mere deps that are somehow still lying around though
> 
> Yep, if the package is in world, delclean will not help.
> 
> You could always do it the bash way. I have no idea if there's any tool
> out there that will make this easier, but it's simple enough to script it,
> something like this should work:
> 
> qlist -I --nocolor | while read pkg; do
>   if [ ! -d "/var/portage/$pkg" ]; then
>     echo "$pkg is not in portage"
>   fi
> done
> 
> This will not catch overlays, but it could be easily extended to do so,
> it's just a generic (and untested) example. It should work I guess. It just
> dumps the list of installed packages, then tries to find a dir with the
> same name under your portage directory and if it doesn't exist then the
> package name is printed.
> 


The best place for this would be 

equery orphan <params>

or similar. I'm sure the maintainer will gratefully accept patches :-)

-- 
alan dot mckinnon at gmail dot com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree
  2009-10-22 11:14 [gentoo-user] Short cut for unmerging all packages that are not longer in the tree Helmut Jarausch
  2009-10-22 13:42 ` Johannes Kimmel
  2009-10-22 14:05 ` [gentoo-user] " Nikos Chantziaras
@ 2009-10-22 14:16 ` Neil Bothwick
  2009-10-22 14:39 ` Helmut Jarausch
  3 siblings, 0 replies; 8+ messages in thread
From: Neil Bothwick @ 2009-10-22 14:16 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

On Thu, 22 Oct 2009 13:14:28 +0200 (CEST), Helmut Jarausch wrote:

> is there an easy way to unmerge all packages which are no longer in 
> the current portage tree.

eix-test-obsolete can produce a list of installed packages that are no
longer in portage.


-- 
Neil Bothwick

My brain's in gear, neutral's a gear ain't it?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-user] Short cut for unmerging all packages that are not longer in the tree
  2009-10-22 11:14 [gentoo-user] Short cut for unmerging all packages that are not longer in the tree Helmut Jarausch
                   ` (2 preceding siblings ...)
  2009-10-22 14:16 ` [gentoo-user] " Neil Bothwick
@ 2009-10-22 14:39 ` Helmut Jarausch
  3 siblings, 0 replies; 8+ messages in thread
From: Helmut Jarausch @ 2009-10-22 14:39 UTC (permalink / raw
  To: gentoo-user

Thanks to all of you for your help,
Helmut.

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-10-22 14:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-22 11:14 [gentoo-user] Short cut for unmerging all packages that are not longer in the tree Helmut Jarausch
2009-10-22 13:42 ` Johannes Kimmel
2009-10-22 12:09   ` Alan McKinnon
2009-10-22 13:58     ` Jesús Guerrero
2009-10-22 14:13       ` Alan McKinnon
2009-10-22 14:05 ` [gentoo-user] " Nikos Chantziaras
2009-10-22 14:16 ` [gentoo-user] " Neil Bothwick
2009-10-22 14:39 ` Helmut Jarausch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox