Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo Configuration Auto Cleaner
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
TheCurse
l33t
l33t


Joined: 21 Jun 2004
Posts: 670
Location: Köln

PostPosted: Mon Jul 18, 2005 12:11 pm    Post subject: Gentoo Configuration Auto Cleaner Reply with quote

Hi!
I have written a tool to automatically clean up files in /etc/portage! Look here.
You can use it like this:
gcac -o package.keywords.new
where the package.keywords.new should be a cleaned up version of package.keywords in /etc/portage (lines that are actually not needed are removed).
Therer are several options you can use:

--preserve - Don't delete empty lines and comments
--comment - Don't delete not needed lines, just comment
--use - Clean package.use
--mask - clean package.mask
--unmask - clean package.unmask
--o file - Result will not written to the screen but to file.

It would be nice if someone could test the tool and report any bug you find! Portage overlays are not supported yet, so don't report bugs about them.

Btw.: Sorry for my bad english


Last edited by TheCurse on Mon Mar 27, 2006 4:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
Gatak
Apprentice
Apprentice


Joined: 04 Jan 2004
Posts: 174

PostPosted: Tue Jul 19, 2005 1:15 pm    Post subject: Reply with quote

Would this tool also remove lines in package.keywords for applications that no longer need them?

For example if I had "=some-lib/blah-0.1 ~x86" since a year back and now I have 0.2 installed which is not ~x86.

What is the difference to this tool? https://forums.gentoo.org/viewtopic-t-302999.html
Back to top
View user's profile Send private message
TheCurse
l33t
l33t


Joined: 21 Jun 2004
Posts: 670
Location: Köln

PostPosted: Tue Jul 19, 2005 2:43 pm    Post subject: Reply with quote

It should removes lines that are no longer needed. In your example it would remove "=some-lib/blah-0.1 ~x86".
If the line was ">=some-lib/blah-0.1 ~x86" and version 0.2 is installed and has ~x86 then the line would not be removed.

I do not know about the tool you mentioned, but it seems that it does lots of things gcac does, but in an different way. One difference of course is the programming language. Then I don't actually change anything in the files, just print it to standard-output (the screen). Another thing is that I do not use emerge, so it should be faster I think.

But nevertheless, I do not really know the differences.
Back to top
View user's profile Send private message
Gatak
Apprentice
Apprentice


Joined: 04 Jan 2004
Posts: 174

PostPosted: Tue Jul 19, 2005 3:00 pm    Post subject: Reply with quote

OK Thanks for your reply. The other tool was rather slow too, as you said.

You should add your program to gentoo-wiki.com so other people can find it =) Perhaps also suggest on bugs.gentoo.org that gcac is included in portage?
Back to top
View user's profile Send private message
TheCurse
l33t
l33t


Joined: 21 Jun 2004
Posts: 670
Location: Köln

PostPosted: Tue Jul 19, 2005 4:14 pm    Post subject: Reply with quote

I will do that, soon.
Back to top
View user's profile Send private message
TheCurse
l33t
l33t


Joined: 21 Jun 2004
Posts: 670
Location: Köln

PostPosted: Mon Mar 27, 2006 5:02 pm    Post subject: Reply with quote

I did a few code cleanups and tuned the slow parts of the tool, so that it now should be really fast! Please test and give feedback!

Bye!
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Mon Mar 27, 2006 9:15 pm    Post subject: Reply with quote

It doesn't compile here...

Code:
Making all in src
make[2]: Entering directory `/var/tmp/portage/gcac-0.6/work/gcac-0.6/src'
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3 -I/home/tim/Projects/gcac/include   -Wall -g -march=athlon -Os -pipe -MT directorys.o -MD -MP -MF ".deps/directorys.Tpo" -c -o directorys.o directorys.cc; \
then mv -f ".deps/directorys.Tpo" ".deps/directorys.Po"; else rm -f ".deps/directorys.Tpo"; exit 1; fi
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/include/g++-v3 -I/home/tim/Projects/gcac/include   -Wall -g -march=athlon -Os -pipe -MT files.o -MD -MP -MF ".deps/files.Tpo" -c -o files.o files.cc; \
then mv -f ".deps/files.Tpo" ".deps/files.Po"; else rm -f ".deps/files.Tpo"; exit 1; fi
directorys.cc:17:24: error: directorys.h: No such file or directory
directorys.cc:19: error: ‘p_directory’ has not been declared
directorys.cc: In function ‘int count_subfolders()’:
directorys.cc:24: error: ‘DIR’ was not declared in this scope
directorys.cc:24: error: ‘dirhandle’ was not declared in this scope
directorys.cc:26: error: ‘string’ was not declared in this scope
directorys.cc:26: error: expected `;' before ‘name’
directorys.cc:28: error: ‘path’ was not declared in this scope
directorys.cc:28: error: ‘opendir’ was not declared in this scope
directorys.cc:30: error: ‘readdir’ was not declared in this scope
directorys.cc:32: error: ‘name’ was not declared in this scope
files.cc:17:19: error: files.h: No such file or directory
files.cc:22: error: ‘p_file’ has not been declared
files.cc:22: error: ISO C++ forbids declaration of ‘p_file’ with no type
files.cc: In function ‘int p_file()’:
files.cc:24: error: ‘opened’ was not declared in this scope
files.cc:25: warning: no return statement in function returning non-void
files.cc: At global scope:
files.cc:27: error: ‘p_file’ is not a class or namespace
files.cc:27: error: expected constructor, destructor, or type conversion before ‘(’ token
files.cc:42: error: ‘p_file’ is not a class or namespace
files.cc: In function ‘bool is_open()’:
files.cc:44: error: ‘opened’ was not declared in this scope
files.cc: At global scope:
files.cc:47: error: ‘p_file’ is not a class or namespace
files.cc:47: error: ‘string’ was not declared in this scope
files.cc:47: error: ‘path’ was not declared in this scope
files.cc:48: error: expected ‘,’ or ‘;’ before ‘{’ token
files.cc:82: error: ‘p_file’ is not a class or namespace
files.cc: In function ‘bool close()’:
files.cc:88: error: ‘file’ was not declared in this scope
files.cc:107: error: ‘opened’ was not declared in this scope
files.cc:112: error: ‘opened’ was not declared in this scope
files.cc:118: error: ‘opened’ was not declared in this scope
files.cc:125: error: ‘cerr’ was not declared in this scope
files.cc:125: error: ‘endl’ was not declared in this scope
files.cc:126: error: ‘EXIT_FAILURE’ was not declared in this scope
files.cc:126: error: ‘exit’ was not declared in this scope
files.cc: At global scope:
files.cc:130: error: ‘p_file’ is not a class or namespace
files.cc:130: error: ‘string’ was not declared in this scope
files.cc:130: error: ‘str’ was not declared in this scope
files.cc:131: error: expected ‘,’ or ‘;’ before ‘{’ token
files.cc: In function ‘int p_file()’:
files.cc:25: warning: control reaches end of non-void function
directorys.cc:32: error: invalid use of undefined type ‘struct dirent’
directorys.cc:25: error: forward declaration of ‘struct dirent’
directorys.cc:39: error: ‘closedir’ was not declared in this scope
directorys.cc:46: error: ‘cerr’ was not declared in this scope
directorys.cc:46: error: ‘endl’ was not declared in this scope
directorys.cc:47: error: ‘EXIT_FAILURE’ was not declared in this scope
directorys.cc:47: error: ‘exit’ was not declared in this scope
directorys.cc: At global scope:
directorys.cc:51: error: ‘p_directory’ has not been declared
directorys.cc:51: error: ‘string’ was not declared in this scope
directorys.cc:51: error: ‘str’ was not declared in this scope
directorys.cc:52: error: expected ‘,’ or ‘;’ before ‘{’ token
directorys.cc:58: error: ‘string’ does not name a type
make[2]: *** [directorys.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [files.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/gcac-0.6/work/gcac-0.6/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/gcac-0.6/work/gcac-0.6'
make: *** [all] Error 2

_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
TheCurse
l33t
l33t


Joined: 21 Jun 2004
Posts: 670
Location: Köln

PostPosted: Tue Mar 28, 2006 6:20 am    Post subject: Reply with quote

I am sorry, should be fixed in 0.6.2 I hope...
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Tue Mar 28, 2006 8:25 am    Post subject: Reply with quote

That's better. :D

It works very well for package.keywords, although it doesn't seem to recognise the -* keyword. A few problems though - what I'm assuming is the "file not found" message is in a language that looks like German to me: "Fehler beim öffnen der Datei", and the program segfaulted when I tried to use it on my package.use file.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
TheCurse
l33t
l33t


Joined: 21 Jun 2004
Posts: 670
Location: Köln

PostPosted: Tue Mar 28, 2006 12:21 pm    Post subject: Reply with quote

Thanks for feedback, in a next version I will handle the -* keyword and the message (it must be a message that sould only test the functionality from one of the first versions, I will check that, and yes, it is german).

When I have enough time, I will go and hunt down the segfault (would be nice if you mail me your package.use, for maybe I can reproduce it here).
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Tue Mar 28, 2006 4:21 pm    Post subject: Reply with quote

It's quite short, so I'll post my package.use file here.

/etc/portage/package.use:
sys-libs/glibc userlocales profile nptl nptlonly
sys-libs/libstdc++-v3 nptl
sys-devel/gcc -fortran

dev-lang/php mysql postgres gd session hardenedphp cgi fastbuild posix threads dba

# For libglade bindings
dev-python/pygtk gnome
net-im/bitlbee msn
media-video/mplayer dvd mmx nvidia win32codecs xanim

_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
TheCurse
l33t
l33t


Joined: 21 Jun 2004
Posts: 670
Location: Köln

PostPosted: Sun Apr 02, 2006 7:18 pm    Post subject: Reply with quote

Thanks for feedback! I have released a minor update (0.6.3) where the segmentation faults are hopefully fixed and --use etc. should work again. The -* keyword is not implemented yet, because I have no time at the moment.

Bye
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum