Gentoo Archives: gentoo-commits

From: "Paul Varner (fuzzyray)" <fuzzyray@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-portage/gentoolkit/files: 0.3.0_rc11-euse.patch 0.3.0_rc11-euse_prefix.patch
Date: Wed, 24 Nov 2010 19:01:03
Message-Id: 20101124190055.8DCB52003C@flycatcher.gentoo.org
1 fuzzyray 10/11/24 19:00:55
2
3 Added: 0.3.0_rc11-euse.patch 0.3.0_rc11-euse_prefix.patch
4 Log:
5 Update euse to look for portage config files in new as well as old paths - bug 346519. Make euse prefix aware.
6
7 (Portage version: 2.1.9.24/cvs/Linux i686)
8
9 Revision Changes Path
10 1.1 app-portage/gentoolkit/files/0.3.0_rc11-euse.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-portage/gentoolkit/files/0.3.0_rc11-euse.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-portage/gentoolkit/files/0.3.0_rc11-euse.patch?rev=1.1&content-type=text/plain
14
15 Index: 0.3.0_rc11-euse.patch
16 ===================================================================
17 Index: bin/euse
18 ===================================================================
19 --- bin/euse (revision 867)
20 +++ bin/euse (working copy)
21 @@ -9,11 +9,42 @@
22 PROGRAM_NAME=euse
23 VERSION="svn"
24
25 -MAKE_CONF_PATH=/etc/make.conf
26 -MAKE_GLOBALS_PATH=/etc/make.globals
27 -MAKE_PROFILE_PATH=/etc/make.profile
28 -MAKE_CONF_BACKUP_PATH=/etc/make.conf.euse_backup
29 +ETC="/etc"
30 +USR_SHARE_PORTAGE="/usr/share/portage"
31
32 +# define error function so it can be used immediately
33 +error() {
34 + echo "ERROR: ${1}"
35 + set +f
36 + exit 1
37 +}
38 +
39 +# /etc/make.conf can now exist in /etc/portage/make.conf, prefer it over /etc/make.conf for changes
40 +if [ -e "${ETC}/portage/make.conf" ]; then
41 + MAKE_CONF_PATH="${ETC}/portage/make.conf"
42 +elif [ -e "${ETC}/make.conf" ]; then
43 + MAKE_CONF_PATH="${ETC}/make.conf"
44 +else
45 + error "make.conf does not exist"
46 +fi
47 +MAKE_CONF_BACKUP_PATH="${MAKE_CONF_PATH}.euse_backup"
48 +
49 +# /etc/make.globals has been moved to /usr/share/portage/config/make.globals
50 +if [ -e "${USR_SHARE_PORTAGE}/config/make.globals" ]; then
51 + MAKE_GLOBALS_PATH="${USR_SHARE_PORTAGE}/config/make.globals"
52 +else
53 + MAKE_GLOBALS_PATH="${ETC}/make.globals"
54 +fi
55 +
56 +# /etc/make.profile or /etc/portage/make.profile, if /etc/make.profile exists, it will be used
57 +if [ -e "${ETC}/make.profile" ]; then
58 + MAKE_PROFILE_PATH="${ETC}/make.profile"
59 +elif [ -e "${ETC}/portage/make.profile" ]; then
60 + MAKE_PROFILE_PATH="${ETC}/portage/make.profile"
61 +else
62 + error "make.profile does not exist"
63 +fi
64 +
65 [ -z "${MODE}" ] && MODE="showhelp" # available operation modes: showhelp, showversion, showdesc, showflags, modify
66
67 parse_arguments() {
68 @@ -49,12 +80,6 @@
69 done
70 }
71
72 -error() {
73 - echo "ERROR: ${1}"
74 - set +f
75 - exit 1
76 -}
77 -
78 get_real_path() {
79 set -P
80 cd "$1"
81 @@ -67,12 +92,16 @@
82 # file permission tests
83 local descdir
84 local make_defaults
85 + local make_conf
86
87 [[ ! -d "${MAKE_PROFILE_PATH}" || ! -r "${MAKE_PROFILE_PATH}" ]] && error "${MAKE_PROFILE_PATH} is not readable"
88 + #
89 + for make_conf in $(get_all_make_conf); do
90 + [ ! -r "${make_conf}" ] && error "${make_conf} is not readable"
91 + done
92
93 descdir="$(get_portdir)/profiles"
94
95 - [ ! -r "${MAKE_CONF_PATH}" ] && error "${MAKE_CONF_PATH} is not readable"
96 [ ! -r "${MAKE_GLOBALS_PATH}" ] && error "${MAKE_GLOBALS_PATH} is not readable"
97 [ -z "$(get_portdir)" ] && error "\$PORTDIR couldn't be determined"
98 [ ! -d "${descdir}" ] && error "${descdir} does not exist or is not a directory"
99 @@ -160,8 +189,10 @@
100
101 ACTIVE_FLAGS[0]="$(reduce_incrementals ${USE})"
102 USE=""
103 - source "${MAKE_CONF_PATH}"
104 - ACTIVE_FLAGS[1]="$(reduce_incrementals ${USE})"
105 + for x in $(get_all_make_conf); do
106 + source "${x}"
107 + ACTIVE_FLAGS[1]="$(reduce_incrementals ${ACTIVE_FLAGS[1]} ${USE})"
108 + done
109 USE=""
110 for x in $(get_all_make_defaults); do
111 source "${x}"
112 @@ -196,6 +227,13 @@
113 fi
114 }
115
116 +# get all make.conf files that exist on the system
117 +get_all_make_conf() {
118 + # At least one of the files exists or we would not have made it this far
119 + for x in ${ETC}/make.conf ${ETC}/portage/make.conf; do
120 + [ -e "${x}" ] && echo "${x}"
121 + done
122 +}
123 # get all make.defaults by traversing the cascaded profile directories
124 get_all_make_defaults() {
125 local curdir
126 @@ -272,7 +310,9 @@
127 for x in $(get_all_make_defaults); do
128 source "${x}"
129 done
130 - source "${MAKE_CONF_PATH}"
131 + for x in $(get_all_make_conf); do
132 + source "${x}"
133 + done
134 USE="${use_backup}"
135 fi
136 echo "${PORTDIR}"
137
138
139
140 1.1 app-portage/gentoolkit/files/0.3.0_rc11-euse_prefix.patch
141
142 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-portage/gentoolkit/files/0.3.0_rc11-euse_prefix.patch?rev=1.1&view=markup
143 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-portage/gentoolkit/files/0.3.0_rc11-euse_prefix.patch?rev=1.1&content-type=text/plain
144
145 Index: 0.3.0_rc11-euse_prefix.patch
146 ===================================================================
147 Index: bin/euse
148 ===================================================================
149 --- bin/euse (revision 868)
150 +++ bin/euse (working copy)
151 @@ -9,8 +9,9 @@
152 PROGRAM_NAME=euse
153 VERSION="svn"
154
155 -ETC="/etc"
156 -USR_SHARE_PORTAGE="/usr/share/portage"
157 +EPREFIX=${EPREFIX:-$(portageq envvar EPREFIX)}
158 +ETC="${EPREFIX}/etc"
159 +USR_SHARE_PORTAGE="${EPREFIX}/usr/share/portage"
160
161 # define error function so it can be used immediately
162 error() {