summaryrefslogtreecommitdiff
blob: bcd54a177239db22d8a50f7b3ca2d318dfdfbf47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/mozilla-launcher.eclass,v 1.1 2004/05/28 02:32:16 agriffis Exp $

ECLASS=mozilla-launcher
INHERITED="$INHERITED $ECLASS"

update_mozilla_launcher_symlinks() {
	local f browsers="mozilla firefox thunderbird"
	cd ${ROOT}/usr/bin

	# Remove launcher symlinks that no longer apply

	for f in ${browsers}; do
		if [[ -L ${f} && ! -f ${f} ]]; then
			einfo "Removing dangling ${f} launcher"
			rm -f ${f}
		fi
	done

	# Create symlinks
	#
	# - If there's a -bin symlink in /usr/bin, and no corresponding
	#   non-bin symlink, then create one.
	#
	# - Can't do this in src_install otherwise it overwrites the one
	#   for the non-bin package.
	#
	# - Link to the -bin symlink so it's easier to detect when to
	#   remove the symlink.

	for f in ${browsers}; do
		if [[ -L ${f}-bin && ! -e ${f} ]]; then
			einfo "Adding link from ${f}-bin to ${f}"
			ln -s ${f}-bin ${f}
		fi
	done
}