1 |
ulm 15/03/31 16:52:39 |
2 |
|
3 |
Added: eselect-opencascade-0.eselect |
4 |
Log: |
5 |
Move package from app-admin to app-eselect category. |
6 |
|
7 |
(Portage version: 2.2.18/cvs/Linux x86_64, RepoMan options: --force, signed Manifest commit with key 9433907D693FB5B8!) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-eselect/eselect-opencascade/files/eselect-opencascade-0.eselect |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-opencascade/files/eselect-opencascade-0.eselect?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-opencascade/files/eselect-opencascade-0.eselect?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: eselect-opencascade-0.eselect |
16 |
=================================================================== |
17 |
# -*-eselect-*- vim: ft=eselect |
18 |
# Copyright (c) 2006-2013 Gentoo Foundation |
19 |
# |
20 |
# This file is part of the 'eselect' tools framework. |
21 |
# |
22 |
# eselect is free software: you can redistribute it and/or modify it under the |
23 |
# terms of the GNU General Public License as published by the Free Software |
24 |
# Foundation, either version 2 of the License, or (at your option) any later |
25 |
# version. |
26 |
# |
27 |
# eselect is distributed in the hope that it will be useful, but WITHOUT ANY |
28 |
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
29 |
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
30 |
# |
31 |
# You should have received a copy of the GNU General Public License along with |
32 |
# eselect. If not, see <http://www.gnu.org/licenses/>. |
33 |
|
34 |
MODULE=opencascade |
35 |
TARGET=${EROOT}/etc/env.d/51${MODULE} |
36 |
CONFDIR=${EROOT}/etc/env.d/${MODULE} |
37 |
|
38 |
inherit tests path-manipulation |
39 |
|
40 |
find_implems() { |
41 |
local -a implems |
42 |
for file in "${CONFDIR}"/* ; do |
43 |
[[ -f ${file} ]] || continue |
44 |
implems=(${implems[@]} "${file##*/}") |
45 |
done |
46 |
echo ${implems[@]} |
47 |
} |
48 |
|
49 |
is_active() { |
50 |
local f |
51 |
[[ $# -eq 1 ]] || die "Need exactly 1 arguments!" |
52 |
[[ -L ${TARGET} ]] || return 1 |
53 |
f=$(canonicalise ${TARGET}) |
54 |
[[ -e ${f} ]] || return 1 |
55 |
[[ ${f##*/} == ${1} ]] |
56 |
} |
57 |
|
58 |
# switch_implem $implem |
59 |
# switches $iface combination to $implem |
60 |
switch_implem() { |
61 |
[[ $# -eq 1 ]] || die "Need exactly 1 arguments!" |
62 |
$(is_active ${1}) && return |
63 |
[[ -L ${TARGET} ]] && rm -f ${TARGET} |
64 |
ln -s ${MODULE}/${1} ${TARGET} |
65 |
env-update |
66 |
echo "If you intend to use the selected opencascade in" |
67 |
echo "an already running shell, please remember to do:" |
68 |
echo |
69 |
echo ". /etc/profile" |
70 |
} |
71 |
|
72 |
do_list() { |
73 |
local implem i |
74 |
write_list_start "Installed $MODULE" |
75 |
for implem in $(find_implems) ; do |
76 |
(( i++ )) |
77 |
is_active ${implem##*/} \ |
78 |
&& implem=$(highlight_marker "${implem}") |
79 |
write_numbered_list_entry $i "${implem}" |
80 |
done |
81 |
} |
82 |
|
83 |
describe_set() { |
84 |
echo "Activate one of the installed $MODULE implementations" |
85 |
} |
86 |
|
87 |
describe_set_parameters() { |
88 |
echo "<implementation>" |
89 |
} |
90 |
|
91 |
describe_set_options() { |
92 |
echo "implementation : implementation name or number (from 'list' action)" |
93 |
} |
94 |
|
95 |
do_set() { |
96 |
[[ $# -ne 1 ]] && die -q "Please specify exactly 1 implementation!" |
97 |
local -a implems |
98 |
|
99 |
implems=( $(find_implems) ) |
100 |
|
101 |
if is_number ${1} ; then |
102 |
new_implem=${implems[$(( ${1} - 1 ))]} |
103 |
else |
104 |
new_implem=${1} |
105 |
fi |
106 |
echo $new_implem |
107 |
switch_implem ${new_implem} |
108 |
} |
109 |
|
110 |
describe_show() { |
111 |
echo "Print the currently active $MODULE implementation" |
112 |
} |
113 |
|
114 |
do_show() { |
115 |
local f n |
116 |
[[ -L ${TARGET} ]] || return 1 |
117 |
f=$(canonicalise ${TARGET}) |
118 |
[[ -f ${f} ]] || return 1 |
119 |
echo ${f##*/} |
120 |
} |