diff options
author | 2010-08-02 22:51:28 +0200 | |
---|---|---|
committer | 2015-10-11 10:45:54 +0200 | |
commit | e6cae82ef36be2c8f7d00917af20395a67e1f102 (patch) | |
tree | d3485186534761820dcd90797aeae6dd39137617 /eclass | |
parent | Make symlinks for extensions optional. Bump to force eclass upgrade (diff) | |
download | mv-e6cae82ef36be2c8f7d00917af20395a67e1f102.tar.gz mv-e6cae82ef36be2c8f7d00917af20395a67e1f102.tar.bz2 mv-e6cae82ef36be2c8f7d00917af20395a67e1f102.zip |
Hardlink (instead of copy) mozilla extensions
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/mv_mozextension.eclass | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/eclass/mv_mozextension.eclass b/eclass/mv_mozextension.eclass index 60d7b571..6ec20277 100644 --- a/eclass/mv_mozextension.eclass +++ b/eclass/mv_mozextension.eclass @@ -71,7 +71,7 @@ DEPEND="app-arch/unzip" [ -n "${RDEPEND}" ] && DEPEND="${DEPEND} ${RDEPEND}" -[ "${MV_MOZ_EXTDIR}" = "*" ] || IUSE="symlink_extensions" +[ "${MV_MOZ_EXTDIR}" = "*" ] || IUSE="copy_extensions symlink_extensions" mv_mozextension_src_unpack () { local i @@ -105,7 +105,7 @@ mv_mozextension_calc () { } mv_mozextension_src_install () { - local b d i j + local b d i j s MV_MOZ_PKG=() MV_MOZ_DIR=() b="/usr/$(get_libdir)/" @@ -123,6 +123,7 @@ mv_mozextension_src_install () { fi fi MV_MOZ_SYM=() + MV_MOZ_LNK=false if [ "${d}" = "*" ] || ! use symlink_extensions then MV_MOZ_CPY=: else MV_MOZ_CPY=false @@ -131,6 +132,7 @@ mv_mozextension_src_install () { else mv_mozextension_install "${b}mozilla/extensions" fi fi + use copy_extensions || MV_MOZ_LNK=: for i in "${MV_MOZ_DIR[@]}" do b="${i}/extensions" ${MV_MOZ_CPY} && mv_mozextension_install "${b}" @@ -251,8 +253,16 @@ xpi_install () { MV_MOZ_INS+=("${d}") else d="${MOZILLA_FIVE_HOME}/extensions/${d}" fi - insinto "${d}" - doins -r "${x}"/* || die "failed to copy extension" + 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" + 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" + } } # This function is called by mv_mozextension_src_install |