All pastes #220261 Raw Edit

Unnamed

public text v1 · immutable
#220261 ·published 2006-10-25 02:55 UTC
rendered paste body
--- /usr/portage/www-client/mozilla-firefox-bin/mozilla-firefox-bin-2.0.ebuild	2006-10-24 21:43:11.727302712 -0500
+++ mozilla-firefox-bin-2.0.ebuild	2006-10-24 21:55:02.119306712 -0500
@@ -18,13 +18,15 @@
 IUSE=""
 
 for X in ${LANGS} ; do
-	SRC_URI="${SRC_URI} linguas_${X/-/_}? ( mirror://gentoo/firefox-${X}-${PV}.xpi )"
+	SRC_URI="${SRC_URI}
+		linguas_${X/-/_}? ( http://gentooexperimental.org/~genstef/dist/${P}-xpi/${P}-${X}.xpi )"
 	IUSE="${IUSE} linguas_${X/-/_}"
-done
-
-for X in ${SHORTLANGS} ; do
-	SRC_URI="${SRC_URI} linguas_${X%%-*}? ( mirror://gentoo/firefox-${X}-${PV}.xpi )"
-	IUSE="${IUSE} linguas_${X%%-*}"
+	# english is handled internally
+	if [ "${#X}" == 5 ] && ! has ${X} ${NOSHORTLANGS}; then
+		SRC_URI="${SRC_URI}
+			linguas_${X%%-*}? ( http://gentooexperimental.org/~genstef/dist/${P}-xpi/${P}-${X}.xpi )"
+		IUSE="${IUSE} linguas_${X%%-*}"
+	fi
 done
 
 DEPEND="app-arch/unzip"
@@ -56,26 +58,27 @@
 	has_multilib_profile && ABI="x86"
 }
 
-linguas() {
-	linguas=
-	local LANG
+inguas() {
+	local LANG SLANG
 	for LANG in ${LINGUAS}; do
-		if hasq ${LANG} ${LANGS//-/_} en; then
-			hasq ${LANG//_/-} ${linguas} || \
-				linguas="${linguas:+"${linguas} "}${LANG//_/-}"
+		if has ${LANG} en en_US; then
+			has en ${linguas} || linguas="${linguas:+"${linguas} "}en"
+			continue
+		elif has ${LANG} ${LANGS//-/_}; then
+			has ${LANG//_/-} ${linguas} || linguas="${linguas:+"${linguas} "}${LANG//_/-}"
 			continue
-		else
-			local SLANG
-			for SLANG in ${SHORTLANGS}; do
-				if [[ ${LANG} == ${SLANG%%-*} ]]; then
-					hasq ${SLANG} ${linguas} || \
-						linguas="${linguas:+"${linguas} "}${SLANG}"
+		elif [[ " ${LANGS} " == *" ${LANG}-"* ]]; then
+			for X in ${LANGS}; do
+				if [[ "${X}" == "${LANG}-"* ]] && \
+					[[ " ${NOSHORTLANGS} " != *" ${X} "* ]]; then
+					has ${X} ${linguas} || linguas="${linguas:+"${linguas} "}${X}"
 					continue 2
 				fi
 			done
 		fi
 		ewarn "Sorry, but mozilla-firefox does not support the ${LANG} LINGUA"
 	done
+	einfo "Selected language packs (first will be default): $linguas"
 }
 
 src_unpack() {
@@ -83,7 +86,7 @@
 
 	linguas
 	for X in ${linguas}; do
-		[[ ${X} != en ]] && xpi_unpack firefox-${X}-${PV}.xpi
+		[[ ${X} != "en" ]] && xpi_unpack "${P}-${X}.xpi"
 	done
 }
 
@@ -97,16 +100,16 @@
 
 	linguas
 	for X in ${linguas}; do
-		[[ ${X} != en ]] && xpi_install ${WORKDIR}/firefox-${X}-${PV}
+		[[ ${X} != "en" ]] && xpi_install "${WORKDIR}"/"${P}-${X}"
 	done
 
 	local LANG=${linguas%% *}
-	if [[ ${LANG} != "" && ${LANG} != "en" ]]; then
-		ebegin "Setting default locale to ${LANG}"
-		sed -i "s:pref(\"general.useragent.locale\", \"en-US\"):pref(\"general.useragent.locale\", \"${LANG}\"):" \
-			${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox.js \
-			${D}${MOZILLA_FIVE_HOME}/defaults/pref/firefox-l10n.js
-		eend $? || die "sed failed to change locale"
+	if [[ -n ${LANG} && ${LANG} != "en" ]]; then
+		einfo "Setting default locale to ${LANG}"
+		dosed -e "s:general.useragent.locale\", \"en-US\":general.useragent.locale\", \"${LANG}\":" \
+			"${MOZILLA_FIVE_HOME}"/defaults/pref/firefox.js \
+			"${MOZILLA_FIVE_HOME}"/defaults/pref/firefox-l10n.js || \
+			die "sed failed to change locale"
 	fi
 
 	# Create /usr/bin/firefox-bin