Gentoo Archives: gentoo-dev

From: "Kevin F. Quinn (Gentoo)" <kevquinn@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Parallizing ebuilds - 'trivial' ebuilds
Date: Thu, 12 Jan 2006 08:02:08
Message-Id: 20060112090531.5e134bd0@c1358217.kevquinn.com
In Reply to: [gentoo-dev] Parallizing ebuilds - 'trivial' ebuilds by "Robin H. Johnson"
1 On Wed, 11 Jan 2006 14:51:46 -0800
2 "Robin H. Johnson" <robbat2@g.o> wrote:
3
4 > I've been cleaning up media-fonts/ to work with modular-X, and I see a
5 > lot of ebuilds with stuff like this:
6 > for font in *.bdf; do
7 > /usr/X11R6/bin/bdftopcf ${font} > `basename $font .bdf`.pcf
8 > done
9 > gzip *.pcf
10 >
11 > ['make' suggestion and example makefile snipped]
12
13 You could just do it directly in bash:
14
15 for font in *.bdf; do
16 pcf=`basename $font`.pcf && \
17 /usr/X11R6/bin/bdftopcf ${font} > ${pcf} &&
18 gzip ${pcf} &
19 done
20 wait
21
22 You may want to limit the number of parallel processes somewhat (as
23 with 'make -jN'), which is also easy enough to do:
24
25 n=${MAX_PARALLEL}
26 for font in *.bdf; do
27 pcf=`basename $font .bdf`.pcf && \
28 /usr/X11R6/bin/bdftopcf ${font} > ${pcf} && \
29 gzip ${pcf} &
30 [[ ${n} -eq 0 ]] && wait && n=${MAX_PARALLEL}
31 ((n=${n}-1))
32 done
33 wait
34
35 --
36 Kevin F. Quinn
37
38
39 --
40 Kevin F. Quinn

Attachments

File name MIME type
signature.asc application/pgp-signature