Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 343142 Details for
Bug 463010
Extending functionality of mozextension.eclass
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
mozextension.eclass.patch
mozextension.eclass.patch (text/plain), 9.28 KB, created by
Jauhien Piatlicki (RETIRED)
on 2013-03-24 19:50:03 UTC
(
hide
)
Description:
mozextension.eclass.patch
Filename:
MIME Type:
Creator:
Jauhien Piatlicki (RETIRED)
Created:
2013-03-24 19:50:03 UTC
Size:
9.28 KB
patch
obsolete
>--- /usr/portage/eclass/mozextension.eclass 2011-12-27 18:55:12.000000000 +0100 >+++ /usr/local/portage/fix/eclass/mozextension.eclass 2013-03-24 20:41:58.420979965 +0100 >@@ -1,59 +1,274 @@ >-# Copyright 1999-2011 Gentoo Foundation >+# Copyright 1999-2013 Gentoo Foundation > # Distributed under the terms of the GNU General Public License v2 >-# $Header: /var/cvsroot/gentoo-x86/eclass/mozextension.eclass,v 1.7 2011/12/27 17:55:12 fauli Exp $ >-# >+# $Header: $ >+ > # @ECLASS: mozextension.eclass > # @MAINTAINER: > # Mozilla team <mozilla@gentoo.org> > # @DESCRIPTION: > # Install extensions for use in mozilla products. > >+# @ECLASS-VARIABLE: MOZ_MOZILLAS >+# @DESCRIPTION: >+# If this variables is set to the empty value, no default install functions >+# are defined. Otherwise, the value of this variable should be >+# "conkeror firefox seamonkey" (default) >+# or a subset of these. >+# The eclass will then install the extension for all these mozillas, >+# set corresponding dependencies and print corresponding messages. >+: ${MOZ_MOZILLAS=conkeror firefox seamonkey} > >-inherit eutils >+# @ECLASS-VARIABLE: MOZ_EXTDIR >+# @DESCRIPTION: >+# If this variable has the special value "*", the extension is copied directly >+# into the extension directory of the installed MOZILLA's. >+# Otherwise, only symlinks are made in that directory, and the extension is >+# installed only once into MOZ_EXTDIR (a default directory is >+# chosen if MOZ_EXTDIR is empty). >+# If this variable has the special value "?" (default), it acts like "*" or >+# "" depending on whether MOZ_MOZILLAS applies to more than 1 installed >+# mozilla or not. >+: ${MOZ_EXTDIR=?} >+ >+inherit eutils multilib >+ >+case ${EAPI:-0} in >+[01234]) >+ die "EAPI ${EAPI} no longer supported by ${ECLASS}";; >+esac >+ >+ >+RDEPEND="|| (" >+case "${MOZ_MOZILLAS}" in >+*fire*) >+ RDEPEND="${RDEPEND} >+ www-client/firefox:= >+ www-client/firefox-bin:=";; >+esac >+case "${MOZ_MOZILLAS}" in >+*sea*) >+ RDEPEND="${RDEPEND} >+ www-client/seamonkey:= >+ www-client/seamonkey-bin:=";; >+esac >+case "${MOZ_MOZILLAS}" in >+*conkeror*) >+ RDEPEND="${RDEPEND} >+ www-client/conkeror:=";; >+esac >+ >+RDEPEND="${RDEPEND} >+)" > > DEPEND="app-arch/unzip" >+[ -n "${RDEPEND}" ] && DEPEND="${DEPEND} >+${RDEPEND}" >+ >+[ "${MOZ_EXTDIR}" = '*' ] || IUSE='copy-extensions symlink-extensions' >+ >+mozextension_src_unpack() { >+ local i >+ if [ -z "${FILENAME}" ] >+ then for i in ${SRC_URI} >+ do FILENAME=${i##*/} >+ done >+ fi >+ xpi_unpack "${FILENAME}" >+} >+ >+mozextension_src_prepare() { >+ epatch_user >+} >+ >+EXPORT_FUNCTIONS src_unpack src_prepare >+ >+declare -a MOZ_INS MOZ_PKG MOZ_CPY MOZ_DIR >+ >+mozextension_install() { >+ local MOZILLA_EXTENSIONS_DIRECTORY >+ MOZILLA_EXTENSIONS_DIRECTORY=${1} >+ MOZ_INS=() >+ xpi_install_dirs >+} >+ >+mozextension_calc() { >+ local v >+ case ${MOZ_MOZILLAS} in >+ ${1}) >+ false;; >+ esac && return >+ v=`best_version "${2}"` && [ -n "${v}" ] || return >+ MOZ_PKG+=("${v}") >+ MOZ_DIR+=("${3}") >+} >+ >+mozextension_src_install() { >+ local b d e i j k l s >+ MOZ_PKG=() >+ MOZ_DIR=() >+ b="${EPREFIX%/}/usr/`get_libdir`/" >+ e="${EPREFIX%/}/opt/" >+ mozextension_calc '*fire*' 'www-client/firefox' "${b}firefox" >+ mozextension_calc '*fire*' 'www-client/firefox-bin' "${e}firefox" >+ mozextension_calc '*sea*' 'www-client/seamonkey' "${b}seamonkey" >+ mozextension_calc '*sea*' 'www-client/seamonkey-bin' "${e}seamonkey" >+ mozextension_calc '*conkeror*' 'www-client/conkeror' "/usr/share/conkeror" >+ [ ${#MOZ_DIR[@]} -ne 0 ] || die 'no supported mozilla is installed' >+ d=${MOZ_EXTDIR} >+ if [ "${d}" = '?' ] >+ then if [ ${#MOZ_PKG[@]} -gt 1 ] >+ then d='' >+ else d='*' >+ fi >+ fi >+ MOZ_SYM=() >+ MOZ_LNK=false >+ if [ "${d}" = '*' ] || ! use symlink-extensions >+ then MOZ_CPY=: >+ else MOZ_CPY=false >+ if [ -n "${d}" ] >+ then mozextension_install "${d}" >+ else mozextension_install "${b}mozilla/extensions" >+ fi >+ fi >+ use copy-extensions || MOZ_LNK=: >+ for i in "${MOZ_DIR[@]}" >+ do j="${i}/extensions" >+ ${MOZ_CPY} && mozextension_install "${j}" >+ for k in "${MOZ_INS[@]}" >+ do l="${j}/${k##*/}" >+ MOZ_SYM+=("${l}") >+ ${MOZ_CPY} || dosym "${ROOT%/}${k}" "${l}" >+ done >+ done >+} >+ >+mozextension_pkg_preinst() { >+ local i j >+ einfo 'checking for switching between dirs and symlinks' >+ for i in "${MOZ_SYM[@]}" >+ 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 >+# Since we might switch between (1) and (2), we must take caution, since >+# in general portage cannot merge into the live directory properly: >+ if ${MOZ_CPY} >+ then test -L "${j}" && { >+# We switched from (1) to (2). If this happened, portage would >+# actually merge the data of (2) into $MOZILLA_EXTENSIONS_DIRECTORY/X, >+# since this is where the symlink from (1) points to. >+# Hence, we have to remove this symlink in advance, in this case. >+ rm -v -- "${j}" >+ } >+ else test -d "${j}" && ! test -L "${j}" && { >+# We switched from (2) to (1). If this happened, portage cannot >+# merge the symlink to the live system, since this can only happen once >+# the directory mozilla-dir/extensions/X is removed. >+# We could remove this directory here. >+# However, removing a directory is a dangerous thing, and so >+# 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 >+ break >+ } >+ fi >+ done >+} >+ >+mozextension_pkg_postinst() { >+ local i >+ [ "${#MOZ_PKG[@]}" -ge 1 ] || die 'no supported mozilla is installed' >+ elog "${CATEGORY}/${PN} has been installed for the following packages:" >+ for i in ${MOZ_PKG[@]} >+ do elog " ${i}" >+ done >+ elog "When you install/uninstall/reemerge some of: ${MOZ_MOZILLAS}" >+ elog "you might need to reemerge ${CATEGORY}/${PN}" >+ ${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.' >+ } >+} >+ >+if [ -n "${MOZ_MOZILLAS}" ] >+then EXPORT_FUNCTIONS src_install pkg_preinst pkg_postinst >+fi > > xpi_unpack() { >- local xpi xpiname srcdir >+ local xpi srcdir > > # Not gonna use ${A} as we are looking for a specific option being passed to function > # You must specify which xpi to use >- [[ -z "$*" ]] && die "Nothing passed to the $FUNCNAME command. please pass which xpi to unpack" >- >- for xpi in "$@"; do >- einfo "Unpacking ${xpi} to ${PWD}" >- xpiname=$(basename ${xpi%.*}) >+ [ ${#} -eq 0 ] && die \ >+ "Nothing passed to the ${FUNCNAME} command. Please pass which xpi to unpack" > >- if [[ "${xpi:0:2}" != "./" ]] && [[ "${xpi:0:1}" != "/" ]] ; then >- srcdir="${DISTDIR}/" >- fi >+ test -d "${S}" || mkdir "${S}" >+ for xpi >+ do einfo "Unpacking ${xpi} to ${S}" >+ xpiname=${xpi%.*} >+ xpiname=${xpiname##*/} >+ >+ case ${xpi} in >+ ./*|/*) >+ srcdir='';; >+ *) >+ srcdir="${DISTDIR}/";; >+ esac > >- [[ -s "${srcdir}${xpi}" ]] || die "${xpi} does not exist" >+ test -s "${srcdir}${xpi}" || die "${xpi} does not exist" > >- case "${xpi##*.}" in >- ZIP|zip|jar|xpi) >- mkdir "${WORKDIR}/${xpiname}" && \ >- unzip -qo "${srcdir}${xpi}" -d "${WORKDIR}/${xpiname}" || die "failed to unpack ${xpi}" >- ;; >- *) >- 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 > } > >- > xpi_install() { >- local emid >+ local d x > >- # You must tell xpi_install which xpi to use >- [[ ${#} -ne 1 ]] && die "$FUNCNAME takes exactly one argument, please specify an xpi to unpack" >+ # You must tell xpi_install which dir to use >+ [ ${#} -ne 1 ] && die "${FUNCNAME} takes exactly one argument. Please specify the directory" > >- x="${1}" >- cd ${x} >+ x=${1} > # determine id for extension >- emid="$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${x}"/install.rdf)" \ >- || die "failed to determine extension id" >- insinto "${MOZILLA_FIVE_HOME}"/extensions/${emid} >- doins -r "${x}"/* || die "failed to copy 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' >+ if [ -n "${MOZILLA_EXTENSIONS_DIRECTORY}" ] >+ then d="${MOZILLA_EXTENSIONS_DIRECTORY}/${d}" >+ MOZ_INS+=("${d}") >+ else d="${MOZILLA_FIVE_HOME}/extensions/${d}" >+ fi >+ test -d "${D}${d}" || dodir "${d}" || die "failed to create ${d}" >+ ${MOZ_LNK} && cp -RPl -- "${x}"/* "${D}${d}" || { >+ ${MOZ_LNK} && \ >+ ewarn 'Failed to hardlink extension. Falling back to USE=copy-extensions' >+ insinto "${d}" && doins -r "${x}"/* >+ } || { >+ ${MOZ_LNK} && \ >+ die 'failed to copy extension. Please retry emerging with USE=copy-extensions' >+ die 'failed to copy extension' >+ } >+} >+ >+# This function is called by mozextension_src_install >+# and should be overridden if the paths do not match: >+# It just should call xpi_install with the correct argument(s) >+xpi_install_dirs() { >+ local d >+ for d in "${S}"/* >+ do [ -n "${d}" ] && test -d "${d}" && xpi_install "${d}" >+ done > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 463010
: 343142 |
343144
|
343148