Gentoo Archives: gentoo-commits

From: "Brian Harring (ferringb)" <ferringb@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/pkgcore/files: pkgcore-0.7.7-IFS-manipulation.patch
Date: Fri, 02 Dec 2011 10:11:55
Message-Id: 20111202101143.809412004B@flycatcher.gentoo.org
1 ferringb 11/12/02 10:11:43
2
3 Added: pkgcore-0.7.7-IFS-manipulation.patch
4 Log:
5 fix IFS manipulation bug reported in IRC
6
7 (Portage version: 2.1.10.37/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sys-apps/pkgcore/files/pkgcore-0.7.7-IFS-manipulation.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/pkgcore/files/pkgcore-0.7.7-IFS-manipulation.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/pkgcore/files/pkgcore-0.7.7-IFS-manipulation.patch?rev=1.1&content-type=text/plain
14
15 Index: pkgcore-0.7.7-IFS-manipulation.patch
16 ===================================================================
17 From 5c362279c739ff4c6b2cd0e54e8c978462809e28 Mon Sep 17 00:00:00 2001
18 From: Brian Harring <ferringb@×××××.com>
19 Date: Fri, 2 Dec 2011 02:06:07 -0800
20 Subject: [PATCH] shift IFS manipulation into isolated-functions, since has
21 relies on it.
22
23 ---
24 pkgcore/ebuild/eapi-bash/ebuild-daemon.bash | 30 ++++------------------
25 pkgcore/ebuild/eapi-bash/ebuild.lib | 1 -
26 pkgcore/ebuild/eapi-bash/isolated-functions.lib | 25 ++++++++++++++++++-
27 3 files changed, 30 insertions(+), 26 deletions(-)
28
29 diff --git a/pkgcore/ebuild/eapi-bash/ebuild-daemon.bash b/pkgcore/ebuild/eapi-bash/ebuild-daemon.bash
30 index 2260fa0..0a1c4be 100755
31 --- a/pkgcore/ebuild/eapi-bash/ebuild-daemon.bash
32 +++ b/pkgcore/ebuild/eapi-bash/ebuild-daemon.bash
33 @@ -3,30 +3,6 @@
34 # Copyright 2004-2011 Brian Harring <ferringb@×××××.com>
35 # License: BSD/GPL2
36
37 -declare -a PKGCORE_SAVED_IFS
38 -
39 -pkgcore_push_IFS()
40 -{
41 - PKGCORE_SAVED_IFS[${#PKGCORE_SAVED_IFS[@]}]="${IFS-unset}"
42 - if [[ $1 == unset ]]; then
43 - unset IFS
44 - else
45 - IFS="$1"
46 - fi
47 - :
48 -}
49 -
50 -pkgcore_pop_IFS()
51 -{
52 - if [[ ${#PKGCORE_SAVED_IFS[@]} == 0 ]]; then
53 - die "pkgcore_pop_IFS invoked with nothing on the stack..."
54 - fi
55 - IFS=${PKGCORE_SAVED_IFS[$(( ${#PKGCORE_SAVED_IFS[@]} -1 ))]}
56 - [[ ${IFS} == unset ]] && unset IFS
57 - unset PKGCORE_SAVED_IFS[$(( ${#PKGCORE_SAVED_IFS[@]} -1 ))]
58 - :
59 -}
60 -
61 # use ebd_read/ebd_write for talking to the running portage instance instead of echo'ing to the fd yourself.
62 # this allows us to move the open fd's w/out issues down the line.
63 ebd_read_line()
64 @@ -131,6 +107,12 @@ pkgcore_ebd_exec_main()
65 exit 2;
66 fi
67
68 + # get our die functionality now.
69 + if ! source "${PKGCORE_BIN_PATH}/isolated-functions.lib"; then
70 + ebd_write_line "failed sourcing isolated-functions.lib"
71 + exit 2;
72 + fi
73 +
74 ebd_read_line PKGCORE_PYTHON_BINARY
75 [ -z "$PKGCORE_PYTHON_BINARY" ] && die "empty PKGCORE_PYTHON_BINARY, bailing"
76 ebd_read_line PKGCORE_PYTHONPATH
77 diff --git a/pkgcore/ebuild/eapi-bash/ebuild.lib b/pkgcore/ebuild/eapi-bash/ebuild.lib
78 index 0ae3ed5..ff13300 100644
79 --- a/pkgcore/ebuild/eapi-bash/ebuild.lib
80 +++ b/pkgcore/ebuild/eapi-bash/ebuild.lib
81 @@ -234,7 +234,6 @@ load_ebuild()
82 # note that exit-handling loads the die functions, thus the custom failure there.
83 source "${PKGCORE_BIN_PATH}/exit-handling.lib" >&2 || { echo "ERROR: failed sourcing exit-handling.lib"; exit -1; }
84 source "${PKGCORE_BIN_PATH}/ebuild-default-functions.lib" >&2 || die "failed sourcing ebuild-default-functions.lib"
85 -source "${PKGCORE_BIN_PATH}/isolated-functions.lib" >&2 || die "failed sourcing stripped down functions.lib"
86 source "${PKGCORE_BIN_PATH}/ebuild-env-utils.lib" >&2 || die "failed sourcing ebuild-env-utils.lib"
87
88 pkgcore_run_ebuild_phase()
89 diff --git a/pkgcore/ebuild/eapi-bash/isolated-functions.lib b/pkgcore/ebuild/eapi-bash/isolated-functions.lib
90 index faee73d..b589dfb 100644
91 --- a/pkgcore/ebuild/eapi-bash/isolated-functions.lib
92 +++ b/pkgcore/ebuild/eapi-bash/isolated-functions.lib
93 @@ -126,7 +126,30 @@ pkgcore_shopt_pop()
94 :
95 } &> /dev/null
96
97 +declare -a PKGCORE_SAVED_IFS
98 +
99 +pkgcore_push_IFS()
100 +{
101 + PKGCORE_SAVED_IFS[${#PKGCORE_SAVED_IFS[@]}]="${IFS-unset}"
102 + if [[ $1 == unset ]]; then
103 + unset IFS
104 + else
105 + IFS="$1"
106 + fi
107 + :
108 +}
109 +
110 +pkgcore_pop_IFS()
111 +{
112 + if [[ ${#PKGCORE_SAVED_IFS[@]} == 0 ]]; then
113 + die "pkgcore_pop_IFS invoked with nothing on the stack..."
114 + fi
115 + IFS=${PKGCORE_SAVED_IFS[$(( ${#PKGCORE_SAVED_IFS[@]} -1 ))]}
116 + [[ ${IFS} == unset ]] && unset IFS
117 + unset PKGCORE_SAVED_IFS[$(( ${#PKGCORE_SAVED_IFS[@]} -1 ))]
118 + :
119 +}
120 +
121 unset_colors
122 -DONT_EXPORT_VARS="${DONT_EXPORT_VARS} PKGCORE_RC_.* PKGCORE_ESHOPT_STATE"
123
124 :
125 --
126 1.7.8.rc3