From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-dev-return-15424-arch-gentoo-dev=gentoo.org@lists.gentoo.org>
Received: (qmail 796 invoked from network); 1 Sep 2004 20:24:48 +0000
Received: from smtp.gentoo.org (156.56.111.197)
  by lists.gentoo.org with AES256-SHA encrypted SMTP; 1 Sep 2004 20:24:48 +0000
Received: from lists.gentoo.org ([156.56.111.196] helo=parrot.gentoo.org)
	by smtp.gentoo.org with esmtp (Exim 4.34)
	id 1C2bey-0004OS-Bn
	for arch-gentoo-dev@lists.gentoo.org; Wed, 01 Sep 2004 20:24:48 +0000
Received: (qmail 26773 invoked by uid 89); 1 Sep 2004 20:24:47 +0000
Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm
Precedence: bulk
List-Post: <mailto:gentoo-dev@gentoo.org>
List-Help: <mailto:gentoo-dev-help@gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev-unsubscribe@gentoo.org>
List-Subscribe: <mailto:gentoo-dev-subscribe@gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@gentoo.org
Received: (qmail 1252 invoked from network); 1 Sep 2004 20:24:47 +0000
Date: Wed, 1 Sep 2004 21:21:44 +0100
From: Ciaran McCreesh <ciaranm@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Message-ID: <20040901212144.1d18b048@snowdrop.home>
X-Mailer: Sylpheed-Claws 0.9.12a (GTK+ 1.2.10; i686-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/pgp-signature";
 micalg="pgp-sha1";
 boundary="Signature=_Wed__1_Sep_2004_21_21_44_+0100_7N4b+WfUFfkFzWY1"
Subject: [gentoo-dev] rfc: epause instead of sleep in ebuilds
X-Archives-Salt: b1648442-c0bb-4b3a-b8de-651e388f5b5d
X-Archives-Hash: 32991f4aa0ffcf0a7ad6190710b1d159

--Signature=_Wed__1_Sep_2004_21_21_44_+0100_7N4b+WfUFfkFzWY1
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

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)? This would give
us two advantages:

* For non-interactive builds (eg catalyst, chroot testing), an
environment variable could be set which makes epause not actually pause.
For certain packages on certain systems, the sleep takes longer than the
rest of the build...

* The behaviour of sleep isn't entirely standardised across different
UNIX implementations. It would be better to have one place to make any
changes needed by these new non-Linuxy platforms.

I'd suggest an implementation along the following lines:

# 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.
epause() {
    if [ -z "$EPAUSE_IGNORE" ] ; then
        sleep ${1:-5}
    fi
}

Thoughts? I'd be happy to do all the work :)

-- 
Ciaran McCreesh : Gentoo Developer (Sparc, MIPS, Vim, Fluxbox)
Mail            : ciaranm at gentoo.org
Web             : http://dev.gentoo.org/~ciaranm


--Signature=_Wed__1_Sep_2004_21_21_44_+0100_7N4b+WfUFfkFzWY1
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBNi9a96zL6DUtXhERAhxdAJ9tsw4wuT0ljUxDY5z8X5RjbtgLEQCgsonm
WSMsojX1pEqmDSOtpyXdUe4=
=TGd0
-----END PGP SIGNATURE-----

--Signature=_Wed__1_Sep_2004_21_21_44_+0100_7N4b+WfUFfkFzWY1--