Mercurial > hg > aboriginal
comparison sources/functions.sh @ 773:2b9e8af90917
Remove wait4background, the shell has a builtin "wait" and we don't care about non-zero wait counts anymore.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 01 Jul 2009 18:53:00 -0500 |
parents | 27f007ea2129 |
children | 37c083cca810 |
comparison
equal
deleted
inserted
replaced
772:7cb6ef2cdf10 | 773:2b9e8af90917 |
---|---|
417 # Change window title bar to package now | 417 # Change window title bar to package now |
418 [ -z "$NO_TITLE_BAR" ] && | 418 [ -z "$NO_TITLE_BAR" ] && |
419 echo -en "\033]2;$ARCH_NAME $STAGE_NAME $PACKAGE\007" | 419 echo -en "\033]2;$ARCH_NAME $STAGE_NAME $PACKAGE\007" |
420 } | 420 } |
421 | 421 |
422 # usage: wait4background [count] | |
423 | |
424 function wait4background() | |
425 { | |
426 local COUNT="$1" | |
427 local EXCLUDE="$2" | |
428 | |
429 [ -z "$COUNT" ] && COUNT=0 | |
430 [ -z "$EXCLUDE" ] && EXCLUDE="thisdoesnotmatchanything" | |
431 # Wait for background tasks to finish | |
432 while [ $(jobs | grep -v "$EXCLUDE" | wc -l) -gt $COUNT ] | |
433 do | |
434 sleep 1 | |
435 # Without this next line, bash never notices a change in the number of jobs. | |
436 # Bug noticed in Ubuntu 7.04 | |
437 jobs > /dev/null | |
438 done | |
439 } | |
440 | |
441 # Figure out what version of a package we last built | 422 # Figure out what version of a package we last built |
442 | 423 |
443 function get_download_version() | 424 function get_download_version() |
444 { | 425 { |
445 getversion $(sed -n 's@URL=.*/\(.[^ ]*\).*@\1@p' "$TOP/download.sh" | grep ${1}-) | 426 getversion $(sed -n 's@URL=.*/\(.[^ ]*\).*@\1@p' "$TOP/download.sh" | grep ${1}-) |