diff options
author | 2004-02-15 01:41:04 +0000 | |
---|---|---|
committer | 2004-02-15 01:41:04 +0000 | |
commit | d608c38a76394afe13bb9deb53409704bd3ffe48 (patch) | |
tree | d734ac1e98e2441f14706cd691f45a00f089fc99 /net-www | |
parent | Initial Import. (diff) | |
download | historical-d608c38a76394afe13bb9deb53409704bd3ffe48.tar.gz historical-d608c38a76394afe13bb9deb53409704bd3ffe48.tar.bz2 historical-d608c38a76394afe13bb9deb53409704bd3ffe48.zip |
Roll fix over from MozillaFirebird script for bug 41074
Diffstat (limited to 'net-www')
-rw-r--r-- | net-www/mozilla-firefox/ChangeLog | 3 | ||||
-rw-r--r-- | net-www/mozilla-firefox/Manifest | 8 | ||||
-rw-r--r-- | net-www/mozilla-firefox/files/firefox | 104 |
3 files changed, 73 insertions, 42 deletions
diff --git a/net-www/mozilla-firefox/ChangeLog b/net-www/mozilla-firefox/ChangeLog index f3927655a475..2d5966f299f7 100644 --- a/net-www/mozilla-firefox/ChangeLog +++ b/net-www/mozilla-firefox/ChangeLog @@ -1,5 +1,8 @@ + 14 Feb 2004; Aron Griffis <agriffis@gentoo.org> files/firefox: + Roll fix over from MozillaFirebird script for bug 41074 + 14 Feb 2004; Brad Laue <brad@gentoo.org> files/icon/firefox-icon.png: Make the firefox icon have a transparent background. diff --git a/net-www/mozilla-firefox/Manifest b/net-www/mozilla-firefox/Manifest index 9b38010b55ab..1be33ab1bb29 100644 --- a/net-www/mozilla-firefox/Manifest +++ b/net-www/mozilla-firefox/Manifest @@ -1,9 +1,9 @@ -MD5 7556fef65a42d99830de08961c7c7ebe ChangeLog 1056 -MD5 ce23390351fe8020387d93ee29e09a3d metadata.xml 160 MD5 c04768860204da1a46c7527fccbfd45b mozilla-firefox-0.8.ebuild 7643 -MD5 606e82226379fd5ae6cd1d0d1faff7ff files/10MozillaFirefox 31 +MD5 aaddd6a28fe6dad6489be743455989f2 ChangeLog 1180 +MD5 ce23390351fe8020387d93ee29e09a3d metadata.xml 160 MD5 507a3d1338e85acc8828cec7c91d22df files/digest-mozilla-firefox-0.8 73 -MD5 5d884fad16a8057e81bed354fc7d20e5 files/firefox 2793 +MD5 392bd650666dfcd4003a212dc09970da files/firefox 3519 MD5 23d1fbd03cc6dd346a4e4ce8f2d88ebf files/mozilla-1.3-alpha-stubs.patch 4646 +MD5 606e82226379fd5ae6cd1d0d1faff7ff files/10MozillaFirefox 31 MD5 f0e9adeb0454377ce019e8969e644efb files/mozilla-firebird-amd64.patch 35052 MD5 bff260036c5dcca45da3218517fb33d8 files/icon/firefox-icon.png 3979 diff --git a/net-www/mozilla-firefox/files/firefox b/net-www/mozilla-firefox/files/firefox index 6ace6fa21cbd..59836efcab4e 100644 --- a/net-www/mozilla-firefox/files/firefox +++ b/net-www/mozilla-firefox/files/firefox @@ -2,14 +2,15 @@ # # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-www/mozilla-firefox/files/firefox,v 1.1 2004/02/10 07:21:13 brad Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-www/mozilla-firefox/files/firefox,v 1.2 2004/02/15 01:41:04 agriffis Exp $ -# Set to "window" if you prefer new Firefox windows instead of new tabs +# Set MOZILLA_NEWTYPE to "window" in your environment if you prefer +# new Firefox windows instead of new tabs newtype=${MOZILLA_NEWTYPE:-"tab"} # Point this to your Firefox installation if not using the default export MOZILLA_FIVE_HOME="/usr/lib/MozillaFirefox" -fbpath=${MOZILLA_FIVE_HOME} +ffpath=${MOZILLA_FIVE_HOME} # Sanity check if [[ -z $DISPLAY ]]; then @@ -17,28 +18,22 @@ if [[ -z $DISPLAY ]]; then exit 1 fi -# Validate the args and extract the url -url='' -declare -a args=($@) +# Validate the args and extract the urls +args=() +urls=() while [[ $# -ne 0 ]] ; do if [[ $1 == -* ]] ; then - case ${1#-} in + case "${1#-}" in height|width|CreateProfile|P|UILocale|contentLocale|remote|edit|chrome) + args=("${args[@]}" "$1" "$2") shift 2 ;; *) + args=("${args[@]}" "$1") shift 1 ;; esac else - if [[ -n $url ]] ; then - echo "Usage error: more than one URL given" >&2 - exit 255 - else - url=$1 - shift 1 - if [[ $url != *:* ]] ; then - url=http://$url - fi - fi + urls=("${urls[@]}" $1) + shift fi done @@ -56,10 +51,10 @@ declare -a screens=( # Attempt to fix bug 39797 by making sure MozillaFirefox is running # on the DISPLAY prior to calling mozilla-xremote-client. The # problem here is that mozilla-xremote-client will return a zero -# exit status if it contacts a Thunderfox-0.3 instance, even though -# Thunderfox can't handle the openURL request. :-( +# exit status if it contacts a Thunderbird-0.3 instance, even though +# Thunderbird can't handle the openURL request. :-( # -# Note: This seems to be fixed with Thunderfox-0.4, which rejects the +# Note: This seems to be fixed with Thunderbird-0.4, which rejects the # openURL request appropriately. declare -a candidates=() for s in $DISPLAY "${screens[@]}"; do @@ -68,28 +63,61 @@ for s in $DISPLAY "${screens[@]}"; do fi done -if [[ ${#candidates[@]} > 0 ]]; then - for s in "${candidates[@]}"; do - DISPLAY=${s} ${fbpath}/mozilla-xremote-client "openURL($url, new-$newtype)" \ - && exit 0 - done - retval=$? -else - # simulate mozilla-xremote-client's response when it can't find an instance - retval=2 -fi +# Make sure we'll get at least an empty window/tab +[[ ${#urls[@]} == 0 ]] && urls=('') + +# Handle multiple URLs by looping over the xremote call +for u in "${urls[@]}"; do + + # prepend http:// if needed + [[ $u == ? && $u != *:* ]] && u=http://$u + + # try mozila-xremote-client on each candidate screen + if [[ ${#candidates[@]} > 0 ]]; then + for s in "${candidates[@]}"; do + DISPLAY=${s} \ + ${fbpath}/mozilla-xremote-client "openURL($u, new-$newtype)" \ + && break + done + retval=$? + else + # simulate mozilla-xremote-client's response when it can't find an instance + retval=2 + fi -if [[ $retval -eq 2 || $retval -eq 3 ]] ; then # 2 = No running windows found, so start a new instance - # 3 = Thunderfox is running, but doesn't handle openURL command + # 3 = Thunderbird is running, but doesn't handle openURL command # (or it might be an unresponsive Firefox) - ${fbpath}/firefox "${args[@]}" && exit 0 + if [[ $retval -eq 2 || $retval -eq 3 ]] ; then + + # Handle case of multiple URLs + if [[ ${#urls[@]} > 1 ]]; then + ${fbpath}/firefox "${args[@]}" "$u" & + if [[ -x /usr/bin/xtoolwait ]]; then + xtoolwait sleep 10 + else + sleep 10 # totally arbitrary! :-( + fi + candidates=$DISPLAY + continue + fi + + # Handle case of single URL + ${fbpath}/firefox "${args[@]}" "$u" & + break + + elif [[ $retval -eq 1 ]]; then + echo "Unable to connect to X server" >&2 + elif [[ $retval -ne 0 ]]; then + echo "Unknown error $retval from mozilla-xremote-client" >&2 + fi + +done + +# Will only wait here if firefox was started by this script +if ! wait; then retval=$? - echo "firefox exited with non-zero status ($retval)" >&2 -elif [[ $retval -eq 1 ]] ; then - echo "Unable to connect to X server" >&2 -else - echo "Unknown error $retval from mozilla-xremote-client" >&2 + echo "firefox exited with non-zero status ($?)" >&2 fi exit $retval |