Gentoo Archives: gentoo-dev

From: Ciaran McCreesh <ciaranm@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] rfc: epause instead of sleep in ebuilds
Date: Wed, 01 Sep 2004 20:24:48
Message-Id: 20040901212144.1d18b048@snowdrop.home
1 Currently, we have something like 200 ebuilds which call 'sleep'. How
2 would people feel about replacing this with an eutils function called
3 'epause' (or 'esleep', or 'ezzz', or esitaroundforabit)? This would give
4 us two advantages:
5
6 * For non-interactive builds (eg catalyst, chroot testing), an
7 environment variable could be set which makes epause not actually pause.
8 For certain packages on certain systems, the sleep takes longer than the
9 rest of the build...
10
11 * The behaviour of sleep isn't entirely standardised across different
12 UNIX implementations. It would be better to have one place to make any
13 changes needed by these new non-Linuxy platforms.
14
15 I'd suggest an implementation along the following lines:
16
17 # Wait for the supplied number of seconds. If no argument is supplied,
18 # defaults to five seconds. If the EPAUSE_IGNORE env var is set, don't
19 # wait.
20 epause() {
21 if [ -z "$EPAUSE_IGNORE" ] ; then
22 sleep ${1:-5}
23 fi
24 }
25
26 Thoughts? I'd be happy to do all the work :)
27
28 --
29 Ciaran McCreesh : Gentoo Developer (Sparc, MIPS, Vim, Fluxbox)
30 Mail : ciaranm at gentoo.org
31 Web : http://dev.gentoo.org/~ciaranm

Replies