Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: eutils.eclass ChangeLog
Date: Tue, 31 Jan 2012 06:44:11
Message-Id: 20120131064400.A9E682004B@flycatcher.gentoo.org
1 ulm 12/01/31 06:44:00
2
3 Modified: eutils.eclass ChangeLog
4 Log:
5 Cdrom functions have been split out to dedicated cdrom.eclass. For the
6 time being, inherit cdrom; this can be removed once bug 398809 is fixed.
7
8 Revision Changes Path
9 1.379 eclass/eutils.eclass
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?rev=1.379&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?rev=1.379&content-type=text/plain
13 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/eutils.eclass?r1=1.378&r2=1.379
14
15 Index: eutils.eclass
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v
18 retrieving revision 1.378
19 retrieving revision 1.379
20 diff -u -r1.378 -r1.379
21 --- eutils.eclass 31 Jan 2012 06:36:19 -0000 1.378
22 +++ eutils.eclass 31 Jan 2012 06:44:00 -0000 1.379
23 @@ -1,6 +1,6 @@
24 # Copyright 1999-2012 Gentoo Foundation
25 # Distributed under the terms of the GNU General Public License v2
26 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.378 2012/01/31 06:36:19 ulm Exp $
27 +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.379 2012/01/31 06:44:00 ulm Exp $
28
29 # @ECLASS: eutils.eclass
30 # @MAINTAINER:
31 @@ -18,7 +18,7 @@
32 if [[ ${___ECLASS_ONCE_EUTILS} != "recur -_+^+_- spank" ]] ; then
33 ___ECLASS_ONCE_EUTILS="recur -_+^+_- spank"
34
35 -inherit multilib portability user
36 +inherit multilib cdrom user
37
38 DESCRIPTION="Based on the ${ECLASS} eclass"
39
40 @@ -1155,221 +1155,6 @@
41 assert "failure unpacking (${filetype}) makeself ${shrtsrc} ('${ver}' +${skip})"
42 }
43
44 -# @FUNCTION: cdrom_get_cds
45 -# @USAGE: <file on cd1> [file on cd2] [file on cd3] [...]
46 -# @DESCRIPTION:
47 -# Aquire cd(s) for those lovely cd-based emerges. Yes, this violates
48 -# the whole 'non-interactive' policy, but damnit I want CD support !
49 -#
50 -# With these cdrom functions we handle all the user interaction and
51 -# standardize everything. All you have to do is call cdrom_get_cds()
52 -# and when the function returns, you can assume that the cd has been
53 -# found at CDROM_ROOT.
54 -#
55 -# The function will attempt to locate a cd based upon a file that is on
56 -# the cd. The more files you give this function, the more cds
57 -# the cdrom functions will handle.
58 -#
59 -# Normally the cdrom functions will refer to the cds as 'cd #1', 'cd #2',
60 -# etc... If you want to give the cds better names, then just export
61 -# the appropriate CDROM_NAME variable before calling cdrom_get_cds().
62 -# Use CDROM_NAME for one cd, or CDROM_NAME_# for multiple cds. You can
63 -# also use the CDROM_NAME_SET bash array.
64 -#
65 -# For those multi cd ebuilds, see the cdrom_load_next_cd() function.
66 -cdrom_get_cds() {
67 - # first we figure out how many cds we're dealing with by
68 - # the # of files they gave us
69 - local cdcnt=0
70 - local f=
71 - for f in "$@" ; do
72 - ((++cdcnt))
73 - export CDROM_CHECK_${cdcnt}="$f"
74 - done
75 - export CDROM_TOTAL_CDS=${cdcnt}
76 - export CDROM_CURRENT_CD=1
77 -
78 - # now we see if the user gave use CD_ROOT ...
79 - # if they did, let's just believe them that it's correct
80 - if [[ -n ${CD_ROOT}${CD_ROOT_1} ]] ; then
81 - local var=
82 - cdcnt=0
83 - while [[ ${cdcnt} -lt ${CDROM_TOTAL_CDS} ]] ; do
84 - ((++cdcnt))
85 - var="CD_ROOT_${cdcnt}"
86 - [[ -z ${!var} ]] && var="CD_ROOT"
87 - if [[ -z ${!var} ]] ; then
88 - eerror "You must either use just the CD_ROOT"
89 - eerror "or specify ALL the CD_ROOT_X variables."
90 - eerror "In this case, you will need ${CDROM_TOTAL_CDS} CD_ROOT_X variables."
91 - die "could not locate CD_ROOT_${cdcnt}"
92 - fi
93 - done
94 - export CDROM_ROOT=${CD_ROOT_1:-${CD_ROOT}}
95 - einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}"
96 - export CDROM_SET=-1
97 - for f in ${CDROM_CHECK_1//:/ } ; do
98 - ((++CDROM_SET))
99 - [[ -e ${CDROM_ROOT}/${f} ]] && break
100 - done
101 - export CDROM_MATCH=${f}
102 - return
103 - fi
104 -
105 - # User didn't help us out so lets make sure they know they can
106 - # simplify the whole process ...
107 - if [[ ${CDROM_TOTAL_CDS} -eq 1 ]] ; then
108 - einfo "This ebuild will need the ${CDROM_NAME:-cdrom for ${PN}}"
109 - echo
110 - einfo "If you do not have the CD, but have the data files"
111 - einfo "mounted somewhere on your filesystem, just export"
112 - einfo "the variable CD_ROOT so that it points to the"
113 - einfo "directory containing the files."
114 - echo
115 - einfo "For example:"
116 - einfo "export CD_ROOT=/mnt/cdrom"
117 - echo
118 - else
119 - if [[ -n ${CDROM_NAME_SET} ]] ; then
120 - # Translate the CDROM_NAME_SET array into CDROM_NAME_#
121 - cdcnt=0
122 - while [[ ${cdcnt} -lt ${CDROM_TOTAL_CDS} ]] ; do
123 - ((++cdcnt))
124 - export CDROM_NAME_${cdcnt}="${CDROM_NAME_SET[$((${cdcnt}-1))]}"
125 - done
126 - fi
127 -
128 - einfo "This package will need access to ${CDROM_TOTAL_CDS} cds."
129 - cdcnt=0
130 - while [[ ${cdcnt} -lt ${CDROM_TOTAL_CDS} ]] ; do
131 - ((++cdcnt))
132 - var="CDROM_NAME_${cdcnt}"
133 - [[ ! -z ${!var} ]] && einfo " CD ${cdcnt}: ${!var}"
134 - done
135 - echo
136 - einfo "If you do not have the CDs, but have the data files"
137 - einfo "mounted somewhere on your filesystem, just export"
138 - einfo "the following variables so they point to the right place:"
139 - einfon ""
140 - cdcnt=0
141 - while [[ ${cdcnt} -lt ${CDROM_TOTAL_CDS} ]] ; do
142 - ((++cdcnt))
143 - echo -n " CD_ROOT_${cdcnt}"
144 - done
145 - echo
146 - einfo "Or, if you have all the files in the same place, or"
147 - einfo "you only have one cdrom, you can export CD_ROOT"
148 - einfo "and that place will be used as the same data source"
149 - einfo "for all the CDs."
150 - echo
151 - einfo "For example:"
152 - einfo "export CD_ROOT_1=/mnt/cdrom"
153 - echo
154 - fi
155 -
156 - export CDROM_SET=""
157 - export CDROM_CURRENT_CD=0
158 - cdrom_load_next_cd
159 -}
160 -
161 -# @FUNCTION: cdrom_load_next_cd
162 -# @DESCRIPTION:
163 -# Some packages are so big they come on multiple CDs. When you're done reading
164 -# files off a CD and want access to the next one, just call this function.
165 -# Again, all the messy details of user interaction are taken care of for you.
166 -# Once this returns, just read the variable CDROM_ROOT for the location of the
167 -# mounted CD. Note that you can only go forward in the CD list, so make sure
168 -# you only call this function when you're done using the current CD.
169 -cdrom_load_next_cd() {
170 - local var
171 - ((++CDROM_CURRENT_CD))
172 -
173 - unset CDROM_ROOT
174 - var=CD_ROOT_${CDROM_CURRENT_CD}
175 - [[ -z ${!var} ]] && var="CD_ROOT"
176 - if [[ -z ${!var} ]] ; then
177 - var="CDROM_CHECK_${CDROM_CURRENT_CD}"
178 - _cdrom_locate_file_on_cd ${!var}
179 - else
180 - export CDROM_ROOT=${!var}
181 - fi
182 -
183 - einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}"
184 -}
185 -
186 -# this is used internally by the cdrom_get_cds() and cdrom_load_next_cd()
187 -# functions. this should *never* be called from an ebuild.
188 -# all it does is try to locate a give file on a cd ... if the cd isn't
189 -# found, then a message asking for the user to insert the cdrom will be
190 -# displayed and we'll hang out here until:
191 -# (1) the file is found on a mounted cdrom
192 -# (2) the user hits CTRL+C
193 -_cdrom_locate_file_on_cd() {
194 - local mline=""
195 - local showedmsg=0 showjolietmsg=0
196 -
197 - while [[ -z ${CDROM_ROOT} ]] ; do
198 - local i=0
199 - local -a cdset=(${*//:/ })
200 - if [[ -n ${CDROM_SET} ]] ; then
201 - cdset=(${cdset[${CDROM_SET}]})
202 - fi
203 -
204 - while [[ -n ${cdset[${i}]} ]] ; do
205 - local dir=$(dirname ${cdset[${i}]})
206 - local file=$(basename ${cdset[${i}]})
207 -
208 - local point= node= fs= foo=
209 - while read point node fs foo ; do
210 - [[ " cd9660 iso9660 udf " != *" ${fs} "* ]] && \
211 - ! [[ ${fs} == "subfs" && ",${opts}," == *",fs=cdfss,"* ]] \
212 - && continue
213 - point=${point//\040/ }
214 - [[ ! -d ${point}/${dir} ]] && continue
215 - [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}") ]] && continue
216 - export CDROM_ROOT=${point}
217 - export CDROM_SET=${i}
218 - export CDROM_MATCH=${cdset[${i}]}
219 - return
220 - done <<< "$(get_mounts)"
221 -
222 - ((++i))
223 - done
224 -
225 - echo
226 - if [[ ${showedmsg} -eq 0 ]] ; then
227 - if [[ ${CDROM_TOTAL_CDS} -eq 1 ]] ; then
228 - if [[ -z ${CDROM_NAME} ]] ; then
229 - einfo "Please insert+mount the cdrom for ${PN} now !"
230 - else
231 - einfo "Please insert+mount the ${CDROM_NAME} cdrom now !"
232 - fi
233 - else
234 - if [[ -z ${CDROM_NAME_1} ]] ; then
235 - einfo "Please insert+mount cd #${CDROM_CURRENT_CD} for ${PN} now !"
236 - else
237 - local var="CDROM_NAME_${CDROM_CURRENT_CD}"
238 - einfo "Please insert+mount the ${!var} cdrom now !"
239 - fi
240 - fi
241 - showedmsg=1
242 - fi
243 - einfo "Press return to scan for the cd again"
244 - einfo "or hit CTRL+C to abort the emerge."
245 - echo
246 - if [[ ${showjolietmsg} -eq 0 ]] ; then
247 - showjolietmsg=1
248 - else
249 - ewarn "If you are having trouble with the detection"
250 - ewarn "of your CD, it is possible that you do not have"
251 - ewarn "Joliet support enabled in your kernel. Please"
252 - ewarn "check that CONFIG_JOLIET is enabled in your kernel."
253 - ebeep 5
254 - fi
255 - read || die "something is screwed with your system"
256 - done
257 -}
258 -
259 # @FUNCTION: strip-linguas
260 # @USAGE: [<allow LINGUAS>|<-i|-u> <directories of .po files>]
261 # @DESCRIPTION:
262
263
264
265 1.108 eclass/ChangeLog
266
267 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.108&view=markup
268 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.108&content-type=text/plain
269 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.107&r2=1.108
270
271 Index: ChangeLog
272 ===================================================================
273 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
274 retrieving revision 1.107
275 retrieving revision 1.108
276 diff -u -r1.107 -r1.108
277 --- ChangeLog 31 Jan 2012 06:36:19 -0000 1.107
278 +++ ChangeLog 31 Jan 2012 06:44:00 -0000 1.108
279 @@ -1,6 +1,10 @@
280 # ChangeLog for eclass directory
281 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
282 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.107 2012/01/31 06:36:19 ulm Exp $
283 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.108 2012/01/31 06:44:00 ulm Exp $
284 +
285 + 31 Jan 2012; Ulrich Müller <ulm@g.o> eutils.eclass:
286 + Cdrom functions have been split out to dedicated cdrom.eclass. For the
287 + time being, inherit cdrom; this can be removed once bug 398809 is fixed.
288
289 31 Jan 2012; Ulrich Müller <ulm@g.o> eutils.eclass:
290 Use ${P}-${PR} instead of ${PF} in epatch_user.