Gentoo Archives: gentoo-commits

From: "Tomas Chvatal (scarabeus)" <scarabeus@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] eselect r789 - trunk/extern/modules
Date: Wed, 29 Dec 2010 02:27:16
Message-Id: 20101229022706.BE0A420057@flycatcher.gentoo.org
1 Author: scarabeus
2 Date: 2010-12-29 02:26:59 +0000 (Wed, 29 Dec 2010)
3 New Revision: 789
4
5 Modified:
6 trunk/extern/modules/opengl.eselect
7 Log:
8 Add the actual support for the previous commit TODO thingie.
9
10 Modified: trunk/extern/modules/opengl.eselect
11 ===================================================================
12 --- trunk/extern/modules/opengl.eselect 2010-12-29 02:06:58 UTC (rev 788)
13 +++ trunk/extern/modules/opengl.eselect 2010-12-29 02:26:59 UTC (rev 789)
14 @@ -44,30 +44,21 @@
15 local ret
16 local libdir
17 local dir
18 - local dirname
19 + local dir_name
20
21 - for libdir $(list_libdirs) ; do
22 + for libdir in $(list_libdirs) ; do
23 [[ ${ROOT} != / ]] && libdir=${libdir#${ROOT}}
24 for dir in "${PREFIX}/${libdir}"/opengl/* ; do
25 - dirname=$(basename "${dir}")
26 - [[ -d ${dir} && ${dirname} != "global" ]] || continue
27 - has ${dirname} ${ret} && continue
28 - ret=${ret:+${ret} }${dirname}
29 + dir_name=$(basename "${dir}")
30 + [[ -d ${dir} && ${dir_name} != "global" ]] || continue
31 + has ${dir_name} ${ret} && continue
32 + ret=${ret:+${ret} }${dir_name}
33 done
34 done
35
36 echo ${ret}
37 }
38
39 -# 1: filename
40 -clean_file() {
41 - local filename=$1
42 -
43 - if [[ -f ${filename} || ( -L ${filename} && ! -e ${filename} ) ]] ; then
44 - rm -f "${filename}"* || die -q "Failed to delete ${workdir}/${filename}"
45 - fi
46 -}
47 -
48 # 1: file
49 # 2: workdir
50 upgrade_file() {
51 @@ -79,10 +70,14 @@
52 [[ -f ${file} ]] || return
53 filename=$(basename "${file}")
54
55 - clean_file ${filename}
56 + if [[ -f ${filename} || ( -L ${filename} && ! -e ${filename} ) ]] ; then
57 + rm -f "${filename}"* || die -q "Failed to delete ${workdir}/${filename}"
58 + fi
59
60 #echo "DEBUG: ln -s \"${linkfile}\" \"${filename}\""
61 - ln -s "${linkfile}" "${filename}" || die -q "Failed to create symlink ${workdir}/${filename}"
62 + if [[ "x${REMOVE_ONLY}" == "xfalse" ]]; then
63 + ln -s "${linkfile}" "${filename}" || die -q "Failed to create symlink ${workdir}/${filename}"
64 + fi
65 }
66
67 setup_soname_symlinks() {
68 @@ -197,15 +192,18 @@
69 # If even mesa is not around then simply die
70 if [[ -d "${PREFIX}/${libdir}/opengl/${gl_implem}" ]] ; then
71 gl_local="${gl_implem}"
72 + REMOVE_ONLY="false" # global variable
73 else
74 - # TODO:
75 # we are moving to implementation that does not have any support
76 # for specified libdir (ie 32bit libs for mesa) so we should
77 # remove the current symlinks and continue like nothing happened.
78 -
79 - # bail out, no implementation around until the above is
80 - # implemented
81 - die -q "No proper ${gl_implem} or xorg-x11 opengl implementation found in ${PREFIX}/${libdir}/opengl/"
82 + REMOVE_ONLY="true" # global variable
83 + gl_local=$(get_current_implementation)
84 + if ! has ${gl_local} ${avail_implems}; then
85 + # skipping the libdir cause there was no profile actually
86 + # selected before
87 + continue 2
88 + fi
89 fi
90
91 setup_lib_symlinks \
92 @@ -232,7 +230,9 @@
93 "${PREFIX}/${libdir}/opengl/xorg-x11/include/"
94
95 # Setup the $LDPATH
96 - ldpath="${ldpath:+${ldpath}:}${PREFIX}/${libdir}/opengl/${gl_local}/lib"
97 + if [[ "x${REMOVE_ONLY}" == "xfalse" ]]; then
98 + ldpath="${ldpath:+${ldpath}:}${PREFIX}/${libdir}/opengl/${gl_local}/lib"
99 + fi
100 done
101
102 store_config ${ENV_FILE} LDPATH "${ldpath}"