Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

emerge suggestion

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
48 posts
  • Previous
  • 1
  • 2
Author
Message
routerguy
Guru
Guru
Posts: 462
Joined: Sat Feb 07, 2004 6:40 pm

  • Quote

Post by routerguy » Thu Jun 17, 2004 6:46 pm

I want a progress bar, which of these scripts should I use? :)
Top
neenee
Veteran
Veteran
User avatar
Posts: 1786
Joined: Sun Jul 20, 2003 12:15 pm

  • Quote

Post by neenee » Thu Jun 17, 2004 6:46 pm

hm.. it seems to revert the title at the end now - i am
not sure why it did not do that a moment ago. odd..

oh well - thanks for the prompt reply :wink:
Top
markfl
Apprentice
Apprentice
User avatar
Posts: 240
Joined: Thu Apr 10, 2003 4:37 pm
Location: Kent, UK
Contact:
Contact markfl
Website

  • Quote

Post by markfl » Thu Jul 01, 2004 9:55 pm

this isnt exactly accurate though... openoffice-ximian is on 129%

Its gotta be nearly done though, its been going for 7 hours ish

Mark
Life it seems, will fade away
Drifting further every day
Top
squeegy
Guru
Guru
User avatar
Posts: 321
Joined: Sat Mar 13, 2004 11:46 pm
Location: Cincinnati, OH

  • Quote

Post by squeegy » Mon Jul 05, 2004 4:38 am

w00ps wrong thread. too many windows in firefox
Top
iplayfast
l33t
l33t
User avatar
Posts: 642
Joined: Mon Jul 08, 2002 5:48 pm
Location: Cambridge On,CA
Contact:
Contact iplayfast
Website

  • Quote

Post by iplayfast » Tue Sep 07, 2004 6:46 pm

markfl wrote:this isnt exactly accurate though... openoffice-ximian is on 129%

Its gotta be nearly done though, its been going for 7 hours ish

Mark
No, it is not accurate. It's supposed to be a rough indication, and on most projects will be accurate within +-10%.

Keep in mind that the way it works is to count the number of files that have "*.c*" and the number of files that have "*.o" It assumes that the *.c* files are source files and the *.o files are object files. If the number of object files == the number of source files, we are probably pretty close to being done.

However not all projects are written in c/c++ (just the majority of them). Also some projects have files that have arbitrary filenames which will throw off the count.

I find it to be very useful though. (Like deciding to stay up or go to bed)...
Top
Magneto
n00b
n00b
User avatar
Posts: 31
Joined: Thu Dec 16, 2004 2:51 am

  • Quote

Post by Magneto » Tue Jan 04, 2005 4:54 am

Just tried this via the portage-wiki tips page and had two problems

Code: Select all

ind: /var/tmp/portage/gst-plugins-oss-0.8.5/temp: Permission denied
                                                                      find: /var/tmp/portage/rsync-2.6.3/temp: Permission denied
                                                find: /var/tmp/portage/id3lib-3.8.3-r3/temp: Permission denied
                              find: /var/tmp/portage/ggv-2.8.0/temp: Permission denied
      find: /var/tmp/portage/ggv-2.8.1/temp: Permission denied
                                                              find: /var/tmp/portage/HTML-Tagset-3.03-r2/temp: Permission denied
 
Then I ran it while another build was going and it was at 10% while the emerge process had finished.

?


I used this script for emerge-progress

Code: Select all

#!/bin/sh
FULL=`tail -n 2 /var/log/emerge.log | grep Compiling | sed "s/\(.*\)Compiling\/Packaging \(.*\)::.*/\2/" | sed \
"s/(\([a-zA-Z].*\)\/\(.*\)/\1\/\2/"`
CUR=`echo $FULL | sed "s/\(.*\)\/\(.*\)/\2/"`
TOT=`find /var/tmp/portage/$CUR -iname "*.c*" | wc -l`
PROG=`find /var/tmp/portage/$CUR -iname "*.o*" | wc -l`
PRE_PER=`echo $PROG $TOT | gawk '{ sum += $1 / $2 }; END { print sum }' -`
PER=`echo $PRE_PER | gawk '{ sum += $1 * 100 }; END { print sum }' -`
echo "Currently Compiling Package: " $FULL " ("$PER"%)"  


edit******* tried the alternative script and it works well

Code: Select all

#!/bin/sh
FULL=`tail -n 2 /var/log/emerge.log | grep Compiling | sed "s/\(.*\)Compiling\/Merging \(.*\)::.*/\2/" | sed \
"s/(\([a-zA-Z].*\)\/\(.*\)/\1\/\2/"`
CUR=`echo $FULL | sed "s/\(.*\)\/\(.*\)/\2/"`
TOT=`find /var/tmp/portage/$CUR -iname "*.c*" | wc -l`
PROG=`find /var/tmp/portage/$CUR -iname "*.o*" | wc -l`
PRE_PER=`echo $PROG $TOT | gawk '{ sum += $1 / $2 }; END { print sum }' -`
PER=`echo $PRE_PER | gawk '{ sum += $1 * 100 }; END { print sum }' -`
echo "Currently Compiling Package: " $FULL " ("$PER"%)" 
Top
johnmiked15
n00b
n00b
Posts: 12
Joined: Wed Oct 13, 2004 6:53 pm
Location: United States
Contact:
Contact johnmiked15
Website

  • Quote

Post by johnmiked15 » Wed Jan 05, 2005 2:03 am

You have to run the script as root.
Top
iplayfast
l33t
l33t
User avatar
Posts: 642
Joined: Mon Jul 08, 2002 5:48 pm
Location: Cambridge On,CA
Contact:
Contact iplayfast
Website

  • Quote

Post by iplayfast » Wed Jan 05, 2005 4:59 am

and if a script dies 1/2 way through (or 1/10th in your case) it will aways show up until you delete the directory. (/var/tmp/portage/directory)
Top
TanNewt
Retired Dev
Retired Dev
User avatar
Posts: 340
Joined: Fri Mar 26, 2004 11:11 pm
Location: Seattle, WA
Contact:
Contact TanNewt
Website

  • Quote

Post by TanNewt » Wed Jan 05, 2005 6:45 am

We could always track/figure out the final percentages/ratios for each package and take that into account. That would be more accurate. It'd be tough but more accurate.
Top
rhill
Retired Dev
Retired Dev
User avatar
Posts: 1629
Joined: Fri Oct 22, 2004 9:58 am
Location: sk.ca

  • Quote

Post by rhill » Wed Jan 05, 2005 8:59 am

it would have to be able to account for changes in how packages are compiled due to USE flags en/disabling ./configure options. most source trees organize code into subdirs, sometimes loosely based on optional components. maybe a way to count .c / .o files per directory, and a way to tell if the build skips a directory could make the results more accurate, if possible.
by design, by neglect
for a fact or just for effect
Top
Magneto
n00b
n00b
User avatar
Posts: 31
Joined: Thu Dec 16, 2004 2:51 am

  • Quote

Post by Magneto » Wed Jan 05, 2005 9:57 pm

iplayfast wrote:and if a script dies 1/2 way through (or 1/10th in your case) it will aways show up until you delete the directory. (/var/tmp/portage/directory)
It didnt die 1/10th of the way through, the build had finished and the progress had only reached 10%.
And I did run it as root, it wouldnt be able to read the content of /var/tmp/portage/directory

This seemed funny to me because that topmost script in my post was supposedly the newer version according to the gentoo-wiki although I dont think it mentioned a particular release of portage and im pretty up to date system wise. The script that worked for me was supposedly for "older" systems.
Top
praseodymium
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 83
Joined: Wed Dec 08, 2004 8:30 pm

  • Quote

Post by praseodymium » Sun Jan 09, 2005 5:41 pm

With a progressbar:

Code: Select all

#!/bin/sh
while true; do
FULL=`tail -n 2 /var/log/emerge.log | grep Compiling | sed "s/\(.*\)Compiling\/Merging \(.*\)::.*/\2/" | sed "s/(\([a-zA-Z].*\)\/\(.*\)/\1\/\2/"`
CUR=`echo $FULL | sed "s/\(.*\)\/\(.*\)/\2/"`
TOT=`find /var/tmp/portage/$CUR -iname "*.c*" | wc -l`
PROG=`find /var/tmp/portage/$CUR -iname "*.o*" | wc -l`
PER=`echo \`bc -l <<< $PROG/$TOT*100\` / 1 | bc`
#echo "Currently Compiling Package: " $FULL " ("$PRE"%)" 
#echo "$COLUMNS / 5" | bc
#echo "["
echo col:$COLUMNS `bc -l <<< "$COLUMNS-20"`
echo ful:"$FULL - $PER"

if ((${#PER} == 0)); then if ((${PER} > 100)); then PER="100"; fi; fi
if ((${#FULL} == 0)); then FULL="nothing"; fi

dialog --title "Currently emerging $FULL..." --gauge "" -1 -1 $PER < /dev/null
sleep 3
done
The code will loop endlessly, use Ctrl+C to exit.
Top
RageAgainstTheMachine
n00b
n00b
User avatar
Posts: 14
Joined: Thu Sep 30, 2004 1:26 am
Location: Frogstar world A
Contact:
Contact RageAgainstTheMachine
Website

  • Quote

Post by RageAgainstTheMachine » Thu Feb 24, 2005 2:39 am

Thanks heaps guys, this is awesome!

It was such a bummer trying to compile something then having to cancel...then realising if you'd waited a few more minutes it woulda been perfect

Thanks :D
RageAgainstTheMachine
--
What is the ultimate answer to Life, The Universe and Everything? 42
KDE is kool!
--
Gentoo on a Dell inspiron 5100
P4 2.66
512MB RAM
40GIG HDD + 200GIG External 7200 8MB HDD
Top
Benson
Apprentice
Apprentice
User avatar
Posts: 156
Joined: Mon Feb 23, 2004 8:36 pm
Location: Switzerland
Contact:
Contact Benson
Website

  • Quote

Post by Benson » Thu Mar 10, 2005 1:45 pm

Very nice to have an idea how much of the app has been compiled - but in my case i get an error running it (as root):

Code: Select all

/root/emerge_progress: line 4: s/(\([a-zA-Z].*\)\/\(.*\)/\1\/\2/: No such file or directory
Currently Compiling Package:  (app-office/openoffice-ximian-1.3.8  (48.8445%)
Any ideas?


EDIT: Got it running, missed that nano made a new line where it shouldn't....

rdgs
Benson
Top
ssmaxss
Apprentice
Apprentice
Posts: 160
Joined: Tue Jun 28, 2005 10:19 am
Location: Moscow, Russia.

  • Quote

Post by ssmaxss » Sat Mar 04, 2006 4:20 pm

maybe someone would add ebuild with this tools to portage? Or provide ebuild for people to place into overlay. Cat and paste into file isn't the best method...
Top
iplayfast
l33t
l33t
User avatar
Posts: 642
Joined: Mon Jul 08, 2002 5:48 pm
Location: Cambridge On,CA
Contact:
Contact iplayfast
Website

  • Quote

Post by iplayfast » Sun Mar 05, 2006 3:00 am

ssmaxss wrote:maybe someone would add ebuild with this tools to portage? Or provide ebuild for people to place into overlay. Cat and paste into file isn't the best method...
I added a bug as an enhancement suggestion, and it was eventually dropped, because the bug/suggestion list was too busy. (Like the guy can't click the sort button!)

Anyways, if you like the idea why don't you submit it as a suggestion. I'd lovit in emerge, and I use it often. Maybe a new person suggesting it will spark some interest.
Top
Ekorn
n00b
n00b
Posts: 3
Joined: Sun Apr 16, 2006 7:54 pm

Emerge Progress

  • Quote

Post by Ekorn » Sun Apr 16, 2006 7:59 pm

Not related to the last discussion, but I have written a Emerge-progress script in perl.. Can be found here..
Not perfect in any way.. but working..
Any comments and suggestions are welcome :)
Top
swimmer
Veteran
Veteran
User avatar
Posts: 1330
Joined: Mon Jul 15, 2002 10:42 am
Location: Netherlands

Re: Emerge Progress

  • Quote

Post by swimmer » Fri Sep 08, 2006 9:42 am

Ekorn wrote:Not related to the last discussion, but I have written a Emerge-progress script in perl.. Can be found here..
Not perfect in any way.. but working..
Any comments and suggestions are welcome :)
Great script! Except that it needs a GUI ;-) Is there any chance that we get something with console output as well?

Greetz
swimmer
Top
Ekorn
n00b
n00b
Posts: 3
Joined: Sun Apr 16, 2006 7:54 pm

Re: Emerge Progress

  • Quote

Post by Ekorn » Fri Sep 08, 2006 4:43 pm

swimmer wrote:
Ekorn wrote:Not related to the last discussion, but I have written a Emerge-progress script in perl.. Can be found here..
Not perfect in any way.. but working..
Any comments and suggestions are welcome :)
Great script! Except that it needs a GUI ;-) Is there any chance that we get something with console output as well?

Greetz
swimmer
It has a gui, you only have to download the .glade-file too.. It is explained in the perl-file...(Maybe I should have said so?)

I'm not running gentoo atm, so there is no development going on :/
Top
swimmer
Veteran
Veteran
User avatar
Posts: 1330
Joined: Mon Jul 15, 2002 10:42 am
Location: Netherlands

Re: Emerge Progress

  • Quote

Post by swimmer » Sat Sep 09, 2006 1:52 am

Ekorn wrote:It has a gui, you only have to download the .glade-file too.. It is explained in the perl-file...(Maybe I should have said so?)

I'm not running gentoo atm, so there is no development going on :/
Oh sorry - I was not clear enough :-/
I mean that it has already a GUI but I would *love* to have something which is running in the console as well ;-)

Sorry to hear that you left Gentoo but perhaps it is easy to strip the GUI part?

Greetz
swimmer
Top
Ekorn
n00b
n00b
Posts: 3
Joined: Sun Apr 16, 2006 7:54 pm

Re: Emerge Progress

  • Quote

Post by Ekorn » Sat Sep 09, 2006 6:49 am

Oh sorry - I was not clear enough :-/
I mean that it has already a GUI but I would *love* to have something which is running in the console as well ;-)

Sorry to hear that you left Gentoo but perhaps it is easy to strip the GUI part?

Greetz
swimmer[/quote]

Oh.. There are several (or atleast two) packages that provide what you want.. It's probably easy to strip the unwantet parts, and make it print to console instead.. Do whatever you want with it :)

You may also try : http://www.smokepit.net/~theemperor/Utv ... e-progress
Bash-script.. not that advanced, but still a way to show the progress in console.
Top
mickwd
n00b
n00b
Posts: 70
Joined: Wed Jun 04, 2003 5:37 pm

  • Quote

Post by mickwd » Sat Sep 09, 2006 8:19 pm

I've been doing something like this by hand for a while. It's not always accurate because of the way different packages build, but it's usually a pretty decent indication of progress.

Nice idea to make it into a script.

However, you don't just want to count the *.c files. Many packages (particularly for certain things like KDE) use a lot of C++ code, so you want to count *.cpp files as well. Maybe also *.cc files. I've also come across *.C (upper case) files, but they're very uncommon.
Top
iplayfast
l33t
l33t
User avatar
Posts: 642
Joined: Mon Jul 08, 2002 5:48 pm
Location: Cambridge On,CA
Contact:
Contact iplayfast
Website

  • Quote

Post by iplayfast » Fri Sep 15, 2006 7:30 pm

The code counts the *.c* files which includes all your special cases. Here is a nice version of the script. [post=3580463]here[/post]
Top
Post Reply

48 posts
  • Previous
  • 1
  • 2

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic