* Re: [gentoo-dev] rfc: epause instead of sleep in ebuilds
@ 2004-09-02 0:22 99% ` Ciaran McCreesh
0 siblings, 0 replies; 1+ results
From: Ciaran McCreesh @ 2004-09-02 0:22 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]
On Wed, 1 Sep 2004 21:21:44 +0100 Ciaran McCreesh <ciaranm@gentoo.org>
wrote:
| Currently, we have something like 200 ebuilds which call 'sleep'. How
| would people feel about replacing this with an eutils function called
| 'epause' (or 'esleep', or 'ezzz', or esitaroundforabit)?
Ok, based upon feedback...
# Wait for the supplied number of seconds. If no argument is supplied,
# defaults to five seconds. If the EPAUSE_IGNORE env var is set, don't
# wait. If we're not outputting to a terminal, don't wait.
epause() {
if [ -z "$EPAUSE_IGNORE" ] && [ -t 1 ] ; then
sleep ${1:-5}
fi
}
# Beep the specified number of times (defaults to five). If our output
# is not a terminal, don't beep. If the EBEEP_IGNORE env var is set,
# don't beep.
ebeep() {
local n
if [ -z "$EBEEP_IGNORE" ] && [ -t 1 ] ; then
for ((n=1 ; n <= ${1:-5} ; n++)) ; do
echo -ne "\a"
sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null
echo -ne "\a"
sleep 1
done
fi
}
If no-one screams, I'll go ahead with this tomorrow.
--
Ciaran McCreesh : Gentoo Developer (Sparc, MIPS, Vim, Fluxbox)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2004-09-01 20:21 [gentoo-dev] rfc: epause instead of sleep in ebuilds Ciaran McCreesh
2004-09-02 0:22 99% ` Ciaran McCreesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox