diff options
| author | Tomas Chvatal <scarabeus@gentoo.org> | 2008-12-24 20:49:52 +0100 |
|---|---|---|
| committer | Alexey Shvetsov <alexxy@gentoo.ru> | 2008-12-26 21:14:49 +0300 |
| commit | a98bc5bf3acbbaf84e38c0e476548b643d5e2108 (patch) | |
| tree | 07efb07fd6ae6e966f557508888f1792d6563888 | |
| parent | 4dde57f32139b166f4630417da73be99090ae56c (diff) | |
| download | kde-a98bc5bf3acbbaf84e38c0e476548b643d5e2108.tar.gz kde-a98bc5bf3acbbaf84e38c0e476548b643d5e2108.tar.bz2 kde-a98bc5bf3acbbaf84e38c0e476548b643d5e2108.zip | |
Bit bash cleanup.
| -rw-r--r-- | eclass/kde4-base.eclass | 57 | ||||
| -rw-r--r-- | eclass/kde4-functions.eclass | 37 | ||||
| -rw-r--r-- | eclass/kde4-meta.eclass | 34 |
3 files changed, 59 insertions, 69 deletions
diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass index 5ba9ac2f736..3d8aa7289c9 100644 --- a/eclass/kde4-base.eclass +++ b/eclass/kde4-base.eclass @@ -16,7 +16,7 @@ inherit base cmake-utils eutils multilib kde4-functions #live/normal get_build_type -if [[ "${BUILD_TYPE}" == "live" ]]; then +if [[ $BUILD_TYPE = live ]]; then inherit subversion fi @@ -99,7 +99,7 @@ DEPEND="${DEPEND} ${COMMONDEPEND} ${CMAKEDEPEND} RDEPEND="${RDEPEND} ${COMMONDEPEND}" # Do not allow to run test on live ebuilds -if [[ "${BUILD_TYPE}" == "live" ]]; then +if [[ $BUILD_TYPE = live ]]; then RESTRICT="${RESTRICT} test" # Live ebuilds default to kdeprefix, but can be changed if desired IUSE="${IUSE} +kdeprefix" @@ -188,14 +188,12 @@ export KDE_MINIMAL # # order: live->snapshot->testing->stable, when searching for kde. This way we # allow users to use just kde4snapshots and use software from the tree. -if [[ -z ${KDE_WANTED} ]]; then - KDE_WANTED="live" -fi +KDE_WANTED="${KDE_WANTED:-live}" export KDE_WANTED case ${NEED_KDE} in latest) - if [[ "${KDEBASE}" == "kde-base" ]]; then + if [[ $KDEBASE = kde-base ]]; then case ${PV} in 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) _kdedir="4.2" @@ -280,8 +278,8 @@ esac if [[ ${NEED_KDE} != none ]]; then #Set the SLOT - if [[ -n ${KDEBASE} ]]; then - if [[ ${NEED_KDE} = live ]]; then + if [[ -n $KDEBASE ]]; then + if [[ $NEED_KDE = live ]]; then SLOT="live" else case ${KMNAME} in @@ -319,7 +317,7 @@ if [[ ${NEED_KDE} != none ]]; then for KDE_SLOT in ${KDE_SLOTS[@]}; do # block non kdeprefix ${PN} on other slots # we do this only if we do not depend on any version of kde - if [[ ${SLOT} != ${KDE_SLOT} ]]; then + if [[ $SLOT != $KDE_SLOT ]]; then DEPEND="${DEPEND} !kdeprefix? ( !kde-base/${PN}:${KDE_SLOT}[-kdeprefix] )" RDEPEND="${RDEPEND} @@ -359,7 +357,7 @@ case ${SLOT} in live) ESVN_MIRROR=${ESVN_MIRROR:-svn://anonsvn.kde.org/home/kde} # Split ebuild, or extragear stuff - if [[ -n ${KMNAME} ]]; then + if [[ -n $KMNAME ]]; then ESVN_PROJECT="KDE/${KMNAME}" if [[ -z ${KMNOMODULE} && -z ${KMMODULE} ]]; then KMMODULE="${PN}/" @@ -404,14 +402,14 @@ case ${SLOT} in ESVN_UP_FREQ=${ESVN_UP_FREQ:-1} ;; *) - if [[ -n ${KDEBASE} ]]; then + if [[ -n $KDEBASE ]]; then if [[ -n ${KMNAME} ]]; then _kmname=${KMNAME} else _kmname=${PN} fi _kmname_pv="${_kmname}-${PV}" - if [[ ${NEED_KDE} != "live" ]]; then + if [[ $NEED_KDE != live ]]; then case ${KDEBASE} in kde-base) case ${PV} in @@ -458,7 +456,7 @@ kde4-base_pkg_setup() { # Computation based on NEED_KDE and KDE_MINIMAL get_latest_kdedir - if [[ ${NEED_KDE} != none ]]; then + if [[ $NEED_KDE != none ]]; then # Set PREFIX if use kdeprefix; then KDEDIR="/usr/kde/${_kdedir}" @@ -470,7 +468,7 @@ kde4-base_pkg_setup() { fi # Set the prefix based on KDEDIR # Make it a consequence of kdeprefix - PREFIX=${KDEDIR} + PREFIX=$KDEDIR unset _kdedir @@ -479,13 +477,11 @@ kde4-base_pkg_setup() { [[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK[@]} ]] && \ die "built_with_use illegal in this EAPI!" - if [[ ${SLOT} == "live" || ${PV} == "9999*" ]]; then - if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then - elog - elog "WARNING! This is an experimental ebuild of the ${KMNAME:-${PN}} KDE4 SVN tree." - elog "Use at your own risk. Do _NOT_ file bugs at bugs.gentoo.org because" - elog "of this ebuild!" - fi + if [[ $BUILD_TYPE = live && -z $I_KNOW_WHAT_I_AM_DOING ]]; then + elog + elog "WARNING! This is an experimental ebuild of the ${KMNAME:-${PN}} KDE4 SVN tree." + elog "Use at your own risk. Do _NOT_ file bugs at bugs.gentoo.org because" + elog "of this ebuild!" fi } @@ -498,7 +494,7 @@ kde4-base_pkg_setup() { kde4-base_src_unpack() { debug-print-function $FUNCNAME "$@" - if [[ "${BUILD_TYPE}" == "live" ]]; then + if [[ $BUILD_TYPE = live ]]; then local cleandir cleandir="${ESVN_STORE_DIR}/KDE/KDE" if [[ -d ${cleandir} ]]; then @@ -509,7 +505,7 @@ kde4-base_src_unpack() { fi subversion_src_unpack else - [[ -z "${KDE_S}" ]] && KDE_S="${S}" + [[ -z $KDE_S ]] && KDE_S="${S}" if [[ -z $* ]]; then # Unpack first and deal with KDE patches after examing possible patch sets. # To be picked up, patches need to conform to the guidelines stated before. @@ -517,7 +513,7 @@ kde4-base_src_unpack() { [[ -d "${KDE_S}" ]] || unpack ${A} fi # Updated cmake dir - if [[ -d "${WORKDIR}/cmake" ]] && [[ -d "${KDE_S}/cmake" ]]; then + if [[ -d "${WORKDIR}/cmake" && -d "${KDE_S}/cmake" ]]; then ebegin "Updating cmake/ directory..." rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory" ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory" @@ -539,7 +535,6 @@ kde4-base_src_prepare() { enable_selected_linguas fi - # Autopatch base_src_prepare @@ -581,7 +576,7 @@ kde4-base_src_configure() { mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=OFF" # Set distribution name - [[ ${PN} == "kdelibs" ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo" + [[ $PN = kdelibs ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo" # runpath linking mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON" @@ -600,7 +595,7 @@ kde4-base_src_configure() { PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}${KDEDIR}/$(get_libdir)/pkgconfig" # additonal arguments for KOFFICE - if [[ "${KMNAME}" == "koffice" ]]; then + if [[ $KMNAME = koffice ]]; then case ${PN} in koffice-data) : ;; *) @@ -635,7 +630,7 @@ kde4-base_src_compile() { kde4-base_src_make() { debug-print-function ${FUNCNAME} "$@" - if [[ -d ${WORKDIR}/${PN}_build ]]; then + if [[ -d "$WORKDIR/${PN}_build" ]]; then pushd "${WORKDIR}"/${PN}_build > /dev/null fi [ -e [Mm]akefile ] && cmake-utils_src_make "$@" @@ -660,12 +655,12 @@ kde4-base_src_test() { kde4-base_src_install() { debug-print-function ${FUNCNAME} "$@" - if [[ -n ${KMSAVELIBS} ]] ; then + if [[ -n $KMSAVELIBS ]] ; then install_library_dependencies fi kde4-base_src_make_doc - if [[ -d ${WORKDIR}/${PN}_build ]]; then + if [[ -d "$WORKDIR/${PN}_build" ]]; then pushd "${WORKDIR}"/${PN}_build > /dev/null fi [ -e [Mm]akefile ] && cmake-utils_src_install @@ -682,7 +677,7 @@ kde4-base_src_make_doc() { [[ -s $doc ]] && dodoc ${doc} done - if [[ -z ${KMNAME} ]]; then + if [[ -z $KMNAME ]]; then for doc in {apps,runtime,workspace,.}/*/{AUTHORS,README*}; do if [[ -s $doc ]]; then local doc_complete=${doc} diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass index 3de79980df8..c411953b1de 100644 --- a/eclass/kde4-functions.eclass +++ b/eclass/kde4-functions.eclass @@ -13,10 +13,7 @@ # @ECLASS-VARIABLE: EAPI # @DESCRIPTION: # By default kde eclass wants eapi 2 which might be redefinable. -EAPI=${EAPI:-2} - -# BLOCK FOR EAPI OLDER THAN 2. -case ${EAPI} in +case ${EAPI:=2} in 2) : ;; *) die "No way! EAPI older than 2 is not supported." ;; esac @@ -26,27 +23,27 @@ esac # This gets set to a non-zero value when a package is considered a kde or # koffice ebuild. -if [[ "${CATEGORY}" == "kde-base" ]]; then +if [[ $CATEGORY = kde-base ]]; then debug-print "${ECLASS}: KDEBASE ebuild recognized" - KDEBASE="kde-base" + KDEBASE=kde-base fi # is this a koffice ebuild? -if [[ "${KMNAME}" == "koffice" || "${PN}" == "koffice" ]]; then +if [[ $KMNAME = koffice || $PN = koffice ]]; then debug-print "${ECLASS}: KOFFICE ebuild recognized" - KDEBASE="koffice" + KDEBASE=koffice fi # @ECLASS-VARIABLE: KDE_SLOTS # @DESCRIPTION: # The slots used by all KDE versions later than 4.0. The live-ebuilds use # KDE_LIVE_SLOTS instead. -KDE_SLOTS=( "kde-4" "4.1" "4.2" ) +KDE_SLOTS=( kde-4 4.1 4.2 ) # @ECLASS-VARIABLE: KDE_LIVE_SLOTS # @DESCRIPTION: # The slots used by all KDE live versions. -KDE_LIVE_SLOTS=( "live" ) +KDE_LIVE_SLOTS=( live ) # @FUNCTION: buildsycoca # @DESCRIPTION: @@ -57,7 +54,7 @@ KDE_LIVE_SLOTS=( "live" ) buildsycoca() { debug-print-function ${FUNCNAME} "$@" - if [[ -x ${KDEDIR}/bin/kbuildsycoca4 && -z "${ROOT%%/}" ]]; then + if [[ -z ${ROOT%%/} && -x ${KDEDIR}/bin/kbuildsycoca4 ]]; then # Make sure tha cache file exists, or kbuildsycoca4 will fail touch "${KDEDIR}/share/kde4/services/ksycoca4" @@ -107,20 +104,20 @@ enable_selected_linguas() { local lingua for lingua in ${KDE_LINGUAS}; do - if [ -e "${S}"/po/"${lingua}".po ]; then - mv "${S}"/po/"${lingua}".po "${S}"/po/"${lingua}".po.old + if [ -e "$S/po/$lingua.po" ]; then + mv "$S/po/$lingua.po" "$S/po/$lingua.po.old" fi done comment_all_add_subdirectory "${KDE_LINGUAS_DIR:-${S}/po}" for lingua in ${LINGUAS}; do ebegin "Enabling LANGUAGE: ${lingua}" - if [ -d "${S}"/po/"${lingua}" ]; then + if [ -d "$S/po/$lingua" ]; then sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \ -e "/ADD_SUBDIRECTORY([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \ -i "${KDE_LINGUAS_DIR:-${S}/po}"/CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed." fi - if [ -e "${S}"/po/"${lingua}".po.old ]; then - mv "${S}"/po/"${lingua}".po.old "${S}"/po/"${lingua}".po + if [ -e "$S/po/$lingua.po.old" ]; then + mv "$S/po/$lingua.po.old" "$S/po/$lingua.po" fi eend $? done @@ -182,7 +179,7 @@ koffice_fix_libraries() { R="${R} ${libpath}" fi done - find ${S} -name CMakeLists.txt -print| xargs -i \ + find "${S}" -name CMakeLists.txt -print| xargs -i \ sed -i \ -e "s: ${libname} : ${R} :g" \ -e "s: ${libname}): ${R}):g" \ @@ -199,7 +196,7 @@ koffice_fix_libraries() { # @DESCRIPTION: # Determine whether we are using live ebuild or normal tbzs. get_build_type() { - if [[ "${SLOT}" == "live" || "${PV}" == 9999* ]]; then + if [[ $SLOT = live || $PV = 9999* ]]; then BUILD_TYPE="live" else BUILD_TYPE="normal" @@ -214,7 +211,7 @@ get_build_type() { # We can check for kdelibs because it is the most basic package; no KDE package # working without it. This might be changed in future. get_latest_kdedir() { - if [[ "${NEED_KDE}" == "latest" && "${KDEBASE}" != "kde-base" ]]; then + if [[ $NEED_KDE = latest && $KDEBASE != kde-base ]]; then case ${KDE_WANTED} in # note this will need to be updated as stable moves and so on live) @@ -272,7 +269,7 @@ save_library_dependencies() { # @DESCRIPTION: # Install generated CMake library dependencies to /var/lib/kde install_library_dependencies() { - local depsfile="${T}/${PN}:${SLOT}" + local depsfile="$T/$PN:$SLOT" echo "Installing library dependendencies as ${depsfile##*/}" insinto /var/lib/kde doins "${depsfile}" || die "Failed to install library dependencies." diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass index c884a9359ce..16abdcd2dcf 100644 --- a/eclass/kde4-meta.eclass +++ b/eclass/kde4-meta.eclass @@ -13,12 +13,12 @@ # Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY. # we want opengl optional in each koffice package -if [[ "${KMNAME}" == "koffice" ]]; then +if [[ $KMNAME = koffice ]]; then case ${PN} in koffice-data) ;; *) - OPENGL_REQUIRED="optional" + OPENGL_REQUIRED=optional ;; esac fi @@ -51,7 +51,7 @@ case ${KMNAME} in kdepim) DEPEND="${DEPEND} dev-libs/boost app-office/akonadi-server" RDEPEND="${RDEPEND} dev-libs/boost" - if [[ ${PN} != kode ]]; then + if [[ $PN != kode ]]; then DEPEND="${DEPEND} >=kde-base/kode-${PV}:${SLOT}" RDEPEND="${RDEPEND} >=kde-base/kode-${PV}:${SLOT}" fi @@ -64,7 +64,7 @@ case ${KMNAME} in esac ;; kdegames) - if [[ ${PN} != "libkdegames" ]]; then + if [[ $PN != libkdegames ]]; then DEPEND="${DEPEND} >=kde-base/libkdegames-${PV}:${SLOT}" RDEPEND="${RDEPEND} >=kde-base/libkdegames-${PV}:${SLOT}" fi @@ -87,7 +87,7 @@ case ${KMNAME} in IUSE="+crypt" DEPEND="${DEPEND} crypt? ( >=app-crypt/qca-2 )" RDEPEND="${RDEPEND} crypt? ( >=app-crypt/qca-2 )" - if [[ ${PN} != "koffice-libs" ]]; then + if [[ $PN != koffice-libs ]]; then DEPEND="${DEPEND} >=app-office/koffice-libs-${PV}:${SLOT}" RDEPEND="${RDEPEND} >=app-office/koffice-libs-${PV}:${SLOT}" fi @@ -120,8 +120,8 @@ debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-sp # Example usage: If you're installing subdirectories of a package, like plugins, # you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and # set KMNOMODULE="true". -if [[ ${KMNOMODULE} != "true" && -z ${KMMODULE} ]]; then - KMMODULE=${PN} +if [[ -z $KMMODULE && $KMNOMODULE != true ]]; then + KMMODULE=$PN fi # @ECLASS-VARIABLE: KMEXTRA @@ -162,8 +162,8 @@ kde4-meta_pkg_setup() { # kde4-meta-src_extract. kde4-meta_src_unpack() { debug-print-function ${FUNCNAME} "$@" - if [[ "${BUILD_TYPE}" == "live" ]]; then - S="${WORKDIR}/${PN}" + if [[ $BUILD_TYPE = live ]]; then + S="$WORKDIR/$PN" mkdir -p "${S}" ESVN_RESTRICT="export" subversion_src_unpack subversion_wc_info @@ -182,7 +182,7 @@ kde4-meta_src_unpack() { # Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and # KMTARPARAMS. kde4-meta_src_extract() { - if [[ "${BUILD_TYPE}" == "live" ]]; then + if [[ $BUILD_TYPE = live ]]; then local rsync_options subdir kmnamedir targetdir # Export working copy to ${S} einfo "Exporting parts of working copy to ${S}" @@ -258,7 +258,7 @@ kde4-meta_src_extract() { kde4-base_src_unpack fi # fix koffice linking - if [[ "${KMNAME}" == "koffice" ]]; then + if [[ $KMNAME = koffice ]]; then koffice_fix_libraries fi } @@ -379,7 +379,7 @@ __list_needed_subdirectories() { done # Expand KMMODULE - if [[ -n ${KMMODULE} ]]; then + if [[ -n $KMMODULE ]]; then kmmodule_expanded="${KMMODULE}" j=$(dirname ${KMMODULE}) while [[ ${j} != "." ]]; do @@ -591,16 +591,14 @@ kde4-meta_src_install() { kde4-meta_src_make_doc cmake-utils_src_install - if [[ -n ${KMSAVELIBS} ]] ; then + if [[ -n ${KMSAVELIBS} ]]; then install_library_dependencies fi # remove unvanted koffice stuff - if [[ "${KMNAME}" == "koffice" ]] ; then - if [[ "${PN}" != "koffice-data" ]]; then - rm "${D}"/${KDEDIR}/include/config-openexr.h - rm "${D}"/${KDEDIR}/share/apps/cmake/modules/FindKOfficeLibs.cmake - fi + if [[ $KMNAME = koffice && $PN != koffice-data ]]; then + rm "$D/$KDEDIR/include/config-openexr.h" + rm "$D/$KDEDIR/share/apps/cmake/modules/FindKOfficeLibs.cmake" fi } |
