diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2005-07-23 09:17:47 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2005-07-23 09:17:47 +0000 |
commit | 69ac549abf6a1e4f74bc867f0273fc0290b87f00 (patch) | |
tree | 74984eda8609f6679d9d2ac61b9331c42077a051 /www-client | |
parent | Commit proof of concept stuff for update-nsplugins. (diff) | |
download | gentoo-2-69ac549abf6a1e4f74bc867f0273fc0290b87f00.tar.gz gentoo-2-69ac549abf6a1e4f74bc867f0273fc0290b87f00.tar.bz2 gentoo-2-69ac549abf6a1e4f74bc867f0273fc0290b87f00.zip |
Initial proof of concept by myself.
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'www-client')
-rw-r--r-- | www-client/update-nsplugins/ChangeLog | 10 | ||||
-rw-r--r-- | www-client/update-nsplugins/Manifest | 4 | ||||
-rw-r--r-- | www-client/update-nsplugins/files/digest-update-nsplugins-1.0 | 0 | ||||
-rw-r--r-- | www-client/update-nsplugins/files/update-nsplugins-1.0 | 71 | ||||
-rw-r--r-- | www-client/update-nsplugins/metadata.xml | 5 | ||||
-rw-r--r-- | www-client/update-nsplugins/update-nsplugins-1.0.ebuild | 27 |
6 files changed, 117 insertions, 0 deletions
diff --git a/www-client/update-nsplugins/ChangeLog b/www-client/update-nsplugins/ChangeLog new file mode 100644 index 000000000000..314e7a4df379 --- /dev/null +++ b/www-client/update-nsplugins/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for www-client/update-nsplugins +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/www-client/update-nsplugins/ChangeLog,v 1.1 2005/07/23 09:17:47 azarah Exp $ + +*update-nsplugins-1.0 (23 Jul 2005) + + 23 Jul 2005; Martin Schlemmer <azarah@gentoo.org> + +files/update-nsplugins-1.0, +metadata.xml, +update-nsplugins-1.0.ebuild: + Initial proof of concept by myself. + diff --git a/www-client/update-nsplugins/Manifest b/www-client/update-nsplugins/Manifest new file mode 100644 index 000000000000..c8687242a88a --- /dev/null +++ b/www-client/update-nsplugins/Manifest @@ -0,0 +1,4 @@ +MD5 a0ba70091a8ebf2f83697cbac7fc2707 update-nsplugins-1.0.ebuild 518 +MD5 17413b2d5c584df90c031b146a34cf90 .update-nsplugins-1.0.ebuild.swp 12288 +MD5 08fd58d6e9c32b6456e0fc8a8192462c files/update-nsplugins-1.0 1381 +MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-update-nsplugins-1.0 0 diff --git a/www-client/update-nsplugins/files/digest-update-nsplugins-1.0 b/www-client/update-nsplugins/files/digest-update-nsplugins-1.0 new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/www-client/update-nsplugins/files/digest-update-nsplugins-1.0 diff --git a/www-client/update-nsplugins/files/update-nsplugins-1.0 b/www-client/update-nsplugins/files/update-nsplugins-1.0 new file mode 100644 index 000000000000..56e463b46397 --- /dev/null +++ b/www-client/update-nsplugins/files/update-nsplugins-1.0 @@ -0,0 +1,71 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-client/update-nsplugins/files/update-nsplugins-1.0,v 1.1 2005/07/23 09:17:47 azarah Exp $ + +ROOT=${ROOT:-/} + +source "${ROOT}/etc/nsplugins.conf" + +NSPLUGINS_DIR="${ROOT}${NSPLUGINS_DIR}" +NSBROWSERS_DIR="${ROOT}${NSBROWSERS_DIR}" +CACHE_DIR="${NSPLUGINS_DIR}/.cache" + +install_plugins() { + local browser_plugin_dir="${ROOT}$1" + + for x in "${NSPLUGINS_DIR}"/* ; do + local plugin_name=${x##*/} + + [[ -f ${x} || -L ${x} ]] && \ + ln -snf "${x}" "${browser_plugin_dir}/${plugin_name}" + done +} + +uninstall_plugins() { + local browser_plugin_dir="${ROOT}$1" + + for x in "${browser_plugin_dir}"/* ; do + [[ -L ${x} ]] && \ + rm -f "${x}" + done +} + +main() { + local x + + mkdir -p "${CACHE_DIR}" + + # Install plugin symlinks + for x in "${NSBROWSERS_DIR}"/* ; do + if [[ -f ${x} ]] ; then + local browser_plugin_dir="${ROOT}$(< "${x}")" + + if [[ -d "${browser_plugin_dir}" ]] ; then + install_plugins "${browser_plugin_dir}" + cp -f "${x}" "${CACHE_DIR}/${x}" + fi + fi + done + + # Remove old invalid symlinks for uninstalled browsers + for x in "${CACHE_DIR}"/* ; do + local browser_name=${x##*/} + + if [[ -f ${x} && ! -f ${NSBROWSERS_DIR}/${browser_name} ]] ; then + local browser_plugin_dir="${ROOT}$(< "${x}")" + + if [[ -d "${browser_plugin_dir}" ]] ; then + uninstall_plugins "${browser_plugin_dir}" + rm -f "${x}" + fi + fi + done +} + +if [[ $UID != 0 ]]; then + echo "$0: You need to be root to update the plugins" >&2 + return 1 +fi + +main diff --git a/www-client/update-nsplugins/metadata.xml b/www-client/update-nsplugins/metadata.xml new file mode 100644 index 000000000000..74d9257900cf --- /dev/null +++ b/www-client/update-nsplugins/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>mozilla</herd> +</pkgmetadata> diff --git a/www-client/update-nsplugins/update-nsplugins-1.0.ebuild b/www-client/update-nsplugins/update-nsplugins-1.0.ebuild new file mode 100644 index 000000000000..6ed6c61986ac --- /dev/null +++ b/www-client/update-nsplugins/update-nsplugins-1.0.ebuild @@ -0,0 +1,27 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-client/update-nsplugins/update-nsplugins-1.0.ebuild,v 1.1 2005/07/23 09:17:47 azarah Exp $ + +inherit nsplugins + +DESCRIPTION="Updates plugin symlinks for browsers using Netscape compatible plugins" +HOMEPAGE="http://www.gentoo.org/" +SRC_URI= + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64" +IUSE= + +DEPEND= +RDEPEND= + +src_install() { + newsbin ${FILESDIR}/${P} ${PN} + + dodir /etc + cat > ${D}/etc/nsplugins.conf <<-EOF + NSPLUGINS_DIR="${NSPLUGINS_DIR}" + NSBROWSERS_DIR="${NSBROWSERS_DIR}" + EOF +} |