1 |
commit: 1606e3d1fa4eaa5fb4d799261e214b757bad9986 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 31 10:33:42 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 4 21:56:35 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1606e3d1 |
7 |
|
8 |
multiprocesing.eclass: Remove redirect_alloc_fd |
9 |
|
10 |
Remove the redirect_alloc_fd function that is no longer used since |
11 |
the removal of multijob* functions. The function is complex, has little |
12 |
potential use and an equivalent functionality is built-in in newer bash |
13 |
versions, making it completely unnecessary for EAPI 6. |
14 |
|
15 |
Closes: https://github.com/gentoo/gentoo/pull/6696 |
16 |
|
17 |
eclass/multiprocessing.eclass | 35 ----------------------------------- |
18 |
1 file changed, 35 deletions(-) |
19 |
|
20 |
diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.eclass |
21 |
index 6ca9b4fa785..3e8b2f9d254 100644 |
22 |
--- a/eclass/multiprocessing.eclass |
23 |
+++ b/eclass/multiprocessing.eclass |
24 |
@@ -100,39 +100,4 @@ makeopts_loadavg() { |
25 |
echo ${lavg:-${2:-999}} |
26 |
} |
27 |
|
28 |
-# @FUNCTION: redirect_alloc_fd |
29 |
-# @USAGE: <var> <file> [redirection] |
30 |
-# @DESCRIPTION: |
31 |
-# Find a free fd and redirect the specified file via it. Store the new |
32 |
-# fd in the specified variable. Useful for the cases where we don't care |
33 |
-# about the exact fd #. |
34 |
-redirect_alloc_fd() { |
35 |
- local var=$1 file=$2 redir=${3:-"<>"} |
36 |
- |
37 |
- # Make sure /dev/fd is sane on Linux hosts. #479656 |
38 |
- if [[ ! -L /dev/fd && ${CBUILD} == *linux* ]] ; then |
39 |
- eerror "You're missing a /dev/fd symlink to /proc/self/fd." |
40 |
- eerror "Please fix the symlink and check your boot scripts (udev/etc...)." |
41 |
- die "/dev/fd is broken" |
42 |
- fi |
43 |
- |
44 |
- if [[ $(( (BASH_VERSINFO[0] << 8) + BASH_VERSINFO[1] )) -ge $(( (4 << 8) + 1 )) ]] ; then |
45 |
- # Newer bash provides this functionality. |
46 |
- eval "exec {${var}}${redir}'${file}'" |
47 |
- else |
48 |
- # Need to provide the functionality ourselves. |
49 |
- local fd=10 |
50 |
- while :; do |
51 |
- # Make sure the fd isn't open. It could be a char device, |
52 |
- # or a symlink (possibly broken) to something else. |
53 |
- if [[ ! -e /dev/fd/${fd} ]] && [[ ! -L /dev/fd/${fd} ]] ; then |
54 |
- eval "exec ${fd}${redir}'${file}'" && break |
55 |
- fi |
56 |
- [[ ${fd} -gt 1024 ]] && die 'could not locate a free temp fd !?' |
57 |
- : $(( ++fd )) |
58 |
- done |
59 |
- : $(( ${var} = fd )) |
60 |
- fi |
61 |
-} |
62 |
- |
63 |
fi |