diff options
author | Martin Väth <martin@mvath.de> | 2012-04-04 23:31:52 +0200 |
---|---|---|
committer | Martin Väth <martin@mvath.de> | 2015-10-11 10:47:33 +0200 |
commit | 41625f76e867818f425aa16ad34dd26a1a111967 (patch) | |
tree | c797787c71c7ac0a8339ce6aca6b2d37b495a4b2 /eclass | |
parent | Add pms to cache-formats (diff) | |
download | mv-41625f76e867818f425aa16ad34dd26a1a111967.tar.gz mv-41625f76e867818f425aa16ad34dd26a1a111967.tar.bz2 mv-41625f76e867818f425aa16ad34dd26a1a111967.zip |
eclasses: cosmetic changes and minor fixes. Bump noscript. Update checksums
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/monotone.eclass | 97 | ||||
-rw-r--r-- | eclass/mv_mozextension.eclass | 132 |
2 files changed, 104 insertions, 125 deletions
diff --git a/eclass/monotone.eclass b/eclass/monotone.eclass index e3cf3b0d..dee500ed 100644 --- a/eclass/monotone.eclass +++ b/eclass/monotone.eclass @@ -17,75 +17,75 @@ DESCRIPTION="Based on the ${ECLASS} eclass" # @ECLASS-VARIABLE: EMTN_STORE_DIR # @DESCRIPTION: # monotone sources store directory. Users may override this in /etc/make.conf -: ${EMTN_STORE_DIR:="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/mtn-src"} +: ${EMTN_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/mtn-src} # @ECLASS-VARIABLE: EMTN_OFFLINE # @DESCRIPTION: # Set this variable to a non-empty value to disable the automatic updating of # an monotone source tree. This is intended to be set by users. -: ${EMTN_OFFLINE:="${EVCS_OFFLINE}"} +: ${EMTN_OFFLINE:=${EVCS_OFFLINE}} # @ECLASS-VARIABLE: EMTN_CMD # @DESCRIPTION: -# monotone command with argument for database which must be \"\$db\" -: ${EMTN_CMD:="mtn -d \"\${db}\""} +# monotone command with argument for database which must be '$db' +: ${EMTN_CMD:=mtn -d \"\$db\"} # @ECLASS-VARIABLE: EMTN_PULL_CMD # @DESCRIPTION: # monotone pull command -: ${EMTN_PULL_CMD:="${EMTN_CMD} pull"} +: ${EMTN_PULL_CMD:=${EMTN_CMD} pull} # @ECLASS-VARIABLE: EMTN_INIT_CMD # @DESCRIPTION: # monotone init command -: ${EMTN_INIT_CMD:="${EMTN_CMD} db init"} +: ${EMTN_INIT_CMD:=${EMTN_CMD} db init} # @ECLASS-VARIABLE: EMTN_CO_CMD # @DESCRIPTION: # monotone checkout command -: ${EMTN_CO_CMD:="${EMTN_CMD} co"} +: ${EMTN_CO_CMD:=${EMTN_CMD} co} # @ECLASS-VARIABLE: EMTN_PRINT_HEADS_CMD # @DESCRIPTION: # monotone command to print the revision of the heads -: ${EMTN_PRINT_HEADS_CMD:="${EMTN_CMD} automate heads"} +: ${EMTN_PRINT_HEADS_CMD:=${EMTN_CMD} automate heads} # @ECLASS-VARIABLE: EMTN_DB # @DESCRIPTION: # Name of the database file where the local monotone repository is stored. -: ${EMTN_DB:="${PN}.db"} +: ${EMTN_DB:=${PN}.db} # @ECLASS-VARIABLE: EMTN_REPO_URI # @DESCRIPTION: # Name of the external monotone repository, e.g. foo.bar.org -: ${EMTN_REPO_URI:=""} +: ${EMTN_REPO_URI:=} # @ECLASS-VARIABLE: EMTN_GLOB # @DESCRIPTION: # Name of the glob for the external repository. Typically '*' -: ${EMTN_GLOB:="*"} +: ${EMTN_GLOB:=*} # @ECLASS-VARIABLE: EMTN_MODULEPATH # @DESCRIPTION: # Name of the module to checkout -: ${EMTN_MODULEPATH:="${PN}"} +: ${EMTN_MODULEPATH:=${PN}} # @ECLASS-VARIABLE: EMTN_MODULEDIR # @DESCRIPTION: # Name where the module should come. Empty means: basename of modulepath. -: ${EMTN_MODULEDIR:=""} +: ${EMTN_MODULEDIR:=} # @ECLASS-VARIABLE: EMTN_REVISIONARGS # @DESCRIPTION: # Args for revision to checkout, e.g. "-r something" # The special value "head" means to use the first head. -: ${EMTN_REVISIONARGS="head"} +: ${EMTN_REVISIONARGS=head} # @ECLASS-VARIABLE: EMTN_DISABLE_DEPENDENCIES # @DESCRIPTION: # Set this variable to a non-empty value to disable the automatic inclusion of # monotone in dependencies. -: ${EMTN_DISABLE_DEPENDENCIES:=""} +: ${EMTN_DISABLE_DEPENDENCIES:=} # @FUNCTION: monotone_fetch # @USAGE: [repo_uri] [glob] [db] @@ -94,23 +94,16 @@ DESCRIPTION="Based on the ${ECLASS} eclass" # and copy it into ${S}. # After this function, current working directory is ${S}. # -# Can take two optional parameters: +# Can take three optional parameters: # repo_uri - a repository URI. If empty defaults to EMTN_REPO_URI. # glob - The glob for URI. If empty defaults to EMTN_GLOB. # db - the database filename. If empty defaults to EMTN_DB. monotone_fetch() { - local repo_uri db db_full - if [ ${#} -ge 1 ] - then repo_uri=${1:-"${EMTN_REPO_URI}"} - shift - else repo_uri="${EMTN_REPO_URI}" - fi - if [ ${#} -ge 1 ] - then db=${1:-"${EMTN_DB}"} - shift - else db=${1:-"${EMTN_DB}"} - fi - test -d "${EMTN_STORE_DIR}" || ( \ + local repo_uri glob db db_full + repo_uri=${1:-${EMTN_REPO_URI}} + glob=${2:-${EMTN_GLOB}} + db=${3:-${EMTN_DB}} + test -d "${EMTN_STORE_DIR}" || ( addwrite / mkdir -p -- "/${EMTN_STORE_DIR}" ) @@ -118,14 +111,16 @@ monotone_fetch() { || die "cannot cd to ${EMTN_STORE_DIR}" if ! test -e "${db}" - then ( addwrite "${PWD}" + then ( + addwrite "${PWD}" einfo "Initializing new ${db}" && \ eval "${EMTN_INIT_CMD}" && \ einfo "Fetching ${db} from remote ${repo_uri}" && \ eval "${EMTN_PULL_CMD} \"\${repo_uri}\" \"\${glob}\"" ) elif [ -z "${EMTN_OFFLINE}" ] - then ( addwrite "${PWD}" + then ( + addwrite "${PWD}" einfo "Updating ${db} from remote ${repo_uri}" eval "${EMTN_PULL_CMD}" ) @@ -154,30 +149,19 @@ monotone_fetch() { # The special value "head" means to use the first head. monotone_co() { local db modulepath moduledir r - if [ ${#} -ge 1 ] - then db=${1:-"${EMTN_DB}"} - shift - else db="${EMTN_DB}" - fi - if [ ${#} -ge 1 ] - then modulepath=${1:-"${EMTN_MODULEPATH}"} - shift - else modulepath="${EMTN_MODULEPATH}" + db=${1:-${EMTN_DB}} + modulepath=${2:-${EMTN_MODULEPATH}} + moduledir=${3:-${EMTN_MODULEDIR}} + [ -z "${moduledir}" ] && moduledir=${modulepath##*/} + if [ ${#} -gt 3 ] + then shift 3 + else eval "set -- ${EMTN_REVISIONARGS}" fi - if [ ${#} -ge 1 ] - then moduledir=${1:-"${EMTN_MODULEDIR}"} - shift - else moduledir="${EMTN_MODULEDIR}" - fi - [ -z "${moduledir}" ] && moduledir="${modulepath##*/}" - if [ ${#} -eq 0 ] && [ -n "${EMTN_REVISIONARGS}" ] - then eval "set -- ${EMTN_REVISIONARGS}" - fi - if [ "${1}" = "head" ] + if [ "${1}" = 'head' ] then if r=`eval "${EMTN_PRINT_HEADS_CMD} \"\${modulepath}\"" \ | tail -n1` && [ -n "${r}" ] - then set -- -r "${r}" - else set -- + then set -- -r "${r}" + else set -- fi fi if [ -n "${modulepath}" ] @@ -194,13 +178,10 @@ monotone_co() { # @USAGE: [db] # @DESCRIPTION: # Call this when all modules are checked out: Removes the local database. -# The argument db defaults to EMTN_DB. +# The optional argument db defaults to EMTN_DB. monotone_finish() { - if [ ${#} -ge 1 ] - then db=${1:-"${EMTN_DB}"} - shift - else db="${EMTN_DB}" - fi + local db + db=${1:-${EMTN_DB}} rm -- "${S}/${db}" || die "cannot remove ${S}/${db}" } @@ -213,6 +194,6 @@ monotone_src_unpack() { monotone_finish } -[ -n "${EMTN_DISABLE_DEPENDENCIES}" ] || DEPEND="dev-vcs/monotone" +[ -n "${EMTN_DISABLE_DEPENDENCIES}" ] || DEPEND='dev-vcs/monotone' EXPORT_FUNCTIONS src_unpack diff --git a/eclass/mv_mozextension.eclass b/eclass/mv_mozextension.eclass index 2a6e7b55..e2cc8f82 100644 --- a/eclass/mv_mozextension.eclass +++ b/eclass/mv_mozextension.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header $ @@ -21,7 +21,7 @@ # or a subset of these. # The eclass will then install the extension for all these mozillas, # set corresponding dependencies and print corresponding messages. -: ${MV_MOZ_MOZILLAS="firefox icecat seamonkey"} +: ${MV_MOZ_MOZILLAS=firefox icecat seamonkey} # @ECLASS-VARIABLE: MV_MOZ_EXTDIR # @DESCRIPTION: @@ -33,51 +33,51 @@ # If this variable has the special value "?" (default), it acts like "*" or # "" depending on whether MV_MOZ_MOZILLAS applies to more than 1 installed # mozilla or not. -: ${MV_MOZ_EXTDIR="?"} +: ${MV_MOZ_EXTDIR=?} inherit multilib -case "${MV_MOZ_MOZILLAS}" in -''|icecat) +case ${MV_MOZ_MOZILLAS:-icecat} in +icecat) # We have certainly at most one browser - MV_MOZ_EXTDIR="*" - RDEPEND="" - RDEPEND_END="";; + MV_MOZ_EXTDIR='*' + RDEPEND='' + RDEPEND_END='';; *) - RDEPEND="|| (" - RDEPEND_END=" -)";; + RDEPEND='|| (' + RDEPEND_END=' +)';; esac -case "${MV_MOZ_MOZILLAS}" in +case ${MV_MOZ_MOZILLAS} in *fire*) RDEPEND="${RDEPEND} >=www-client/firefox-3.6 >=www-client/firefox-bin-3.6";; esac -case "${MV_MOZ_MOZILLAS}" in +case ${MV_MOZ_MOZILLAS} in *sea*) RDEPEND="${RDEPEND} >=www-client/seamonkey-2 >=www-client/seamonkey-bin-2";; esac -case "${MV_MOZ_MOZILLAS}" in +case ${MV_MOZ_MOZILLAS} in *ice*) RDEPEND="${RDEPEND} >=www-client/icecat-3.6";; esac -RDEPEND="${RDEPEND}${RDEPEND_END}" +RDEPEND=${RDEPEND}${RDEPEND_END} -DEPEND="app-arch/unzip" +DEPEND='app-arch/unzip' [ -n "${RDEPEND}" ] && DEPEND="${DEPEND} ${RDEPEND}" -[ "${MV_MOZ_EXTDIR}" = "*" ] || IUSE="copy_extensions symlink_extensions" +[ "${MV_MOZ_EXTDIR}" = '*' ] || IUSE='copy_extensions symlink_extensions' mv_mozextension_src_unpack() { local i if [ -z "${FILENAME}" ] then for i in ${SRC_URI} - do FILENAME="${i##*/}" + do FILENAME=${i##*/} done fi xpi_unpack "${FILENAME}" @@ -89,17 +89,17 @@ declare -a MV_MOZ_INS MV_MOZ_PKG MV_MOZ_CPY MV_MOZ_DIR mv_mozextension_install() { local MOZILLA_EXTENSIONS_DIRECTORY - MOZILLA_EXTENSIONS_DIRECTORY="${1}" + MOZILLA_EXTENSIONS_DIRECTORY=${1} MV_MOZ_INS=() xpi_install_dirs } mv_mozextension_calc() { local v - case "${MV_MOZ_MOZILLAS}" in - ${1}) false;; + case ${MV_MOZ_MOZILLAS} in + ${1}) false;; esac && return - v="$(best_version "${2}")" && [ -n "${v}" ] || return + v=`best_version "${2}"` && [ -n "${v}" ] || return MV_MOZ_PKG+=("${v}") MV_MOZ_DIR+=("${3}") } @@ -108,24 +108,24 @@ mv_mozextension_src_install() { local b d e i j k l s MV_MOZ_PKG=() MV_MOZ_DIR=() - b="${EPREFIX%/}/usr/$(get_libdir)/" + b="${EPREFIX%/}/usr/`get_libdir`/" e="${EPREFIX%/}/opt/" - mv_mozextension_calc "*fire*" "www-client/firefox" "${b}firefox" - mv_mozextension_calc "*fire*" "www-client/firefox-bin" "${e}firefox" - mv_mozextension_calc "*ice*" "www-client/icecat" "${b}icecat" - mv_mozextension_calc "*sea*" "www-client/seamonkey" "${b}seamonkey" - mv_mozextension_calc "*sea*" "www-client/seamonkey-bin" "${e}seamonkey" - [ ${#MV_MOZ_DIR[@]} -ne 0 ] || die "no supported mozilla is installed" - d="${MV_MOZ_EXTDIR}" - if [ "${d}" = "?" ] + mv_mozextension_calc '*fire*' 'www-client/firefox' "${b}firefox" + mv_mozextension_calc '*fire*' 'www-client/firefox-bin' "${e}firefox" + mv_mozextension_calc '*ice*' 'www-client/icecat' "${b}icecat" + mv_mozextension_calc '*sea*' 'www-client/seamonkey' "${b}seamonkey" + mv_mozextension_calc '*sea*' 'www-client/seamonkey-bin' "${e}seamonkey" + [ ${#MV_MOZ_DIR[@]} -ne 0 ] || die 'no supported mozilla is installed' + d=${MV_MOZ_EXTDIR} + if [ "${d}" = '?' ] then if [ ${#MV_MOZ_PKG[@]} -gt 1 ] - then d="" - else d="*" + then d='' + else d='*' fi fi MV_MOZ_SYM=() MV_MOZ_LNK=false - if [ "${d}" = "*" ] || ! use symlink_extensions + if [ "${d}" = '*' ] || ! use symlink_extensions then MV_MOZ_CPY=: else MV_MOZ_CPY=false if [ -n "${d}" ] @@ -147,9 +147,9 @@ mv_mozextension_src_install() { mv_mozextension_pkg_preinst() { local i j - einfo "checking for switching between dirs and symlinks" + einfo 'checking for switching between dirs and symlinks' for i in "${MV_MOZ_SYM[@]}" - do j="${ROOT%/}${i}" + do j=${ROOT%/}${i} # There are two forms of installation: # (1) symlink mozilla-dir/extensions/X -> $MOZILLA_EXTENSIONS_DIRECTORY/X # (2) data in mozilla-dir/extensions/X @@ -172,8 +172,8 @@ mv_mozextension_pkg_preinst() { # we prefer to tell the user only that he has to reemerge the package. eerror eerror "It is necessary to reemerge again ${CATEGORY}/${PN}" - eerror "(a directory should be removed in the cleanup after the first emerge" - eerror "in order to install a symlink of the same name in the second emerge.)" + eerror '(a directory should be removed in the cleanup after the first emerge' + eerror 'in order to install a symlink of the same name in the second emerge.)' eerror break } @@ -183,7 +183,7 @@ mv_mozextension_pkg_preinst() { mv_mozextension_pkg_postinst() { local i - [ "${#MV_MOZ_PKG[@]}" -ge 1 ] || die "no supported mozilla is installed" + [ "${#MV_MOZ_PKG[@]}" -ge 1 ] || die 'no supported mozilla is installed' elog "${CATEGORY}/${PN} has been installed for the following packages:" for i in ${MV_MOZ_PKG[@]} do elog " ${i}" @@ -192,8 +192,8 @@ mv_mozextension_pkg_postinst() { elog "you might need to reemerge ${CATEGORY}/${PN}" ${MV_MOZ_CPY} || { elog - elog "The extension was installed using symlinks. This saves space but may require" - elog "to remove ~/.mozilla/*/*/extensions.ini for each browser restart." + elog 'The extension was installed using symlinks. This saves space but may require' + elog 'to remove ~/.mozilla/*/*/extensions.ini for each browser restart.' } } @@ -212,31 +212,29 @@ xpi_unpack() { test -d "${S}" || mkdir "${S}" for xpi do einfo "Unpacking ${xpi} to ${S}" - xpiname="${xpi%.*}" - xpiname="${xpiname##*/}" + xpiname=${xpi%.*} + xpiname=${xpiname##*/} - case "${xpi}" in - ./*|/*) - srcdir='' - ;; - *) - srcdir="${DISTDIR}/" - ;; + case ${xpi} in + ./*|/*) + srcdir='';; + *) + srcdir="${DISTDIR}/";; esac test -s "${srcdir}${xpi}" || die "${xpi} does not exist" - case "${xpi##*.}" in - ZIP|zip|jar|xpi) - mkdir -- "${S}/${xpiname}" && \ - cd -- "${S}/${xpiname}" && \ - unzip -qo -- "${srcdir}${xpi}" \ - || die "failed to unpack ${xpi}" - chmod -R a+rX,u+w,go-w -- "${S}/${xpiname}" - ;; - *) - einfo "unpack ${xpi}: file format not recognized. Ignoring." - ;; + case ${xpi##*.} in + ZIP|zip|jar|xpi) + mkdir -- "${S}/${xpiname}" && \ + cd -- "${S}/${xpiname}" && \ + unzip -qo -- "${srcdir}${xpi}" \ + || die "failed to unpack ${xpi}" + chmod -R a+rX,u+w,go-w -- "${S}/${xpiname}" + ;; + *) + einfo "unpack ${xpi}: file format not recognized. Ignoring." + ;; esac done } @@ -247,11 +245,11 @@ xpi_install() { # You must tell xpi_install which dir to use [ ${#} -ne 1 ] && die "${FUNCNAME} takes exactly one argument. Please specify the directory" - x="${1}" + x=${1} # determine id for extension d='{ /\<\(em:\)*id\>/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' - d="$(sed -n -e '/install-manifest/,$ '"${d}" "${x}"/install.rdf)" \ - && [ -n "${d}" ] || die "failed to determine extension id" + d=`sed -n -e '/install-manifest/,$ '"${d}" "${x}"/install.rdf` \ + && [ -n "${d}" ] || die 'failed to determine extension id' if [ -n "${MOZILLA_EXTENSIONS_DIRECTORY}" ] then d="${MOZILLA_EXTENSIONS_DIRECTORY}/${d}" MV_MOZ_INS+=("${d}") @@ -260,12 +258,12 @@ xpi_install() { test -d "${D}${d}" || dodir "${d}" || die "failed to create ${d}" ${MV_MOZ_LNK} && cp -RPl -- "${x}"/* "${D}${d}" || { ${MV_MOZ_LNK} && \ - ewarn "Failed to hardlink extension. Falling back to USE=copy_extension" + ewarn 'Failed to hardlink extension. Falling back to USE=copy_extension' insinto "${d}" && doins -r "${x}"/* } || { ${MV_MOZ_LNK} && \ - die "failed to copy extension please retry emerging with USE=copy_extension" - die "failed to copy extension" + die 'failed to copy extension. Please retry emerging with USE=copy_extension' + die 'failed to copy extension' } } |