View previous topic :: View next topic |
Author |
Message |
xchris Advocate
Joined: 10 Jul 2003 Posts: 2824
|
Posted: Thu Dec 02, 2004 9:57 am Post subject: [TOOL]-Unclepine-Recursive Unmerge & Cleaning Tool _b18 |
|
|
Unclepine - ver 0.1_beta18
Code: |
wget http://www.xchris.net/download.php?file=files/unclepine/unclepine-latest.tar.gz -O unclepine.tar.gz
|
http://www.xchris.net/download.php?file=files/unclepine/unclepine-latest.tar.gz
I really didn't know if it was worth posting...
..because of dep-hepta ,portage patch for recursive unmerge and future plan for portage (which will support recursive unmerge)
When i started writing this i didn't know about these things.
Anyway...
FIRST -USE AT YOUR OWN RISK
What is Unclepine?
A tool for dependencies jobs written in python.
Which are the main functions?
- show direct ad reverse dependencies of one or more packages
- simulates a recursive unmerge
- simulates a safe depclean with also unused slot deps.
- shows circular dependencies
- shows entire system with dependencies
- shows virtual packages (as portage now calculates them on the fly)
- shows world file and deps
Will it damage my system?
- unclepine by itself does no modifications to your system
- it marks system and world packages
- it has however a -x switch to pipe some results to whatever you want
(which will never pass any system or world package)
How it reads dependencies?
- it has a combined reading method
- /var/db/pkg for taking care of not unmerging needed libs
- /var/cache/edb/dep for taking care of not removing needed package by portage
This combined method has been choosen to act in safe mode
(for advanced user it's possible to change this behavior)
What about useflags?
- it uses by default compile time useflags
- it can use in addiction also system use
(for advanced users it's possible to use only systemuse)
What about depend files?
- by default it uses DEPEND,PDEPEND,RDEPEND
(for advanced user you can conbine one or more)
What about kernel packages
This is a strange case.When you merge a kernel package it doesn't mean that it is installed and currently used!!! So...be carefull not to unmerge your current tree.
Is it fast?
Not that much..for direct and inverse dependencies checks because it firstly build an internal database.
Fast enough for --unliked and --deep-unmerge tasks.
However it has a micro-console to speedup repeated use.
(on my machine a recursive unmerge takes about 5 seconds)
Is it all written from scratch?
Mostly.However it uses few (important) portage functions.
Is it bug free?
NO
If you try it and something doesn't work drop a post.
Often corrupted /var/db/pkg makes unclepine fail.
(it's a good way for checking its correctness)
First try to remerge a suspicious package.
There are two hidden switches: --notify --debug
--debug ...guess what
--notify ...it shows if it has problems of dependencies atom reading
(if you wanna report me a bug by mail please use it! unclepine -u -c --debug > debug.file)
Examples of common tasks
- let's simulate a removal (mplayer)
Code: |
unclepine -du mplayer
|
(if mplayer is free.. it will print out a list of uneeded packages otherwise it will complain)
let's suppose mplayer is needed by other package (kmplayer) and unclepine doesn't want to simulate.
Code: |
unclepine -du mplayer kmplayer
|
(will now work)
-let's search for zombie packages
-let's suppose we do not want qt libs on our system (so we want to remove all dependencies of qt and packages using them)
Code: |
unclepine -db qt -x | xargs unclepine -du (doesn't work anymore...due to a bug discovered)
|
for other options use --help function.
Code: |
root@lyra xchris # unclepine -h
UnclePine 0.1_beta8 - Tool for dependencies jobs
Usage: unclepine SEARCH_METHOD [ OPTIONS ] [ ARGUMENTS ]
unclepine ( -db | -df | -du | -di | -u | -r | -sd | -sw | -sv | -ic ) [ -c , -nc , -cu , -su , -f , -pd , -m , -x , -v ] [ PKG1 PKG2 ... PKG-N ]
-h , --help
shows this help screen
ARGUMENTS
- One ore more package name in these formats:
- cat/app
- app
- =cat/app-ver
- None for -u,-sd,-sw,-sv,-ic,-r,-dc actions
SEARCH_METHOD
-db , --depend-by
list inverse dependencies for PKG(S) given
-df , --depend-from
list direct dependencies for PKG(S) given
-di , --deps-inspect
list cumulative inverse/direct dependencies for PKG(S) given
-dc , --deps-check
checks current dependencies against ones from updated portage
-du , --deep-unmerge
list packages that are not needed anymore
if PKG(S) are removed
-u , --unlinked
list packages not needed anymore,according to
your portage settings.BE CAREFUL!!!
-r , --recursive
shows circular dependencies
-sd , --show-db
shows every package installed with its direct
dependencies
-sw , --show-world
shows world file and marks dependent packages
-sv , --show-virtuals
shows virtuals and packages providing them
-ic , --interactive-console
starts an interactive console
OPTIONS
-c ,--color
forced output with color
(if you want colors also when piping to other commands)
-nc ,--no-color
output with no color
-cu ,--compile-use
consider useflags used during compiling
(DEFAULT MODE)
-su ,--system-use
consider system use
-d , --depend
consider DEPEND dependencies files:
(DEFAULT MODE)
-pd , --pdepend
consider PDEPEND dependencies files:
(DEFAULT MODE)
-m , --manual
unset DEFAULT MODE options for tweaking your search
BE CAREFUL!CAN LEAD TO UNSAFE RESULTS!
-x ,--exec
needed to pipe results to other commands
-v ,--verbose
more verbose output
feedback,bug reports to Christian Cernuschi - xchris at lifegate.it
|
I hope you will like it..as i enjoyed making it (and lot of trouble...)
Tell me if u like it,if u don't ,suggestions ... blah blah
Bye! _________________ while True:Gentoo()
Last edited by xchris on Tue Mar 15, 2005 12:46 pm; edited 17 times in total |
|
Back to top |
|
|
Peach Advocate
Joined: 08 Mar 2003 Posts: 3686 Location: London, UK
|
Posted: Mon Dec 06, 2004 11:55 pm Post subject: Re: [TOOL] - Unclepine - Dependencies jobs |
|
|
xchris wrote: | FIRST -USE AT YOUR OWN RISK |
apart this nice warning, this app really rox! at all...
it's strange noone already replyed to this post. Maybe a better title would be better.
it's worth a try!
I'm really happy with it when I need to resolve reverse dependecies of packages I need to uninstall _________________ Gentoo user since 2004.
"It's all fun and games, until someone loses an eye" - mom |
|
Back to top |
|
|
=DvD= Veteran
Joined: 25 Mar 2004 Posts: 1353
|
Posted: Tue Dec 07, 2004 3:19 pm Post subject: |
|
|
I can't live without!
23 packets went away =D |
|
Back to top |
|
|
revertex l33t
Joined: 23 Apr 2003 Posts: 806
|
Posted: Tue Dec 07, 2004 9:35 pm Post subject: |
|
|
OMG!
Code: | *********************************************************
* WARNING!! EXPERIMENTAL! USE AT YOUR OWN RISK!!!!! *
* THIS IS AN ALPHA VERSION *
* MISUSE OF THIS TOOL CAN BREAK YOUR GENTOO *
* ESPECIALLY IF NOT WELL MANTAINED *
*********************************************************
(__) *
(@@)
/-------\/
/ |Larry||
* ||----||
^^ ^^ ~ http://www.gechi.it ~
~ Version 0.1_beta8
Analyzing....Please Wait
If you feel bored launch it with -v switch!
!!! Problems in /var/db/pkg :/var/db/pkg/sys-apps/-MERGING-portage-2.0.51-r7/portage-2.0.51-r7.ebuild
!!! PLEASE CHECK
|
|
|
Back to top |
|
|
xchris Advocate
Joined: 10 Jul 2003 Posts: 2824
|
Posted: Thu Dec 09, 2004 9:38 am Post subject: |
|
|
it seems that you stopped a merge process in the past.(portage..)
So... you have a corrupted /var/db/pkg
You should not have that kind of path (-MERGING-)
Try deleting /var/db/pkg/sys-apps/-MERGING ...
and than re-emerge portage.
Bye _________________ while True:Gentoo() |
|
Back to top |
|
|
revertex l33t
Joined: 23 Apr 2003 Posts: 806
|
Posted: Thu Dec 09, 2004 11:49 am Post subject: |
|
|
Thanks xchris, now it's working like a champ!
This script is a must have, it should be part of gentoolkit.
Code: |
(__) *
(@@)
/-------\/
/ |Larry||
* ||----||
^^ ^^
|
|
|
Back to top |
|
|
xchris Advocate
Joined: 10 Jul 2003 Posts: 2824
|
Posted: Thu Dec 09, 2004 1:37 pm Post subject: |
|
|
happy to hear this from u
if you have any doubt,question (bug) please post
Thank you
bye _________________ while True:Gentoo() |
|
Back to top |
|
|
smerrima n00b
Joined: 16 Mar 2004 Posts: 47 Location: Boise, ID
|
Posted: Thu Dec 09, 2004 3:57 pm Post subject: critical error |
|
|
Thanks for the script xchris, great work. When I run with -u -v I get this ouput:
Code: |
>>> Reading portage parameters
ARCH: Linuxi686-3
PORTDIR: /usr/portage
USEFLAGS: 64
>>> Building Virtuals
>>> Reading dependencies files from /var/db/pkg/ /var/cache/edb/dep/usr/portage/ (mix mode)
!!! Using only info from /var/db/pkg for: sys-kernel/gentoo-sources-2.4.25-r3
!!! Using only info from /var/db/pkg for: x11-misc/transset-0.1_pre20040928
!!! Using only info from /var/db/pkg for: app-text/dgs-0.5.10-r1
!!! Using only info from /var/db/pkg for: net-misc/nforce-net-1.0.0256
!!! Using only info from /var/db/pkg for: net-misc/rstatd-3.07
!!! Using only info from /var/db/pkg for: net-misc/openvpn-2.0_beta11
!!! Using only info from /var/db/pkg for: dev-java/blackdown-jdk-1.4.1
!!! Using only info from /var/db/pkg for: media-video/nvidia-kernel-1.0.4496-r3
>>> Resolving dependencies
>>> Reading world file in /var/lib/portage/world
>>> Reading system packages and dependecies
!!! Critical Error
!!! You miss this file : /usr/portage/profiles/default-linux/Linuxi686-3/packages
|
I have a packages file located in:
Code: |
-rw-r--r-- 1 root root 707 Oct 16 14:37 /usr/portage/profiles/default-linux/x86/2004.3/packages
|
Is there a way I can point to this file?[/code] _________________ -Seth |
|
Back to top |
|
|
xchris Advocate
Joined: 10 Jul 2003 Posts: 2824
|
Posted: Thu Dec 09, 2004 5:29 pm Post subject: |
|
|
i have never seen that ARCH
double check your ARCH settings.. (did you changed it in make.conf?)
Thank you
bye _________________ while True:Gentoo() |
|
Back to top |
|
|
smerrima n00b
Joined: 16 Mar 2004 Posts: 47 Location: Boise, ID
|
Posted: Thu Dec 09, 2004 5:45 pm Post subject: ah |
|
|
ok you are using arch. I use login scripts from work where we change $ARCH. I manually set ARCH=x86 and everything works great.
Thanks for your help! _________________ -Seth |
|
Back to top |
|
|
xchris Advocate
Joined: 10 Jul 2003 Posts: 2824
|
Posted: Thu Dec 09, 2004 5:47 pm Post subject: Re: ah |
|
|
smerrima wrote: | ok you are using arch. I use login scripts from work where we change $ARCH. I manually set ARCH=x86 and everything works great. |
great!
let me know how unclepine works...
Thank you! _________________ while True:Gentoo() |
|
Back to top |
|
|
=DvD= Veteran
Joined: 25 Mar 2004 Posts: 1353
|
Posted: Mon Dec 13, 2004 1:53 pm Post subject: |
|
|
revertex wrote: | Thanks xchris, now it's working like a champ!
This script is a must have, it should be part of gentoolkit. |
Any idea to give it more visibility?
People need this! |
|
Back to top |
|
|
soulfire n00b
Joined: 09 Apr 2004 Posts: 70 Location: Italy
|
Posted: Mon Dec 13, 2004 3:58 pm Post subject: |
|
|
i love this script, thanx xchris !!! _________________ I can divide by zero |
|
Back to top |
|
|
revertex l33t
Joined: 23 Apr 2003 Posts: 806
|
Posted: Tue Dec 14, 2004 2:23 am Post subject: |
|
|
=DvD= wrote: | revertex wrote: | Thanks xchris, now it's working like a champ!
This script is a must have, it should be part of gentoolkit. |
Any idea to give it more visibility?
People need this! |
maybe someone can fill a request in bugzilla., i guess xchris should do this if he did it already |
|
Back to top |
|
|
Cintra Advocate
Joined: 03 Apr 2004 Posts: 2111 Location: Norway
|
Posted: Tue Dec 14, 2004 7:44 am Post subject: |
|
|
Just came across unclepine and of course couldn't resist it.. got rid of a few old source trees OK, but the ones I worry about are
Code: |
* sys-devel/gcc-3.3.4-r1: alternative unneeded package in system packages
* sys-devel/gcc-3.4.3: alternative unneeded package in system packages
|
Porthole shows the following:
Code: | sys-devel/gcc
Based on the toolchain eclass
http://www.gnu.org/software/gcc/gcc.html
Installed versions:
Slot 3.3: 3.3.4-r1
Slot 3.4: 3.4.3-r1, 3.4.3
|
Code: | # gcc -v
Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.3/specs
Configured with: /var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.4.3 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.4.3/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/include/g++-v3 --host=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --enable-shared--enable-threads=posix --disable-multilib --disable-libgcj --enable-languages=c,c++
Thread model: posix
gcc version 3.4.3 20041125 (Gentoo Linux 3.4.3-r1, ssp-3.4.3-0, pie-8.7.7)
|
Big question, can I reasonably safely remove the gcc versions indicated? (btw, I can restore the partition pretty simply...)
regards _________________ "I am not bound to please thee with my answers" W.S. |
|
Back to top |
|
|
xchris Advocate
Joined: 10 Jul 2003 Posts: 2824
|
Posted: Tue Dec 14, 2004 7:57 am Post subject: |
|
|
unclepine reads dependencies atom like portage and gcc is alway mentioned without version... so it consider always last version.
Gcc is a particular package.. you should know if you still use old slot.
Let say that normally (common user) uses only the last one...but that's not always true.Do you switch compiler?
Anyway.. if you use -x switch to pass arguments to other scripts/commands it will not be passed as it belongs to system profile and i prefer to leave these "delicate" removal...manual.
I cannot say if you need old slots (as i cannot tell you when to remove old kenrel trees)
When you feel you really do not need them anymore...go unemrge
Bye and thanks (to everyone who tried unclepine)
@revertex: i did something more than bugzilla.I talked directly to gentoo developers.
For several reason it will remain a "Manual Download" only
Thanks anyway _________________ while True:Gentoo() |
|
Back to top |
|
|
Cintra Advocate
Joined: 03 Apr 2004 Posts: 2111 Location: Norway
|
Posted: Tue Dec 14, 2004 8:39 am Post subject: |
|
|
Thanks for your clarification xchris
regards _________________ "I am not bound to please thee with my answers" W.S. |
|
Back to top |
|
|
xchris Advocate
Joined: 10 Jul 2003 Posts: 2824
|
Posted: Mon Dec 20, 2004 11:10 am Post subject: |
|
|
new beta10 (same location in top post)
- better output colors
-it supports this syntax:
Code: |
USE="-alsa -mmx" unclepine [opt]
|
-it supports portdir and arch force (inside the script...at the beginning)
it's not necessary normally as it autodetects them.
(it can be usefull for smerrima)
Bye _________________ while True:Gentoo() |
|
Back to top |
|
|
aethyr Veteran
Joined: 06 Apr 2003 Posts: 1085 Location: NYC
|
Posted: Tue Jan 04, 2005 8:02 pm Post subject: |
|
|
Xchris, is this better or worse than ecatmur's dep? ;)
I only ask because I'm very familiar with that script, and I'm hesitant to mess with something that works. |
|
Back to top |
|
|
xmit Apprentice
Joined: 02 Apr 2003 Posts: 158 Location: Hamburg, Germany
|
Posted: Tue Jan 04, 2005 9:14 pm Post subject: |
|
|
Hi,
great script, it works perfectly on a x86 installation.
But on another computer with ~x86 keyword I get errors like this:
Code: | lab5 linux # unclepine -u
********************** WARNING **************************
* USE AT YOUR OWN RISK!!!!! *
* *
* MISUSE OF THIS TOOL CAN BREAK YOUR GENTOO *
* ESPECIALLY IF NOT WELL MANTAINED *
*********************************************************
(__) *
(@@)
/-------\/
/ |Larry||
* ||----||
^^ ^^ ~ http://www.gechi.it ~
~ Version 0.1_beta10
Analyzing....Please Wait
If you feel bored launch it with -v switch!
!!! Critical Error
!!! You miss this file : /var/db/pkg/media-libs/glut-3.7.1/DEPEND
|
It seems I can fix this by "emerge --oneshot PACKAGE". But the next "unclepine -u" throws the same error for another package. Meanwhile I reemerge the fifth package, will this ever find an end?
EDIT: Yes! After another 10 packages, unclepine now works without any critical errors! |
|
Back to top |
|
|
tecknojunky Veteran
Joined: 19 Oct 2002 Posts: 1937 Location: Montréal
|
Posted: Thu Jan 06, 2005 12:43 am Post subject: |
|
|
aethyr wrote: | Xchris, is this better or worse than ecatmur's dep?
I only ask because I'm very familiar with that script, and I'm hesitant to mess with something that works. | Looking for a solution to find revdeps, I've found unclepine and dep. I tried unclepine first but I keep getting "missing THIS" and "missing THAT", probably because those packages were emerged with an older version of Portage, prior to when it was saving the bunch of poop we now see in /var/db/pkg. At first I was re-emerging them, un til I hit this Code: | # ./unclepine -db kdelibs-3.1.2-r1
********************** WARNING **************************
* USE AT YOUR OWN RISK!!!!! *
* *
* MISUSE OF THIS TOOL CAN BREAK YOUR GENTOO *
* ESPECIALLY IF NOT WELL MANTAINED *
*********************************************************
(__) *
(@@)
/-------\/
/ |Larry||
* ||----||
^^ ^^ ~ http://www.gechi.it ~
~ Version 0.1_beta10
Analyzing....Please Wait
If you feel bored launch it with -v switch!
!!! Critical Error
!!! You miss this file : /var/db/pkg/sys-devel/gcc-2.95.3-r5/DEPEND | No way! I'm not re-emerging gcc-2.95. Forget it. After that, what other big thing would I need to re-emerge?
Going to try dep now. _________________ (7 of 9) Installing star-trek/species-8.4.7.2::talax. |
|
Back to top |
|
|
gentoo_lan l33t
Joined: 08 Sep 2004 Posts: 891 Location: Charles Town, WV
|
Posted: Thu Jan 06, 2005 1:53 am Post subject: |
|
|
Seems to work like a champ. Thanks. |
|
Back to top |
|
|
at6 Tux's lil' helper
Joined: 28 Nov 2002 Posts: 78 Location: /dev/null
|
Posted: Thu Jan 06, 2005 10:15 am Post subject: |
|
|
works great. thanks mate! _________________ debian: stable but lame! suse: unstable and lame! gentoo: stable and only 4 geeks!
Gadget tests! |
|
Back to top |
|
|
xchris Advocate
Joined: 10 Jul 2003 Posts: 2824
|
Posted: Thu Jan 06, 2005 5:17 pm Post subject: |
|
|
first of all.. sorry for late answer! i was away from my box and from the Net.
Is it better than dep?
I really cannot answer..
Dep is a great script..
I like some particularity of dep and others of unclepine.
As far as i know dep checks only updated portage dependendencies. (but i could be wrong)
Unclepine uses both ( /var/db/pkg and /var/cache/edb/....)
Anyway... it can works with /var/db/pkg or /var/cache/edb only...
But it is best to leave it work with both (i developed unclepine for maximum security... or at least... i tried )
If you wanna change the behavior edit the script and change variable deps_mode (at the beginning of the script)
"local" --> /var/db/pkg
"portage" --> /var/cache/edb
"mix" --> both
Anyway.. i suggest to leave it in "mix" mode as it is usefull also to check /var/db/pkg correctness and proved to be more safe.
@tecknojunky: when did you install your gentoo? Mine is 1,5 years old... I really don't know if gentoo didn't use to save DEPENDS file there...
Thanks to everybody who gave it a try _________________ while True:Gentoo() |
|
Back to top |
|
|
lodder_ Apprentice
Joined: 06 Nov 2004 Posts: 162 Location: Knokke-Heist, Belgium
|
Posted: Thu Jan 06, 2005 6:58 pm Post subject: |
|
|
thx man for this great script |
|
Back to top |
|
|
|