diff options
author | Chris <xchrisx@uber.space> | 2020-03-24 13:21:06 +0100 |
---|---|---|
committer | Chris <xchrisx@uber.space> | 2020-03-24 19:49:33 +0100 |
commit | c4ce6a82184dae03a9a86916b19c9e4122851310 (patch) | |
tree | d2fd0e7f7d2b7a6a5cfb920bf52018e048062b1d /eclass | |
parent | 7511d007e508c629e9d651b8cff4373596c9de94 (diff) | |
download | tde-packaging-gentoo-c4ce6a82184dae03a9a86916b19c9e4122851310.tar.gz tde-packaging-gentoo-c4ce6a82184dae03a9a86916b19c9e4122851310.zip |
Eclasses: Clean up and mainstream.
Also: - Fix documentation depends.
- Mainstream the way dependencies are handled.
- Remove rest of the removed SVN code.
- Remove not needed `LDPATH`.
- Remove inheriting of not needed eclasses.
- Fix translation selection for ebuilds. (LINGUAS to L10N)
Signed-off-by: Chris <xchrisx@uber.space>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/trinity-base-2.eclass | 114 | ||||
-rw-r--r-- | eclass/trinity-functions-2.eclass | 105 | ||||
-rw-r--r-- | eclass/trinity-meta-2.eclass | 69 |
3 files changed, 140 insertions, 148 deletions
diff --git a/eclass/trinity-base-2.eclass b/eclass/trinity-base-2.eclass index 54572de5..45e92a35 100644 --- a/eclass/trinity-base-2.eclass +++ b/eclass/trinity-base-2.eclass @@ -1,12 +1,11 @@ # Copyright 1999-2013 Gentoo Foundation # Copyright 2020 The Trinity Desktop Project # Distributed under the terms of the GNU General Public License v2 -# $Header: $ # # Original Author: fat-zer # Ported to git-r3 eclass and EAPI7 by E. Liddell -# Purpose: support ebuilds for the trinity project (a kde3 fork). +# Purpose: Support ebuilds for the Trinity Desktop (KDE3 fork). # inherit trinity-functions-2 cmake-utils @@ -15,7 +14,7 @@ addwrite "/usr/tqt3/etc/settings" addpredict "/usr/tqt3/etc/settings" # ban EAPI 0-6 -case $EAPI in +case ${EAPI} in 0|1|2|3|4|5|6) die "EAPI=${EAPI} is not supported" ;; 7) ;; *) die "Unknown EAPI=${EAPI}" @@ -24,7 +23,7 @@ esac # @ECLASS-VARIABLE: BUILD_TYPE # @DESCRIPTION: # Determines the build type: live or release -if [[ ${PV} = *9999* ]]; then +if [[ "${PV}" == *"9999"* ]]; then BUILD_TYPE="live" else BUILD_TYPE="release" @@ -108,9 +107,9 @@ TRINITY_COMMON_DOCS="AUTHORS BUGS CHANGELOG CHANGES COMMENTS COMPLIANCE COMPILIN TRINITY_BASE_SRC_URI="http://www.mirrorservice.org/sites/trinitydesktop.org/trinity/releases" #reset TRINITY_SCM and inherit proper eclass -if [[ ${BUILD_TYPE} = live ]]; then +if [[ "${BUILD_TYPE}" == "live" ]]; then # set default TRINITY_SCM if not set - [[ -z "$TRINITY_SCM" ]] && TRINITY_SCM=git + [[ -z "${TRINITY_SCM}" ]] && TRINITY_SCM="git" case ${TRINITY_SCM} in git) inherit git-r3 ;; @@ -122,7 +121,7 @@ if [[ ${BUILD_TYPE} = live ]]; then EGIT_BRANCH="${TRINITY_GIT_BRANCH:=master}" # S="${WORKDIR}/${TRINITY_MODULE_NAME}" -elif [[ "${BUILD_TYPE}" == release ]]; then +elif [[ "${BUILD_TYPE}" == "release" ]]; then mod_name="${TRINITY_MODULE_NAME}" mod_ver="${TRINITY_MODULE_VER:=${PV}}" @@ -133,7 +132,7 @@ elif [[ "${BUILD_TYPE}" == release ]]; then if [[ -n "${TRINITY_MODULE_TYPE}" ]] ; then SRC_URI="${TRINITY_BASE_SRC_URI}/R${mod_ver}/main/${TRINITY_MODULE_TYPE}/$TRINITY_TARBALL" else - SRC_URI="${TRINITY_BASE_SRC_URI}/R${mod_ver}/main/$TRINITY_TARBALL" + SRC_URI="${TRINITY_BASE_SRC_URI}/R${mod_ver}/main/${TRINITY_TARBALL}" fi S="${WORKDIR}/${full_mod_name}" @@ -150,22 +149,21 @@ if [[ -n "${TRINITY_EXTRAGEAR_PACKAGING}" ]]; then # @ECLASS-VARIABLE: TEG_DOC_DIR # @DESCRIPTION: -# Change the documentation directory for extragear packages. The default is -# ${S}/doc +# Change the documentation directory for extragear packages. The default is ${S}/doc TEG_DOC_DIR="${TEG_DOC_DIR:-${S}/doc}" if [[ -n "${TRINITY_LANGS}" || -n "${TRINITY_DOC_LANGS}" ]]; then for lang in ${TRINITY_LANGS} ${TRINITY_DOC_LANGS}; do - IUSE="${IUSE} linguas_${lang}" + IUSE+=" l10n_${lang}" done trinityhandbookdepend=" - app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd app-text/docbook-xsl-stylesheets " case ${TRINITY_HANDBOOK} in yes | always) - DEPEDND+=" ${trinityhandbookdepend}" + DEPEND+=" ${trinityhandbookdepend}" ;; optional) IUSE+=" +handbook" @@ -181,7 +179,7 @@ fi # A default src unpack function to either call # git-r3_src_unpack or base_src_unpack. trinity-base-2_src_unpack() { - if [[ ${BUILD_TYPE} = live ]]; then + if [[ "${BUILD_TYPE}" == "live" ]]; then git-r3_src_unpack else base_src_unpack @@ -193,7 +191,7 @@ trinity-base-2_src_unpack() { # @DESCRIPTION: # General pre-configure and pre-compile function for Trinity applications. trinity-base-2_src_prepare() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local dir lang @@ -204,41 +202,41 @@ trinity-base-2_src_prepare() { eapply_user # Handle documentation and translations for extragear packages - if [[ -n "$TRINITY_EXTRAGEAR_PACKAGING" ]]; then + if [[ -n "${TRINITY_EXTRAGEAR_PACKAGING}" ]]; then # remove languages that have not been selected - if [[ -n $TRINITY_LANGS ]]; then + if [[ -n "${TRINITY_LANGS}" ]]; then einfo "Removing unselected translations from ${TEG_PO_DIR}" for dir in $(find ${TEG_PO_DIR} -mindepth 1 -maxdepth 1 -type d ); do - lang="$(basename "$dir")" - if ! has "$lang" ${TRINITY_LANGS}; then - eerror "Translation $lang seems to present in the package but is not supported by the ebuild" - elif ! has $lang ${LINGUAS}; then - rm -rf $dir + lang="$(basename "${dir}")" + if ! has "${lang}" ${TRINITY_LANGS}; then + eerror "Translation ${lang} seems to present in the package but is not supported by the ebuild" + elif ! has ${lang} ${L10N}; then + rm -rf ${dir} fi done fi - # if we removed all translations we should point it + # If we removed all translations we should point it if [[ -z $(find ${TEG_PO_DIR} -mindepth 1 -maxdepth 1 -type d) ]]; then - TRINITY_NO_TRANSLATIONS=yes + TRINITY_NO_TRANSLATIONS="yes" fi - # remove not selected documentation - if [[ -n $TRINITY_DOC_LANGS ]]; then + # Remove not selected documentation + if [[ -n "${TRINITY_DOC_LANGS}" ]]; then einfo "Removing unselected documentation from ${TEG_DOC_DIR}" for dir in $(find ${TEG_DOC_DIR} -mindepth 1 -maxdepth 1 -type d ); do - lang="$(basename "$dir")" - if [[ "$lang" == "${PN}" || \ - "$lang" == "en" || \ - "$lang" == "man" || \ - "$lang" == "doxy" || \ - "$lang" == "online" || \ - "$lang" == "${TRINITY_MODULE_NAME}" ]] ; then - echo -n; # do nothing it's main documentation or not related - elif ! has "$lang" ${TRINITY_LANGS}; then - eerror "Documentation translated to language $lang seems to present in the package but is not supported by the ebuild" - elif ! has $lang ${LINGUAS}; then - rm -rf $dir + lang="$(basename "${dir}")" + if [[ "${lang}" == "${PN}" || \ + "${lang}" == "en" || \ + "${lang}" == "man" || \ + "${lang}" == "doxy" || \ + "${lang}" == "online" || \ + "${lang}" == "${TRINITY_MODULE_NAME}" ]] ; then + echo -n; # Do nothing it's main documentation + elif ! has "${lang}" ${TRINITY_LANGS}; then + eerror "Documentation translated to language ${lang} seems to present in the package but is not supported by the ebuild" + elif ! has ${lang} ${L10N}; then + rm -rf ${dir} fi done fi @@ -252,19 +250,19 @@ trinity-base-2_src_prepare() { # @DESCRIPTION: # Call standard cmake-utils_src_onfigure and add some common arguments. trinity-base-2_src_configure() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local eg_cmakeargs [[ -n "${PREFIX}" ]] && export PREFIX="${TDEDIR}" - if [[ -n "$TRINITY_EXTRAGEAR_PACKAGING" ]]; then + if [[ -n "${TRINITY_EXTRAGEAR_PACKAGING}" ]]; then eg_cmakeargs=( -DBUILD_ALL=ON ) - if [[ "$TRINITY_NO_TRANSLATIONS" == "yes" ]]; then + if [[ "${TRINITY_NO_TRANSLATIONS}" == "yes" ]]; then eg_cmakeargs=( -DBUILD_TRANSLATIONS=OFF "${eg_cmakeargs[@]}" ) else eg_cmakeargs=( -DBUILD_TRANSLATIONS=ON "${eg_cmakeargs[@]}" ) fi - if [[ "${TRINITY_HANDBOOK}" == optional ]]; then + if [[ "${TRINITY_HANDBOOK}" == "optional" ]]; then eg_cmakeargs=( -DBUILD_DOC="$(usex handbook)" "${eg_cmakeargs[@]}" ) fi fi @@ -291,7 +289,7 @@ trinity-base-2_src_configure() { # @DESCRIPTION: # Just call cmake-utils_src_compile. trinity-base-2_src_compile() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" cmake-utils_src_compile } @@ -300,11 +298,11 @@ trinity-base-2_src_compile() { # @DESCRIPTION: # Call standard cmake-utils_src_install and installs common documentation. trinity-base-2_src_install() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" cmake-utils_src_install - if [[ -z "$TRINITY_BASE_NO_INSTALL_DOC" || - "$TRINITY_BASE_NO_INSTALL_DOC" == "no" ]]; then + if [[ -z "${TRINITY_BASE_NO_INSTALL_DOC}" || + "${TRINITY_BASE_NO_INSTALL_DOC}" == "no" ]]; then trinity-base-2_create_tmp_docfiles trinity-base-2_install_docfiles fi @@ -315,27 +313,27 @@ trinity-base-2_src_install() { # Create docfiles in the form ${TMP_DOCDIR}/path.to.docfile.COMMON_NAME # Also see the description for TRINITY_COMMON_DOCS and TMP_DOCDIR. trinity-base-2_create_tmp_docfiles() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local srcdirs dir docfile targetdoc - if [[ -z "$TMP_DOCDIR" || ! -d "$TMP_DOCDIR" ]] ; then - TMP_DOCDIR="$T/docs" + if [[ -z "${TMP_DOCDIR}" || ! -d "${TMP_DOCDIR}" ]] ; then + TMP_DOCDIR="${T}/docs" mkdir -p ${TMP_DOCDIR} fi - if [[ -z "$@" ]] ; then + if [[ -z "${@}" ]] ; then srcdirs="./" else - srcdirs="$@" + srcdirs="${@}" fi einfo "Generating documentation list..." - for dir in $srcdirs; do + for dir in ${srcdirs}; do for doc in ${TRINITY_COMMON_DOCS}; do - for docfile in $(find $dir -type f -name "*${doc}*"); do + for docfile in $(find ${dir} -type f -name *"${doc}"*); do targetdoc="${docfile//\//.}" targetdoc="${targetdoc#..}" - cp "${docfile}" "$TMP_DOCDIR/${targetdoc}" + cp "${docfile}" "${TMP_DOCDIR}/${targetdoc}" done done done @@ -346,11 +344,11 @@ trinity-base-2_create_tmp_docfiles() { # @DESCRIPTION: # Install documentation from ${TMP_DOCDIR} or from first argument. trinity-base-2_install_docfiles() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local doc docdir - [[ -n "$TMP_DOCDIR" ]] && docdir="$TMP_DOCDIR" - [[ -n "$1" ]] && docdir="$1" - [[ -z "$docdir" ]] && die "docdir is not set in ${FUNCNAME}." + [[ -n "${TMP_DOCDIR}" ]] && docdir="${TMP_DOCDIR}" + [[ -n "${1}" ]] && docdir="${1}" + [[ -z "${docdir}" ]] && die "docdir is not set in ${FUNCNAME}." pushd "${docdir}" >/dev/null find . -maxdepth 1 -type f | while read doc; do diff --git a/eclass/trinity-functions-2.eclass b/eclass/trinity-functions-2.eclass index c7150132..102e4e6d 100644 --- a/eclass/trinity-functions-2.eclass +++ b/eclass/trinity-functions-2.eclass @@ -1,12 +1,11 @@ # Copyright 1999-2013 Gentoo Foundation # Copyright 2020 The Trinity Desktop Project # Distributed under the terms of the GNU General Public License v2 -# $Header: $ # # Original Author: Alexander Golubev (Fat-Zer) # Ported to git-r3 eclass and EAPI7 by E. Liddell -# Purpose: basic trinity functions and variables +# Purpose: Basic Trinity eclass functions and variables # inherit multilib @@ -19,27 +18,27 @@ TRINITY_LIVEVER="14.1.0" # Sets the right TRINITY_VER, TDEDIR etc... # !!! unfinished set-trinityver() { - debug-print-function $FUNCNAME "$@" - - # set install location: - # - 3rd party apps go into /usr, and have SLOT="0". - # - trinity-base category ebuilds go into /usr/trinity/$ETRINITY_VER, - # and have SLOT="$MAJORVER.$MINORVER". - # - This function exports $PREFIX (location to install to) and $TDEDIR - # (location of tdelibs to link against) for all ebuilds. - - # get version elements - if [[ -n "$1" ]]; then - ETRINITY_VER="$1" + debug-print-function ${FUNCNAME} "${@}" + + # Set install location: + # - The third party applications and libraries go into /usr, and have SLOT="0". + # - The Trinity related applications and libraries go into /usr/trinity/${TRINITY_VER}, + # and have SLOT="${TRINITY_VER}". + # - This function exports ${PREFIX} (location to install to) and ${TDEDIR} + # (location of tdelibs to link against) for all ebuilds. + + # Get version elements + if [[ -n "${1}" ]]; then + ETRINITY_VER="${1}" else - ETRINITY_VER="$PV" + ETRINITY_VER="${PV}" fi - case "$ETRINITY_VER" in + case "${ETRINITY_VER}" in 9999 ) - export TRINITY_VER="$(ver_cut 1 "$TRINITY_LIVEVER" )" ;; + export TRINITY_VER="$(ver_cut 1 "${TRINITY_LIVEVER}" )" ;; * ) - export TRINITY_VER="$(ver_cut 1 "$ETRINITY_VER" )" ;; + export TRINITY_VER="$(ver_cut 1 "${ETRINITY_VER}" )" ;; esac export TDEDIR="/usr/trinity/${TRINITY_VER}" @@ -61,29 +60,26 @@ set-trinityver() { get-trinity-libdirs() { local rv for libdir in $(get_all_libdirs); do - echo " ${TDEDIR}/${libdir}" + echo "${TDEDIR}/${libdir}" done } # @FUNCTION: adjust-trinity-paths # @USAGE: < version > # @DESCRIPTION: -# Adjusts PATH LDPATH and LD_LIBRARY_PATH to see only current trinity version. +# Adjusts PATH and LD_LIBRARY_PATH to see only current trinity version. adjust-trinity-paths() { - debug-print-function $FUNCNAME "$@" + debug-print-function ${FUNCNAME} "${@}" local libdir - # this function can be called during depend phase so we shouldn't use sed here - PATH="$(trinity_remove_path_component "$PATH" "/usr/trinity/*/bin")" - PATH="$(trinity_remove_path_component "$PATH" "/usr/trinity/*/sbin")" - PATH="$(trinity_prepand_path_component "$PATH" "${TDEDIR}/bin" )" + # This function can be called during depend phase so we shouldn't use sed here + PATH="$(trinity_remove_path_component "${PATH}" "/usr/trinity/*/bin")" + PATH="$(trinity_remove_path_component "${PATH}" "/usr/trinity/*/sbin")" + PATH="$(trinity_prepand_path_component "${PATH}" "${TDEDIR}/bin" )" - # FIXME: it seems we don't need LDPATH -# LDPATH="$(trinity_remove_path_component "$LDPATH" "/usr/trinity/*/${libdir}")" - LD_LIBRARY_PATH="$(trinity_remove_path_component "$LD_LIBRARY_PATH" "/usr/trinity/*/${libdir}")" + LD_LIBRARY_PATH="$(trinity_remove_path_component "${LD_LIBRARY_PATH}" "/usr/trinity/*/${libdir}")" for libdir in $(get-trinity-libdirs); do -# LDPATH="$(trinity_prepand_path_component "$LDPATH" "${TDEDIR}/${libdir}" )" - LD_LIBRARY_PATH="$(trinity_prepand_path_component "$LD_LIBRARY_PATH" "${libdir}" )" + LD_LIBRARY_PATH="$(trinity_prepand_path_component "${LD_LIBRARY_PATH}" "${libdir}" )" done export PATH @@ -97,10 +93,10 @@ adjust-trinity-paths() { trinity_remove_path_component() { local i new_path path_array - IFS=: read -ra path_array <<< "$1" + IFS=: read -ra path_array <<< "${1}" for i in "${path_array[@]}"; do - case "$i" in - $2 ) ;; # delete specyfied entry + case "${i}" in + ${2} ) ;; # delete specyfied entry "" ) ;; * ) new_path="${new_path}:${i}" ;; esac @@ -121,18 +117,18 @@ trinity_prepand_path_component() { # @DESCRIPTION: # Sets the correct DEPEND and RDEPEND for the needed trinity < version >. need-trinity() { - debug-print-function $FUNCNAME "$@" + debug-print-function ${FUNCNAME} "${@}" local my_depend # determine install locations - set-trinityver $1 + set-trinityver ${1} adjust-trinity-paths - my_depend=">=trinity-base/tdelibs-${ETRINITY_VER}:${TRINITY_VER}" + my_depend="=trinity-base/tdelibs-${ETRINITY_VER}" - DEPEND="$DEPEND $my_depend" - RDEPEND="$RDEPEND $my_depend" + DEPEND+=" ${my_depend}" + RDEPEND+=" ${my_depend}" } # @ECLASS-VARIABLE: TRINITY_NEED_ARTS @@ -146,42 +142,41 @@ TRINITY_NEED_ARTS="no" # @DESCRIPTION: # This function adds DEPENDs for aRTs support. # Possible arguments are 'yes' and 'optional' 'yes' means arts is required, 'optional' results in USE flag arts. -# NOTE: this function modifies IUSE DEPEND and RDEPEND variables, so if you call it before setting +# NOTE: This function modifies IUSE DEPEND and RDEPEND variables, so if you call it before setting # those variables don't forget to include the previously set value when you set them again. need-arts() { - debug-print-function $FUNCNAME "$@" + debug-print-function ${FUNCNAME} "${@}" - local tdelibs my_depend + local arts tdelibs my_depend - [[ -z "${1}" ]] && die "$FUNCNAME requires an argument" + [[ -z "${1}" ]] && die "${FUNCNAME} requires an argument" - TRINITY_NEED_ARTS=$1; + TRINITY_NEED_ARTS="${1}" case "${TRINITY_VER}" in - "") die "You must call set-trinityver functions to set TRINITY_VER before calling $FUNCNAME.";; - *) tdelibs="trinity-base/tdelibs";; + "") die "You must call the set-trinityver function to set TRINITY_VER before calling ${FUNCNAME}.";; + *) tdelibs="=trinity-base/tdelibs-${ETRINITY_VER}" arts="=trinity-base/arts-${ETRINITY_VER}";; esac - # handle trinity-base/tdelibs in special way - if [[ "${CATEGORY}/${PN}" == "${tdelibs}" ]]; then - if [[ "$1" == optional ]]; then - my_depend=" arts? ( trinity-base/arts )" + # Handle trinity-base/tdelibs in special way + if [[ "=${CATEGORY}/${P}" == "${tdelibs}" ]]; then + if [[ "${1}" == "optional" ]]; then + my_depend=" arts? ( ${arts} )" IUSE+=" arts" else - die "aRTs support for ${tdelibs} supposed to be optional" + die "aRts support for ${tdelibs} supposed to be optional" fi else - case "$1" in - yes) my_depend=" trinity-base/arts + case "${1}" in + yes) my_depend=" ${arts} ${tdelibs}[arts]" ;; - optional) my_depend=" arts? ( trinity-base/arts + optional) my_depend=" arts? ( ${arts} ${tdelibs}[arts] )" IUSE+=" arts" ;; - *) die "bad parameter: $1" + *) die "bad parameter: ${1}" esac fi DEPEND+=" ${my_depend}"; RDEPEND+=" ${my_depend}"; } - diff --git a/eclass/trinity-meta-2.eclass b/eclass/trinity-meta-2.eclass index cc46a908..c4eac0b8 100644 --- a/eclass/trinity-meta-2.eclass +++ b/eclass/trinity-meta-2.eclass @@ -1,34 +1,33 @@ # Copyright 1999-2013 Gentoo Foundation # Copyright 2020 The Trinity Desktop Project # Distributed under the terms of the GNU General Public License v2 -# $Header: $ # # Original Author: fat-zer # Ported to git-r3 eclass and EAPI7 by E. Liddell -# Purpose: make easy to install trinity ebuilds. +# Purpose: Make it easy to install Trinity ebuilds. # -inherit trinity-base-2 trinity-functions-2 cmake-utils +inherit trinity-base-2 LICENSE="|| ( GPL-2 GPL-3 )" HOMEPAGE="http://www.trinitydesktop.org/" # Set slot, TDEDIR, TRINITY_VER and PREFIX set-trinityver -[[ -z "$SLOT" ]] && SLOT="$TRINITY_VER" +[[ -z "${SLOT}" ]] && SLOT="${TRINITY_VER}" # Common dependencies -DEPEND="trinity-base/tdelibs:${SLOT}" +need-trinity # @FUNCTION: trinity-meta-2_set_trinity_submodule # @DESCRIPTION: # Sets the TRINITY_SUBMODULE variable to # the value obtained from ${PN} if it isn't set yet. trinity-meta-2_set_trinity_submodule() { - debug-print-function $FUNCNAME "$@" + debug-print-function ${FUNCNAME} "${@}" - if [[ -z "$TRINITY_SUBMODULE" ]]; then + if [[ -z "${TRINITY_SUBMODULE}" ]]; then TRINITY_SUBMODULE="${PN#${TRINITY_MODULE_NAME}-}" fi } @@ -38,7 +37,7 @@ trinity-meta-2_set_trinity_submodule() { # Default pkg_setup function. # It sets the correct ${S} necessary files. trinity-meta-2_pkg_setup() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" adjust-trinity-paths trinity-meta-2_set_trinity_submodule @@ -49,9 +48,9 @@ trinity-meta-2_pkg_setup() { # Default source extract function. # It tries to unpack only necessary files. trinity-meta-2_src_unpack() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" - if [[ ${BUILD_TYPE} = live ]]; then + if [[ "${BUILD_TYPE}" == "live" ]]; then case "${TRINITY_SCM}" in git) git-r3_src_unpack @@ -67,13 +66,13 @@ trinity-meta-2_src_unpack() { # A function to extract the source for a split TDE ebuild. # Also see KMMODULE, KMEXTRACT. trinity-meta-2_src_extract() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" trinity-meta-2_create_extractlists - if [[ "${BUILD_TYPE}" = live ]]; then + if [[ "${BUILD_TYPE}" == "live" ]]; then einfo "Exporting parts of working copy to ${S}" - case "$TRINITY_SCM" in + case "${TRINITY_SCM}" in git) # Nothing we can do to prevent git from unpacking code ;; *) die "TRINITY_SCM: ${TRINITY_SCM} is not supported by ${FUNCNAME}" @@ -81,7 +80,7 @@ trinity-meta-2_src_extract() { else local tarfile tarparams f extractlist - case $TRINITY_TARBALL in + case ${TRINITY_TARBALL} in *.gz) tarparams=" --gzip" ;; @@ -98,23 +97,23 @@ trinity-meta-2_src_extract() { ebegin "Unpacking parts of ${TRINITY_TARBALL} to ${WORKDIR}" - for f in $TSM_EXTRACT_LIST; do + for f in ${TSM_EXTRACT_LIST}; do extractlist+=" ${topdir}/${f}" done tar -xpf "${tarfile}" ${tarparams} -C "${WORKDIR}" ${extractlist} 2> /dev/null \ || echo "tar extract command failed at least partially - continuing anyway" - # Make sure $S points to right place + # Make sure ${S} points to right place [[ "${WORKDIR}/${topdir}" != "${S}" ]] && S="${WORKDIR}/${topdir}" fi } # @FUNCTION: trinity-meta-2_rsync_copy # @DESCRIPTION: -# Copies files from svn or git repository to $S +# Copies files from git repository to ${S}. trinity-meta-2_rsync_copy() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local rsync_options subdir targetdir wc_path escm case "${TRINITY_SCM}" in @@ -122,7 +121,7 @@ trinity-meta-2_rsync_copy() { *) die "TRINITY_SCM: ${TRINITY_SCM} is not supported by ${FUNCNAME}" ;; esac - rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/" + rsync_options="--group --links --owner --perms --quiet --exclude=.git/" # Copy ${TRINITY_MODULE_NAME} non-recursively (toplevel files) rsync ${rsync_options} "${wc_path}"/* "${S}" \ @@ -132,7 +131,7 @@ trinity-meta-2_rsync_copy() { rsync --recursive ${rsync_options} "${wc_path}/cmake" "${S}" \ || die "rsync: can't export cmake files to '${S}'." fi - # Copy all subdirectories listed in $TSM_EXTRACT_LIST + # Copy all subdirectories listed in ${TSM_EXTRACT_LIST} for subdir in ${TSM_EXTRACT_LIST}; do rsync --recursive ${rsync_options} "${wc_path}/${subdir}" \ "${S}/$(dirname subdir)" \ @@ -140,16 +139,16 @@ trinity-meta-2_rsync_copy() { done } -# @FUNCTION: trinity-meta_create_extractlists +# @FUNCTION: trinity-meta-2_create_extractlists # @DESCRIPTION: # Creates lists of files and subdirectories to extract. # Also see descriptions of KMMODULE and KMEXTRACT. trinity-meta-2_create_extractlists() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local submod - # If $TSM_EXTRACT is not set assign it to dirs named in TRINITY_SUBMODULE - if [ -z "${TSM_EXTRACT}" ]; then + # If ${TSM_EXTRACT} is not set assign it to dirs named in TRINITY_SUBMODULE + if [[ -z "${TSM_EXTRACT}" ]]; then for submod in ${TRINITY_SUBMODULE}; do TSM_EXTRACT="${TSM_EXTRACT} ${submod}/" done @@ -171,22 +170,22 @@ trinity-meta-2_create_extractlists() { # @DESCRIPTION: # Default src prepare function. Currently it's only a stub. trinity-meta-2_src_prepare() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local shared_patch_dir f f_name; shared_patch_dir="${FILESDIR}/shared/${TRINITY_MODULE_NAME}-${PV}/patches/" - if [ -d "${shared_patch_dir}" ]; then + if [[ -d "${shared_patch_dir}" ]]; then find "${shared_patch_dir}" -type f | while read f; do f_name="$(basename "${f}")" case "${f_name}" in *.diff | *.patch ) epatch "${f}" ;; *.gz ) cp "${f}" "${T}" - gunzip ${T}/${f_name} - epatch ${T}/${f_name%.gz} + gunzip "${T}/${f_name}" + epatch "${T}/${f_name%.gz}" ;; *.bz2 ) cp "${f}" "${T}" - bunzip2 ${T}/${f_name} - epatch ${T}/${f_name%.bz2} + bunzip2 "${T}/${f_name}" + epatch "${T}/${f_name%.bz2}" ;; *) die "unknown patch type in the patch directory" ;; esac @@ -201,11 +200,11 @@ trinity-meta-2_src_prepare() { # Default source configure function. It sets apropriate cmake args. # Also see description of KMMODULE. trinity-meta-2_src_configure() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" local item tsmargs mod - for item in $TRINITY_SUBMODULE; do + for item in ${TRINITY_SUBMODULE}; do mod="${item^^}" mod="${mod//-/_}" tsmargs+=" -DBUILD_${mod}=ON" @@ -223,7 +222,7 @@ trinity-meta-2_src_configure() { # @DESCRIPTION: # Just calls trinity-base_src_compile. trinity-meta-2_src_compile() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" trinity-base-2_src_compile } @@ -232,11 +231,11 @@ trinity-meta-2_src_compile() { # @DESCRIPTION: # Calls default cmake install function and installs documentation. trinity-meta-2_src_install() { - debug-print-function ${FUNCNAME} "$@" + debug-print-function ${FUNCNAME} "${@}" TRINITY_BASE_NO_INSTALL_DOC="yes" trinity-base-2_src_install - trinity-base-2_create_tmp_docfiles $TSM_EXTRACT + trinity-base-2_create_tmp_docfiles ${TSM_EXTRACT} trinity-base-2_install_docfiles } |