Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Rough, estimated time of completion and progbar for builds
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
Princess Firefly
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2002
Posts: 80

PostPosted: Tue Mar 18, 2003 3:03 am    Post subject: Rough, estimated time of completion and progbar for builds Reply with quote

This topic has come up in a couple of different Places without really having anything done about it.

I've written a script that can be used to show you a progress bar and an estimated time of completion for a build. It does not require a database of compile times or any thing crazy like that. It simply looks at how many gcc or g++ commands are needed for a specific build and bases the time remaining on the speed of compilation so far. It's not exact but in all my tests it's more accurate than I thought it would be (within a few minutes). It certainly can indicate if you should shut off the monitor and go to bed or stay up and wait for the build to finish.

The reason I'm posting this in a new topic is because I've taken it about as far as my programming abilities/time to learn new stuff can go. I think nobody will notice this in the bottom of a 'gentoo chat' post and it seems to be a feature that some people really want.

Limits: I don't know how to integrate it with portage. It seems like it'd be an easy task but I don't know how to go about it. Also, the way it stands right now, it only works for one package. Someone with more portage knowledge could probably extend it to display info about a series of builds being done (like an update world).

Also, this is the first script I've ever written so the ASCII art is pretty bad. Someone could probably easily make this script better and take out the crappy 'clear' commands I have in there for the progress bar drawing.

I hope this or something like this gets into portage, it would make emerging stuff so much nicer.

Download script HERE
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Tue Mar 18, 2003 4:08 pm    Post subject: Reply with quote

This is an interesting approach. I appreciate your efforts.
I'll certainly try this one, if it's possible to integrate this into portage. A separate script and running a separate ./configure is just not practical enough for me.
Back to top
View user's profile Send private message
Princess Firefly
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2002
Posts: 80

PostPosted: Sun Mar 23, 2003 10:18 am    Post subject: script updated Reply with quote

I'm not sure if anyone is paying attention but if you are: I've updated the script. The output is a lot nicer, cleaner, and quicker and there are no more issues with standard error wrecking the nice output (figured out how to redirect it). The only thing I've got to do now is figure out how to integrate it the script into portage. Download it using the link in my first post.
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Sun Mar 23, 2003 3:37 pm    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic.php?t=42346

This one does a pretty good job. Have a look at it, and maybe create the best of both :)
Back to top
View user's profile Send private message
nikai
Apprentice
Apprentice


Joined: 02 Oct 2002
Posts: 270
Location: Kitzbühel, Austria

PostPosted: Sun Mar 23, 2003 4:46 pm    Post subject: Reply with quote

I guess one place for adding your script to portage would be
/usr/lib/portage/bin/emake

So it would get executed every time that "emake" gets called.
However, not every ebuild uses "emake", and some more than once.
Back to top
View user's profile Send private message
xenon
Guru
Guru


Joined: 25 Dec 2002
Posts: 432
Location: Europe

PostPosted: Sun Mar 23, 2003 5:02 pm    Post subject: Reply with quote

It's a good idea, I hope it makes it to portage in an "official" way. :)
Back to top
View user's profile Send private message
Princess Firefly
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2002
Posts: 80

PostPosted: Mon Mar 24, 2003 8:18 am    Post subject: integration Reply with quote

thanks nikai for the advice about emake.

I've figured out how to get it to work for most ebuilds. There are some problems still I have to figure out. For example openssl does some really funky stuff in their config file soo this deosn't work that that package and I have no idea why. Try this out though, I'm loving it so far.

What happens is you are renaming make to make2. Every make call passes through this script. If it is initiated from /usr/tmmp/portage it is interpreted as a portage call and the progress bar is displaayed. Otherwise it just calls make2 as normal so technically this should only effect emerges not any other makes that you do.

To install: [as root]
- Rename make to make2 (cd /usr/bin; mv make make2)
- Save this script as make (cp /where/ever/you/dl/Progressbar.sh /usr/bin/make)
- Make executable (chmod a+x /usr/bin/make

That's it. Builds initiated from /var/tmp/portage (ie using emerge) will now display a progress bar for the make commands as well as estimated time of completion.

To uninstall:
- rm /usr/bin/make
- mv /usr/bin/make2 /usr/bin/make

There you have it. Remember this is my first script and my first attempt messing around with portage so, while I am grateful for bug reports and comments, don't cry to me if you break something. libghttp is a nice little test package, I'm trying it with various packages and everything is fine so far. Remember do not use this with openssl.
Back to top
View user's profile Send private message
Princess Firefly
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2002
Posts: 80

PostPosted: Wed Mar 26, 2003 7:19 am    Post subject: problems Reply with quote

well, it's working great for the majority of packages but for some (openssl, mozilla, xfree) it does something funky with make and for some reason the commands aren't getting through.

If I rename make to make2 and write a script called make and all it does is "make2 $*" it seems to me like it should work fine for every make call (all make calls passed to make2 with the same parameters...) For some reason it doesn't for a few packages.

Anyway, if you're playing with this script watch the output for errors cause I haven't figured this out yet.

xpfx
Back to top
View user's profile Send private message
amne
Bodhisattva
Bodhisattva


Joined: 17 Nov 2002
Posts: 6378
Location: Graz / EU

PostPosted: Sat May 01, 2004 9:01 pm    Post subject: Reply with quote

Moving from Portage & Programming to Duplicate Threads. There are quite some threads about this topic and it seems to make most sense to me to ask everyone to redirect further comments to Emerge progress bar which seems to be the longest thread about this topic.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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