Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-eselect/eselect-mpost/files: mpost.eselect-0.3 mpost.eselect-0.2 mpost.eselect-0.1
Date: Tue, 31 Mar 2015 16:51:59
Message-Id: 20150331165156.C8B6614EE2@oystercatcher.gentoo.org
1 ulm 15/03/31 16:51:56
2
3 Added: mpost.eselect-0.3 mpost.eselect-0.2
4 mpost.eselect-0.1
5 Log:
6 Move package from app-admin to app-eselect category.
7
8 (Portage version: 2.2.18/cvs/Linux x86_64, RepoMan options: --force, signed Manifest commit with key 9433907D693FB5B8!)
9
10 Revision Changes Path
11 1.1 app-eselect/eselect-mpost/files/mpost.eselect-0.3
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-mpost/files/mpost.eselect-0.3?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-mpost/files/mpost.eselect-0.3?rev=1.1&content-type=text/plain
15
16 Index: mpost.eselect-0.3
17 ===================================================================
18 # -*-eselect-*- vim: ft=eselect
19 # Copyright 1999-2015 Gentoo Foundation
20 # Distributed under the terms of the GNU General Public License v2
21 # $Id: mpost.eselect-0.3,v 1.1 2015/03/31 16:51:56 ulm Exp $
22
23 DESCRIPTION="Manage /usr/bin/mpost implementations"
24 MAINTAINER="ml@g.o"
25 SVN_DATE='$Date: 2015/03/31 16:51:56 $'
26 VERSION=$(svn_date_to_version "${SVN_DATE}" )
27
28 # find a list of mpost symlink targets, best first
29 find_targets() {
30 local f
31 for f in "${ROOT}"/usr/bin/mpost-*; do
32 if [[ -f ${f} ]] ; then
33 echo "${f##*/mpost-}"
34 fi
35 done | sort
36 }
37
38 # find version number of currently symlinked version
39 identify_target() {
40 local f
41 f="$(canonicalise "${ROOT}"/usr/bin/mpost)"
42 echo "${f##*/mpost-}"
43 }
44
45 # try to remove the mpost symlink
46 remove_symlinks() {
47 rm -f "${ROOT}"/usr/bin/mpost &>/dev/null
48 }
49
50 # set the mpost symlink
51 set_symlinks() {
52 local target="${1}" targets
53 if is_number "${target}" && [[ ${target} -ge 1 ]] ; then
54 targets=( $(find_targets ) )
55 target=${targets[$(( ${target} - 1 ))]}
56 fi
57 if [[ -f "${ROOT}/usr/bin/mpost-${target}" ]] ; then
58 remove_symlinks
59 ln -s "mpost-${target}" "${ROOT}/usr/bin/mpost" || \
60 die "Could not set ${target} /usr/bin/mpost symlink"
61 echo "Updating TeX formats"
62 "${ROOT}"/usr/bin/fmtutil-sys --all &>/dev/null || write_warning_msg "Could not update TeX formats for some reason, mpost may not work properly."
63 else
64 die -q "Target \"${target}\" doesn't appear to be valid!"
65 fi
66 }
67
68 ### show action ###
69
70 describe_show() {
71 echo "Show the current mpost version"
72 }
73
74 do_show() {
75 [[ -z "${@}" ]] || die -q "Too many parameters"
76
77 write_list_start "Current mpost version:"
78 if [[ -L "${ROOT}/usr/bin/mpost" ]] ; then
79 write_kv_list_entry "$(identify_target)" ""
80 elif [[ -e "${ROOT}/usr/bin/mpost" ]] ; then
81 write_kv_list_entry "(not a symlink)" ""
82 else
83 write_kv_list_entry "(unset)" ""
84 fi
85 }
86
87 ### list action ###
88
89 describe_list() {
90 echo "List available mpost versions"
91 }
92
93 do_list() {
94 [[ -z "${@}" ]] || die -q "Too many parameters"
95
96 local i targets current
97 targets=( $(find_targets ) )
98 current=$(identify_target)
99 for (( i = 0; i < ${#targets[@]}; i++ )); do
100 [[ ${targets[i]} = ${current} ]] \
101 && targets[i]=$(highlight_marker "${targets[i]}")
102 done
103 write_list_start "Available mpost versions:"
104 write_numbered_list -m "(none found)" "${targets[@]}"
105 }
106
107 ### set action ###
108
109 describe_set() {
110 echo "Set a new mpost version"
111 }
112
113 describe_set_options() {
114 echo "target : Target version number or index from 'list' action"
115 }
116
117 describe_set_parameters() {
118 echo "<target>"
119 }
120
121 do_set() {
122 if [[ -z "${1}" ]] ; then
123 die -q "You didn't give me a version number"
124
125 elif [[ -n "${2}" ]] ; then
126 die -q "Too many parameters"
127
128 elif [[ -L "${ROOT}/usr/bin/mpost" ]] ; then
129 if ! remove_symlinks ; then
130 die -q "Can't remove existing version symlink"
131 elif ! set_symlinks "${1}" ; then
132 die -q "Can't set new version"
133 fi
134
135 elif [[ -e "${ROOT}/usr/bin/mpost" ]] ; then
136 die -q "${ROOT}/usr/bin/mpost seems to be from an old ebuild, please remove manually"
137 else
138 set_symlinks "${1}" || die -q "Can't set new version"
139 fi
140 }
141
142 ### update action ###
143
144 describe_update() {
145 echo "Automatically update the mpost version number"
146 }
147
148 describe_update_options() {
149 echo "--if-unset : Do not override currently selected version"
150 }
151
152 do_update() {
153 [[ -z "${1}" ]] || ( [[ -z "${2}" ]] && [[ "${1}" == "--if-unset" ]] ) || \
154 die -q "Usage error"
155
156 if [[ -L "${ROOT}/usr/bin/mpost" ]] ; then
157 [[ ${1} == "--if-unset" ]] && return
158 remove_symlinks || die -q "Can't remove existing symlink"
159 fi
160 if [[ -e "${ROOT}/usr/bin/mpost" ]] ; then
161 die -q "${ROOT}/usr/bin/mpost seems to be from an old ebuild, please remove manually"
162 elif ! [[ -z $(find_targets ) ]] ; then
163 set_symlinks 1 || die -q "Can't set a new version"
164 fi
165 }
166
167
168
169 1.1 app-eselect/eselect-mpost/files/mpost.eselect-0.2
170
171 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-mpost/files/mpost.eselect-0.2?rev=1.1&view=markup
172 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-mpost/files/mpost.eselect-0.2?rev=1.1&content-type=text/plain
173
174 Index: mpost.eselect-0.2
175 ===================================================================
176 # -*-eselect-*- vim: ft=eselect
177 # Copyright 1999-2015 Gentoo Foundation
178 # Distributed under the terms of the GNU General Public License v2
179 # $Id: mpost.eselect-0.2,v 1.1 2015/03/31 16:51:56 ulm Exp $
180
181 DESCRIPTION="Manage /usr/bin/mpost implementations"
182 MAINTAINER="ml@g.o"
183 SVN_DATE='$Date: 2015/03/31 16:51:56 $'
184 VERSION=$(svn_date_to_version "${SVN_DATE}" )
185
186 # find a list of mpost symlink targets, best first
187 find_targets() {
188 local f
189 for f in "${ROOT}"/usr/bin/mpost-*; do
190 if [[ -f ${f} ]] ; then
191 echo "${f##*/mpost-}"
192 fi
193 done | sort
194 }
195
196 # find version number of currently symlinked version
197 identify_target() {
198 local f
199 f="$(canonicalise "${ROOT}"/usr/bin/mpost)"
200 echo "${f##*/mpost-}"
201 }
202
203 # try to remove the mpost symlink
204 remove_symlinks() {
205 rm -f "${ROOT}"/usr/bin/mpost &>/dev/null
206 }
207
208 # set the mpost symlink
209 set_symlinks() {
210 local target="${1}" targets
211 if is_number "${target}" && [[ ${target} -ge 1 ]] ; then
212 targets=( $(find_targets ) )
213 target=${targets[$(( ${target} - 1 ))]}
214 fi
215 if [[ -f "${ROOT}/usr/bin/mpost-${target}" ]] ; then
216 remove_symlinks
217 ln -s "mpost-${target}" "${ROOT}/usr/bin/mpost" || \
218 die "Could not set ${target} /usr/bin/mpost symlink"
219 echo "Updating TeX formats"
220 [ -z "${ROOT}" ] && fmtutil-sys --all &>/dev/null || write_warning_msg "Could not update TeX formats for some reason, mpost may not work properly."
221 else
222 die -q "Target \"${target}\" doesn't appear to be valid!"
223 fi
224 }
225
226 ### show action ###
227
228 describe_show() {
229 echo "Show the current mpost version"
230 }
231
232 do_show() {
233 [[ -z "${@}" ]] || die -q "Too many parameters"
234
235 write_list_start "Current mpost verson:"
236 if [[ -L "${ROOT}/usr/bin/mpost" ]] ; then
237 write_kv_list_entry "$(identify_target)" ""
238 elif [[ -e "${ROOT}/usr/bin/mpost" ]] ; then
239 write_kv_list_entry "(not a symlink)" ""
240 else
241 write_kv_list_entry "(unset)" ""
242 fi
243 }
244
245 ### list action ###
246
247 describe_list() {
248 echo "List available mpost versions"
249 }
250
251 do_list() {
252 [[ -z "${@}" ]] || die -q "Too many parameters"
253
254 local i targets current
255 targets=( $(find_targets ) )
256 current=$(identify_target)
257 for (( i = 0; i < ${#targets[@]}; i++ )); do
258 [[ ${targets[i]} = ${current} ]] \
259 && targets[i]=$(highlight_marker "${targets[i]}")
260 done
261 write_list_start "Available mpost versions:"
262 write_numbered_list -m "(none found)" "${targets[@]}"
263 }
264
265 ### set action ###
266
267 describe_set() {
268 echo "Set a new mpost version"
269 }
270
271 describe_set_options() {
272 echo "target : Target version number or index from 'list' action"
273 }
274
275 describe_set_parameters() {
276 echo "<target>"
277 }
278
279 do_set() {
280 if [[ -z "${1}" ]] ; then
281 die -q "You didn't give me a version number"
282
283 elif [[ -n "${2}" ]] ; then
284 die -q "Too many parameters"
285
286 elif [[ -L "${ROOT}/usr/bin/mpost" ]] ; then
287 if ! remove_symlinks ; then
288 die -q "Can't remove existing version symlink"
289 elif ! set_symlinks "${1}" ; then
290 die -q "Can't set new version"
291 fi
292
293 elif [[ -e "${ROOT}/usr/bin/mpost" ]] ; then
294 die -q "${ROOT}/usr/bin/mpost seems to be from an old ebuild, please remove manually"
295 else
296 set_symlinks "${1}" || die -q "Can't set new version"
297 fi
298 }
299
300 ### update action ###
301
302 describe_update() {
303 echo "Automatically update the mpost version number"
304 }
305
306 describe_update_options() {
307 echo "--if-unset : Do not override currently selected version"
308 }
309
310 do_update() {
311 [[ -z "${1}" ]] || ( [[ -z "${2}" ]] && [[ "${1}" == "--if-unset" ]] ) || \
312 die -q "Usage error"
313
314 if [[ -L "${ROOT}/usr/bin/mpost" ]] ; then
315 [[ ${1} == "--if-unset" ]] && return
316 remove_symlinks || die -q "Can't remove existing symlink"
317 fi
318 if [[ -e "${ROOT}/usr/bin/mpost" ]] ; then
319 die -q "${ROOT}/usr/bin/mpost seems to be from an old ebuild, please remove manually"
320 elif ! [[ -z $(find_targets ) ]] ; then
321 set_symlinks 1 || die -q "Can't set a new version"
322 fi
323 }
324
325
326
327 1.1 app-eselect/eselect-mpost/files/mpost.eselect-0.1
328
329 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-mpost/files/mpost.eselect-0.1?rev=1.1&view=markup
330 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-mpost/files/mpost.eselect-0.1?rev=1.1&content-type=text/plain
331
332 Index: mpost.eselect-0.1
333 ===================================================================
334 # Copyright 1999-2015 Gentoo Foundation
335 # Distributed under the terms of the GNU General Public License v2
336 # $Id: mpost.eselect-0.1,v 1.1 2015/03/31 16:51:56 ulm Exp $
337
338 DESCRIPTION="Manage /usr/bin/mpost implementations"
339 MAINTAINER="ml@g.o"
340 SVN_DATE='$Date: 2015/03/31 16:51:56 $'
341 VERSION=$(svn_date_to_version "${SVN_DATE}" )
342
343 # find a list of mpost symlink targets, best first
344 find_targets() {
345 local f
346 for f in "${ROOT}"/usr/bin/mpost-*; do
347 if [[ -f ${f} ]] ; then
348 echo "${f##*/mpost-}"
349 fi
350 done | sort
351 }
352
353 # find version number of currently symlinked version
354 identify_target() {
355 local f
356 f="$(canonicalise "${ROOT}"/usr/bin/mpost)"
357 echo "${f##*/mpost-}"
358 }
359
360 # try to remove the mpost symlink
361 remove_symlinks() {
362 rm -f "${ROOT}"/usr/bin/mpost &>/dev/null
363 }
364
365 # set the mpost symlink
366 set_symlinks() {
367 local target="${1}" targets
368 if is_number "${target}" && [[ ${target} -ge 1 ]] ; then
369 targets=( $(find_targets ) )
370 target=${targets[$(( ${target} - 1 ))]}
371 fi
372 if [[ -f "${ROOT}/usr/bin/mpost-${target}" ]] ; then
373 remove_symlinks
374 ln -s "mpost-${target}" "${ROOT}/usr/bin/mpost" || \
375 die "Could not set ${target} /usr/bin/mpost symlink"
376 echo "Updating TeX formats"
377 [ -z "${ROOT}" ] && fmtutil-sys --all &>/dev/null || write_warning_msg "Could not update TeX formats for some reason, mpost may not work properly."
378 else
379 die -q "Target \"${target}\" doesn't appear to be valid!"
380 fi
381 }
382
383 ### show action ###
384
385 describe_show() {
386 echo "Show the current mpost version"
387 }
388
389 do_show() {
390 [[ -z "${@}" ]] || die -q "Too many parameters"
391
392 write_list_start "Current mpost verson:"
393 if [[ -L "${ROOT}/usr/bin/mpost" ]] ; then
394 write_kv_list_entry "$(identify_target)" ""
395 elif [[ -e "${ROOT}/usr/bin/mpost" ]] ; then
396 write_kv_list_entry "(not a symlink)" ""
397 else
398 write_kv_list_entry "(unset)" ""
399 fi
400 }
401
402 ### list action ###
403
404 describe_list() {
405 echo "List available mpost versions"
406 }
407
408 do_list() {
409 [[ -z "${@}" ]] || die -q "Too many parameters"
410
411 local i targets current
412 targets=( $(find_targets ) )
413 current=$(identify_target)
414 if [[ -n ${targets[@]} ]] ; then
415 for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do
416 [[ ${targets[${i}]} == ${current} ]] && \
417 targets[${i}]="${targets[${i}]} $(highlight '*' )"
418 done
419 write_list_start "Available mpost versions:"
420 write_numbered_list "${targets[@]}"
421 else
422 write_kv_list_entry "(none found)" ""
423 fi
424 }
425
426 ### set action ###
427
428 describe_set() {
429 echo "Set a new mpost version"
430 }
431
432 describe_set_options() {
433 echo "target : Target version number or index from 'list' action"
434 }
435
436 describe_set_parameters() {
437 echo "<target>"
438 }
439
440 do_set() {
441 if [[ -z "${1}" ]] ; then
442 die -q "You didn't give me a version number"
443
444 elif [[ -n "${2}" ]] ; then
445 die -q "Too many parameters"
446
447 elif [[ -L "${ROOT}/usr/bin/mpost" ]] ; then
448 if ! remove_symlinks ; then
449 die -q "Can't remove existing version symlink"
450 elif ! set_symlinks "${1}" ; then
451 die -q "Can't set new version"
452 fi
453
454 elif [[ -e "${ROOT}/usr/bin/mpost" ]] ; then
455 die -q "${ROOT}/usr/bin/mpost seems to be from an old ebuild, please remove manually"
456 else
457 set_symlinks "${1}" || die -q "Can't set new version"
458 fi
459 }
460
461 ### update action ###
462
463 describe_update() {
464 echo "Automatically update the mpost version number"
465 }
466
467 describe_update_options() {
468 echo "--if-unset : Do not override currently selected version"
469 }
470
471 do_update() {
472 [[ -z "${1}" ]] || ( [[ -z "${2}" ]] && [[ "${1}" == "--if-unset" ]] ) || \
473 die -q "Usage error"
474
475 if [[ -L "${ROOT}/usr/bin/mpost" ]] ; then
476 [[ ${1} == "--if-unset" ]] && return
477 remove_symlinks || die -q "Can't remove existing symlink"
478 fi
479 if [[ -e "${ROOT}/usr/bin/mpost" ]] ; then
480 die -q "${ROOT}/usr/bin/mpost seems to be from an old ebuild, please remove manually"
481 elif ! [[ -z $(find_targets ) ]] ; then
482 set_symlinks 1 || die -q "Can't set a new version"
483 fi
484 }
485
486 # vim: set ft=eselect :