Gentoo Archives: gentoo-dev

From: Ciaran McCreesh <ciaranm@g.o>
To: seemant@g.o
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] rfc: epause instead of sleep in ebuilds
Date: Wed, 01 Sep 2004 21:32:37
Message-Id: 20040901222928.4e440562@snowdrop.home
In Reply to: Re: [gentoo-dev] rfc: epause instead of sleep in ebuilds by Seemant Kulleen
1 On Wed, 01 Sep 2004 13:49:30 -0700 Seemant Kulleen <seemant@g.o>
2 wrote:
3 | That's a great idea. Along these lines, perhaps something
4 | standardised for the beeping einfo's would be nice too. I know at
5 | least three packages which make use of the beeping einfo messages
6 | (portage, gaim and xorg-x11) -- it'd be nice to make it a function
7 | rather than the stuff that's happening now.
8
9 Ok, how's this look?
10
11 # Beep the specified number of times (defaults to five). If our output
12 # is not a terminal, or if seq (part of coreutils) is unavailable, don't
13 # beep.
14 ebeep() {
15 local n
16 if [ -t 1 ] && [ -x /bin/seq ] ; then
17 for n in $(seq 1 ${1:-5}) ; do
18 echo -ne "\a"
19 sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null
20 echo -ne "\a"
21 sleep 1
22 done
23 fi
24 }
25
26 I think this might not work on OSX, not sure that they have a seq
27 available (although they should...).
28
29 --
30 Ciaran McCreesh : Gentoo Developer (Sparc, MIPS, Vim, Fluxbox)
31 Mail : ciaranm at gentoo.org
32 Web : http://dev.gentoo.org/~ciaranm

Replies

Subject Author
Re: [gentoo-dev] rfc: epause instead of sleep in ebuilds Tavis Ormandy <taviso@g.o>
Re: [gentoo-dev] rfc: epause instead of sleep in ebuilds "Michael Sterrett -Mr. Bones.-" <msterret@××××.com>
Re: [gentoo-dev] rfc: epause instead of sleep in ebuilds Guillaume Destuynder <kang@g.o>