/[gentoo-x86]/eclass/kde4-functions.eclass
Gentoo

Contents of /eclass/kde4-functions.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.66 - (hide annotations) (download)
Thu Aug 15 14:52:58 2013 UTC (15 months, 1 week ago) by kensington
Branch: MAIN
Changes since 1.65: +1 -8 lines
Remove EAPI 3 support.

1 alexxy 1.63 # Copyright 1999-2013 Gentoo Foundation
2 ingmar 1.1 # Distributed under the terms of the GNU General Public License v2
3 kensington 1.66 # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.65 2013/07/03 09:22:39 kensington Exp $
4 ingmar 1.1
5 alexxy 1.25 inherit versionator
6    
7 ingmar 1.1 # @ECLASS: kde4-functions.eclass
8     # @MAINTAINER:
9     # kde@gentoo.org
10 scarabeus 1.10 # @BLURB: Common ebuild functions for KDE 4 packages
11 ingmar 1.1 # @DESCRIPTION:
12     # This eclass contains all functions shared by the different eclasses,
13 scarabeus 1.10 # for KDE 4 ebuilds.
14    
15 kensington 1.64 if [[ ${___ECLASS_ONCE_KDE4_FUNCTIONS} != "recur -_+^+_- spank" ]] ; then
16     ___ECLASS_ONCE_KDE4_FUNCTIONS="recur -_+^+_- spank"
17    
18 scarabeus 1.10 # @ECLASS-VARIABLE: EAPI
19     # @DESCRIPTION:
20 kensington 1.65 # Currently kde4 eclasses support EAPI 4 and 5.
21 scarabeus 1.14 case ${EAPI:-0} in
22 kensington 1.65 4|5) : ;;
23 reavertm 1.32 *) die "EAPI=${EAPI} is not supported" ;;
24 scarabeus 1.10 esac
25 ingmar 1.1
26 scarabeus 1.45 # @ECLASS-VARIABLE: KDE_OVERRIDE_MINIMAL
27     # @DESCRIPTION:
28     # For use only in very few well-defined cases; normally it should be unset.
29     # If this variable is set, all calls to add_kdebase_dep return a dependency on
30     # at least this version, independent of the version of the package itself.
31     # If you know exactly that one specific NEW KDE component builds and runs fine
32     # with all the rest of KDE at an OLDER version, you can set this old version here.
33     # Warning- may lead to general instability and kill your pet targh.
34    
35 ingmar 1.1 # @ECLASS-VARIABLE: KDEBASE
36     # @DESCRIPTION:
37     # This gets set to a non-zero value when a package is considered a kde or
38 johu 1.61 # kdevelop ebuild.
39 scarabeus 1.15 if [[ ${CATEGORY} = kde-base ]]; then
40 ingmar 1.1 debug-print "${ECLASS}: KDEBASE ebuild recognized"
41 scarabeus 1.10 KDEBASE=kde-base
42 scarabeus 1.45 elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
43 reavertm 1.31 debug-print "${ECLASS}: KDEVELOP ebuild recognized"
44 scarabeus 1.45 KDEBASE=kdevelop
45 ingmar 1.1 fi
46    
47 scarabeus 1.45 # determine the build type
48 abcd 1.51 if [[ ${PV} = *9999* ]]; then
49 johu 1.60 KDE_BUILD_TYPE="live"
50 scarabeus 1.45 else
51 johu 1.60 KDE_BUILD_TYPE="release"
52 scarabeus 1.45 fi
53 johu 1.60 export KDE_BUILD_TYPE
54 scarabeus 1.45
55 johu 1.60 # Set reponame and SCM for modules that have fully migrated to git
56 scarabeus 1.45 # (hack - it's here because it needs to be before SCM inherits from kde4-base)
57 johu 1.60 if [[ ${KDE_BUILD_TYPE} == live ]]; then
58 scarabeus 1.45 case "${KMNAME}" in
59     kdebase-workspace)
60     EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace}
61     ;;
62     kdebase-runtime)
63     EGIT_REPONAME=${EGIT_REPONAME:=kde-runtime}
64     ;;
65     kdebase-apps)
66     EGIT_REPONAME=${EGIT_REPONAME:=kde-baseapps}
67     ;;
68     esac
69     fi
70    
71     # @ECLASS-VARIABLE: KDE_SCM
72     # @DESCRIPTION:
73     # If this is a live package which scm does it use
74 alexxy 1.63 # Everything else uses git by default
75     KDE_SCM="${KDE_SCM:-git}"
76 scarabeus 1.45 case ${KDE_SCM} in
77     svn|git) ;;
78     *) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
79     esac
80    
81     # @ECLASS-VARIABLE: KDE_LINGUAS
82     # @DESCRIPTION:
83     # This is a whitespace-separated list of translations this ebuild supports.
84     # These translations are automatically added to IUSE. Therefore ebuilds must set
85     # this variable before inheriting any eclasses. To enable only selected
86     # translations, ebuilds must call enable_selected_linguas(). kde4-{base,meta}.eclass does
87     # this for you.
88     #
89 johu 1.61 # Example: KDE_LINGUAS="de en_GB nl"
90 johu 1.60 if [[ ${KDE_BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
91 scarabeus 1.45 for _lingua in ${KDE_LINGUAS}; do
92     IUSE="${IUSE} linguas_${_lingua}"
93     done
94     fi
95    
96 ingmar 1.1 # @FUNCTION: buildsycoca
97     # @DESCRIPTION:
98     # Function to rebuild the KDE System Configuration Cache.
99     # All KDE ebuilds should run this in pkg_postinst and pkg_postrm.
100     buildsycoca() {
101     debug-print-function ${FUNCNAME} "$@"
102 scarabeus 1.19
103 alexxy 1.25 # We no longer need to run kbuildsycoca4, as kded does that automatically, as needed
104 scarabeus 1.15
105     # fix permission for some directories
106 abcd 1.52 for x in usr/share/{config,kde4}; do
107     DIRS=${EROOT}usr
108     [[ -d "${EROOT}${x}" ]] || break # nothing to do if directory does not exist
109     # fixes Bug 318237
110     if use userland_BSD ; then
111     [[ $(stat -f %p "${EROOT}${x}") != 40755 ]]
112     local stat_rtn="$?"
113     else
114     [[ $(stat --format=%a "${EROOT}${x}") != 755 ]]
115     local stat_rtn=$?
116     fi
117     if [[ $stat_rtn != 1 ]] ; then
118     ewarn "QA Notice:"
119     ewarn "Package ${PN} is breaking ${EROOT}${x} permissions."
120     ewarn "Please report this issue to gentoo bugzilla."
121     einfo "Permissions will get adjusted automatically now."
122     find "${EROOT}${x}" -type d -print0 | xargs -0 chmod 755
123     fi
124 scarabeus 1.15 done
125 ingmar 1.1 }
126    
127     # @FUNCTION: comment_all_add_subdirectory
128     # @USAGE: [list of directory names]
129     # @DESCRIPTION:
130 scarabeus 1.10 # Recursively comment all add_subdirectory instructions in listed directories,
131     # except those in cmake/.
132 ingmar 1.1 comment_all_add_subdirectory() {
133     find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \
134 wired 1.22 xargs -0 sed -i \
135     -e '/^[[:space:]]*add_subdirectory/s/^/#DONOTCOMPILE /' \
136     -e '/^[[:space:]]*ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
137     -e '/^[[:space:]]*macro_optional_add_subdirectory/s/^/#DONOTCOMPILE /' \
138     -e '/^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \
139     || die "${LINENO}: Initial sed died"
140 ingmar 1.1 }
141    
142 zlin 1.5 # @FUNCTION: enable_selected_linguas
143     # @DESCRIPTION:
144 scarabeus 1.10 # Enable translations based on LINGUAS settings and translations supported by
145     # the package (see KDE_LINGUAS). By default, translations are found in "${S}"/po
146 zlin 1.5 # but this default can be overridden by defining KDE_LINGUAS_DIR.
147     enable_selected_linguas() {
148 wired 1.22 debug-print-function ${FUNCNAME} "$@"
149    
150 alexxy 1.37 local x
151 scarabeus 1.10
152 scarabeus 1.19 # if there is no linguas defined we enable everything
153 scarabeus 1.20 if ! $(env | grep -q "^LINGUAS="); then
154     return 0
155     fi
156 wired 1.22
157     # @ECLASS-VARIABLE: KDE_LINGUAS_DIR
158     # @DESCRIPTION:
159     # Specified folder where application translations are located.
160 alexxy 1.37 # Can be defined as array of folders where translations are located.
161     # Note that space separated list of dirs is not supported.
162     # Default value is set to "po".
163     if [[ "$(declare -p KDE_LINGUAS_DIR 2>/dev/null 2>&1)" == "declare -a"* ]]; then
164     debug-print "$FUNCNAME: we have these subfolders defined: ${KDE_LINGUAS_DIR}"
165 scarabeus 1.45 for x in ${KDE_LINGUAS_DIR[@]}; do
166 alexxy 1.37 _enable_selected_linguas_dir ${x}
167     done
168     else
169     KDE_LINGUAS_DIR=${KDE_LINGUAS_DIR:="po"}
170     _enable_selected_linguas_dir ${KDE_LINGUAS_DIR}
171     fi
172 wired 1.22 }
173    
174     # @FUNCTION: enable_selected_doc_linguas
175     # @DESCRIPTION:
176     # Enable only selected linguas enabled doc folders.
177     enable_selected_doc_linguas() {
178     debug-print-function ${FUNCNAME} "$@"
179    
180     # @ECLASS-VARIABLE: KDE_DOC_DIRS
181     # @DESCRIPTION:
182     # Variable specifying whitespace separated patterns for documentation locations.
183     # Default is "doc/%lingua"
184     KDE_DOC_DIRS=${KDE_DOC_DIRS:='doc/%lingua'}
185     local linguas
186     for pattern in ${KDE_DOC_DIRS}; do
187    
188     local handbookdir=`dirname ${pattern}`
189     local translationdir=`basename ${pattern}`
190     # Do filename pattern supplied, treat as directory
191 scarabeus 1.45 [[ ${handbookdir} = '.' ]] && handbookdir=${translationdir} && translationdir=
192     [[ -d ${handbookdir} ]] || die 'wrong doc dir specified'
193 wired 1.22
194     if ! use handbook; then
195     # Disable whole directory
196     sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
197     -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
198     -i CMakeLists.txt || die 'failed to comment out all handbooks'
199     else
200 dilfridge 1.59 # if there is no linguas defined we enable everything (i.e. comment out nothing)
201     if ! $(env | grep -q "^LINGUAS="); then
202     return 0
203     fi
204    
205 wired 1.22 # Disable subdirectories recursively
206     comment_all_add_subdirectory "${handbookdir}"
207     # Add requested translations
208     local lingua
209     for lingua in en ${KDE_LINGUAS}; do
210 scarabeus 1.45 if [[ ${lingua} = en ]] || use linguas_${lingua}; then
211     if [[ -d ${handbookdir}/${translationdir//%lingua/${lingua}} ]]; then
212 wired 1.22 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
213     -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \
214     -i "${handbookdir}"/CMakeLists.txt && ! has ${lingua} ${linguas} && linguas="${linguas} ${lingua}"
215     fi
216     fi
217     done
218     fi
219    
220     done
221     [[ -n "${linguas}" ]] && einfo "Enabling handbook translations:${linguas}"
222 zlin 1.5 }
223    
224 scarabeus 1.11 # @FUNCTION: migrate_store_dir
225     # @DESCRIPTION:
226 scarabeus 1.15 # Universal store dir migration
227     # * performs split of kdebase to kdebase-apps when needed
228     # * moves playground/extragear kde4-base-style to toplevel dir
229 scarabeus 1.11 migrate_store_dir() {
230 scarabeus 1.45 if [[ ${KDE_SCM} != svn ]]; then
231     die "migrate_store_dir() only makes sense for subversion"
232     fi
233    
234 scarabeus 1.15 local cleandir="${ESVN_STORE_DIR}/KDE"
235 scarabeus 1.45
236     if [[ -d ${cleandir} ]]; then
237 scarabeus 1.11 ewarn "'${cleandir}' has been found. Moving contents to new location."
238     addwrite "${ESVN_STORE_DIR}"
239     # Split kdebase
240     local module
241     if pushd "${cleandir}"/kdebase/kdebase > /dev/null; then
242     for module in `find . -maxdepth 1 -type d -name [a-z0-9]\*`; do
243     module="${module#./}"
244     mkdir -p "${ESVN_STORE_DIR}/kdebase-${module}" && mv -f "${module}" "${ESVN_STORE_DIR}/kdebase-${module}" || \
245     die "Failed to move to '${ESVN_STORE_DIR}/kdebase-${module}'."
246     done
247     popd > /dev/null
248     rm -fr "${cleandir}/kdebase" || \
249     die "Failed to remove ${cleandir}/kdebase. You need to remove it manually."
250     fi
251     # Move the rest
252     local pkg
253     for pkg in "${cleandir}"/*; do
254 scarabeus 1.15 mv -f "${pkg}" "${ESVN_STORE_DIR}"/ || eerror "Failed to move '${pkg}'"
255 scarabeus 1.11 done
256 scarabeus 1.45 rmdir "${cleandir}" || die "Could not move obsolete KDE store dir. Please move '${cleandir}' contents to appropriate location (possibly ${ESVN_STORE_DIR}) and manually remove '${cleandir}' in order to continue."
257 scarabeus 1.11 fi
258 scarabeus 1.15
259 ssuominen 1.55 if ! has kde4-meta ${INHERITED}; then
260 scarabeus 1.15 case ${KMNAME} in
261     extragear*|playground*)
262 scarabeus 1.45 local scmlocalpath="${ESVN_STORE_DIR}"/"${KMNAME}"/"${PN}"
263     if [[ -d "${scmlocalpath}" ]]; then
264 scarabeus 1.15 local destdir="${ESVN_STORE_DIR}"/"${ESVN_PROJECT}"/"`basename "${ESVN_REPO_URI}"`"
265 scarabeus 1.45 ewarn "'${scmlocalpath}' has been found."
266 scarabeus 1.15 ewarn "Moving contents to new location: ${destdir}"
267     addwrite "${ESVN_STORE_DIR}"
268 scarabeus 1.45 mkdir -p "${ESVN_STORE_DIR}"/"${ESVN_PROJECT}" && mv -f "${scmlocalpath}" "${destdir}" \
269     || die "Failed to move to '${scmlocalpath}'"
270 scarabeus 1.15 # Try cleaning empty directories
271 scarabeus 1.45 rmdir "`dirname "${scmlocalpath}"`" 2> /dev/null
272 scarabeus 1.15 fi
273     ;;
274     esac
275     fi
276 scarabeus 1.11 }
277    
278 scarabeus 1.10 # Functions handling KMLOADLIBS and KMSAVELIBS
279 ingmar 1.1
280 scarabeus 1.10 # @FUNCTION: save_library_dependencies
281     # @DESCRIPTION:
282     # Add exporting CMake dependencies for current package
283     save_library_dependencies() {
284 abcd 1.51 local depsfile="${T}/${PN}"
285 scarabeus 1.10
286 scarabeus 1.15 ebegin "Saving library dependencies in ${depsfile##*/}"
287 scarabeus 1.10 echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \
288     die "Failed to save the library dependencies."
289     eend $?
290 ingmar 1.1 }
291    
292 scarabeus 1.10 # @FUNCTION: install_library_dependencies
293 ingmar 1.1 # @DESCRIPTION:
294 scarabeus 1.10 # Install generated CMake library dependencies to /var/lib/kde
295     install_library_dependencies() {
296 abcd 1.51 local depsfile="${T}/${PN}"
297 scarabeus 1.15
298     ebegin "Installing library dependencies as ${depsfile##*/}"
299 abcd 1.28 insinto /var/lib/kde
300 scarabeus 1.10 doins "${depsfile}" || die "Failed to install library dependencies."
301     eend $?
302     }
303 ingmar 1.1
304 scarabeus 1.10 # @FUNCTION: load_library_dependencies
305     # @DESCRIPTION:
306     # Inject specified library dependencies in current package
307     load_library_dependencies() {
308     local pn i depsfile
309 scarabeus 1.15 ebegin "Injecting library dependencies from '${KMLOADLIBS}'"
310 scarabeus 1.10
311     i=0
312     for pn in ${KMLOADLIBS} ; do
313     ((i++))
314 abcd 1.51 depsfile="${EPREFIX}/var/lib/kde/${pn}"
315     [[ -r ${depsfile} ]] || depsfile="${EPREFIX}/var/lib/kde/${pn}:$(get_kde_version)"
316 scarabeus 1.45 [[ -r ${depsfile} ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}."
317 scarabeus 1.10 sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \
318     die "Failed to include library dependencies for ${pn}"
319     done
320     eend $?
321 ingmar 1.1 }
322 scarabeus 1.23
323     # @FUNCTION: add_blocker
324     # @DESCRIPTION:
325     # Create correct RDEPEND value for blocking correct package.
326 alexxy 1.25 # Useful for file-collision blocks.
327     # Parameters are package and version(s) to block.
328     # add_blocker kdelibs 4.2.4
329 abcd 1.52 # If no version is specified, then all versions will be blocked.
330     # If the version is 0, then no versions will be blocked.
331     # If a second version ending in ":3.5" is passed, then the version listed for
332     # that slot will be blocked as well.
333     #
334     # Examples:
335     # # Block all versions of kdelibs
336     # add_blocker kdelibs
337 alexxy 1.25 #
338 abcd 1.52 # # Block all versions of kdelibs older than 4.3.50
339     # add_blocker kdelibs 4.3.50
340 alexxy 1.25 #
341 abcd 1.52 # # Block kdelibs 3.5.10 and older, but not any version of
342     # # kdelibs from KDE 4
343     # add_blocker kdelibs 0 3.5.10:3.5
344 scarabeus 1.23 add_blocker() {
345     debug-print-function ${FUNCNAME} "$@"
346    
347 abcd 1.54 [[ -z ${1} ]] && die "Missing parameter"
348     local pkg=kde-base/$1 atom old_ver="unset" use
349     if [[ $pkg == *\[*\] ]]; then
350     use=${pkg/#*\[/[}
351     pkg=${pkg%\[*\]}
352     fi
353    
354     [[ "$3" == *:3.5 ]] && old_ver=${3%:3.5}
355    
356     # If the version passed is "0", do nothing
357     if [[ ${2} != 0 ]]; then
358     # If no version was passed, block all versions in this slot
359     if [[ -z ${2} ]]; then
360     atom=${pkg}
361     # If the version passed begins with a "<", then use "<" instead of "<="
362     elif [[ ${2::1} == "<" ]]; then
363     # this also removes the first character of the version, which is a "<"
364     atom="<${pkg}-${2:1}"
365     else
366     atom="<=${pkg}-${2}"
367     fi
368     RDEPEND+=" !${atom}:4${use}"
369     fi
370    
371     # Do the same thing as above for :3.5, except that we don't want any
372     # output if no parameter was passed.
373     if [[ ${old_ver} != "unset" ]]; then
374     if [[ -z ${old_ver} ]]; then
375     atom=${pkg}
376     elif [[ ${old_ver::1} == "<" ]]; then
377     atom="<${pkg}-${old_ver:1}"
378     else
379     atom="<=${pkg}-${old_ver}"
380     fi
381     RDEPEND+=" !${atom}:3.5${use}"
382     fi
383 alexxy 1.25 }
384    
385 alexxy 1.37 # @FUNCTION: add_kdebase_dep
386     # @DESCRIPTION:
387 abcd 1.54 # Create proper dependency for kde-base/ dependencies.
388 scarabeus 1.45 # This takes 1 to 3 arguments. The first being the package name, the optional
389     # second is additional USE flags to append, and the optional third is the
390     # version to use instead of the automatic version (use sparingly).
391     # The output of this should be added directly to DEPEND/RDEPEND, and may be
392     # wrapped in a USE conditional (but not an || conditional without an extra set
393     # of parentheses).
394 alexxy 1.37 add_kdebase_dep() {
395     debug-print-function ${FUNCNAME} "$@"
396    
397 scarabeus 1.45 local ver
398    
399     if [[ -n ${3} ]]; then
400     ver=${3}
401     elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
402     ver=${KDE_OVERRIDE_MINIMAL}
403     elif [[ ${KDEBASE} != kde-base ]]; then
404     ver=${KDE_MINIMAL}
405 abcd 1.54 # if building stable-live version depend just on the raw KDE version
406 scarabeus 1.45 # to allow merging packages against more stable basic stuff
407     elif [[ ${PV} == *.9999 ]]; then
408 abcd 1.51 ver=$(get_kde_version)
409 scarabeus 1.45 else
410     ver=${PV}
411     fi
412    
413 alexxy 1.37 [[ -z ${1} ]] && die "Missing parameter"
414    
415 abcd 1.54 echo " >=kde-base/${1}-${ver}:4[aqua=${2:+,${2}}]"
416 alexxy 1.25 }
417    
418 alexxy 1.37 # local function to enable specified translations for specified directory
419     # used from kde4-functions_enable_selected_linguas function
420     _enable_selected_linguas_dir() {
421     local lingua linguas sr_mess wp
422     local dir=${1}
423 alexxy 1.25
424 scarabeus 1.45 [[ -d ${dir} ]] || die "linguas dir \"${dir}\" does not exist"
425 alexxy 1.37 comment_all_add_subdirectory "${dir}"
426     pushd "${dir}" > /dev/null
427 alexxy 1.25
428 alexxy 1.37 # fix all various crazy sr@Latn variations
429     # this part is only ease for ebuilds, so there wont be any die when this
430     # fail at any point
431     sr_mess="sr@latn sr@latin sr@Latin"
432     for wp in ${sr_mess}; do
433 scarabeus 1.45 [[ -e ${wp}.po ]] && mv "${wp}.po" "sr@Latn.po"
434     if [[ -d ${wp} ]]; then
435 alexxy 1.37 # move dir and fix cmakelists
436     mv "${wp}" "sr@Latn"
437     sed -i \
438 scarabeus 1.45 -e "s:${wp}:sr@Latn:g" \
439 alexxy 1.37 CMakeLists.txt
440     fi
441     done
442 alexxy 1.25
443 alexxy 1.37 for lingua in ${KDE_LINGUAS}; do
444 scarabeus 1.45 if [[ -e ${lingua}.po ]]; then
445 alexxy 1.37 mv "${lingua}.po" "${lingua}.po.old"
446 reavertm 1.35 fi
447 alexxy 1.37 done
448    
449     for lingua in ${KDE_LINGUAS}; do
450     if use linguas_${lingua} ; then
451 scarabeus 1.45 if [[ -d ${lingua} ]]; then
452 alexxy 1.37 linguas="${linguas} ${lingua}"
453     sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
454     -e "/ADD_SUBDIRECTORY([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \
455     -i CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed."
456     fi
457 scarabeus 1.45 if [[ -e ${lingua}.po.old ]]; then
458 alexxy 1.37 linguas="${linguas} ${lingua}"
459     mv "${lingua}.po.old" "${lingua}.po"
460     fi
461 reavertm 1.34 fi
462 alexxy 1.37 done
463 scarabeus 1.45 [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}"
464 alexxy 1.37
465     popd > /dev/null
466 scarabeus 1.23 }
467 scarabeus 1.45
468 abcd 1.51 # @FUNCTION: get_kde_version
469 vapier 1.56 # @DESCRIPTION:
470 abcd 1.51 # Translates an ebuild version into a major.minor KDE SC
471     # release version. If no version is specified, ${PV} is used.
472     get_kde_version() {
473 scarabeus 1.45 local ver=${1:-${PV}}
474     local major=$(get_major_version ${ver})
475     local minor=$(get_version_component_range 2 ${ver})
476     local micro=$(get_version_component_range 3 ${ver})
477 abcd 1.52 if [[ ${ver} == 9999 ]]; then
478     echo live
479     else
480 scarabeus 1.45 (( micro < 50 )) && echo ${major}.${minor} || echo ${major}.$((minor + 1))
481     fi
482     }
483 kensington 1.64
484     fi

  ViewVC Help
Powered by ViewVC 1.1.20