From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Feb 28 23:50:10 2005 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8344016A4CE for ; Mon, 28 Feb 2005 23:50:10 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A08B43D5D for ; Mon, 28 Feb 2005 23:50:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j1SNoAYt010822 for ; Mon, 28 Feb 2005 23:50:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j1SNoAJG010818; Mon, 28 Feb 2005 23:50:10 GMT (envelope-from gnats) Resent-Date: Mon, 28 Feb 2005 23:50:10 GMT Resent-Message-Id: <200502282350.j1SNoAJG010818@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jose M Rodriguez Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0E3A16A4D2; Mon, 28 Feb 2005 23:46:35 +0000 (GMT) Received: from 212.106.237.41.adsl.jazztel.es (212.106.236.80.adsl.jazztel.es [212.106.236.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CD3943D54; Mon, 28 Feb 2005 23:46:34 +0000 (GMT) (envelope-from josemi@freebsd.jazztel.es) Received: from redesjm.local (orion.redesjm.local [192.168.254.16]) j1SNkT5L091696; Tue, 1 Mar 2005 00:46:29 +0100 (CET) (envelope-from freebsd@redesjm.local) Received: (from freebsd@localhost) by redesjm.local (8.13.3/8.13.3/Submit) id j1SNkTah070901; Tue, 1 Mar 2005 00:46:29 +0100 (CET) (envelope-from freebsd) Message-Id: <200502282346.j1SNkTah070901@redesjm.local> Date: Tue, 1 Mar 2005 00:46:29 +0100 (CET) From: Jose M Rodriguez To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: gnome@FreeBSD.org Subject: ports/78217: [PATCH] correct mozilla.sh script X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jose M Rodriguez List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2005 23:50:10 -0000 >Number: 78217 >Category: ports >Synopsis: [PATCH] correct mozilla.sh script >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 28 23:50:09 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Jose M Rodriguez >Release: FreeBSD 5.4-PRERELEASE i386 >Organization: Redes JM >Environment: System: FreeBSD orion.redesjm.local 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #2: Sun Feb 27 20:13:39 CET 2005 root@orion.redesjm.local:/usr/obj/usr/src/sys/ORION i386 >Description: merged mozilla.sh have several errors: - go to xremote with options - don't protect target for real invocation fallback - moreargs misspelling as more_args Also, take out xremote ping() seems not be needed, due we do real invocation fallback if remote fails. My test about use -[pP] with xremote have no success. I'll add -[pP] processing when got it. this correct process -P, -ProfileManager, ... >How-To-Repeat: >Fix: --- patch-mozilla-devel begins here --- --- /usr/HEAD/ports/www/mozilla-devel/files/patch-xpfe_bootstrap_mozilla.in Mon Feb 28 02:43:57 2005 +++ mozilla-devel/files/patch-xpfe_bootstrap_mozilla.in Tue Mar 1 00:15:46 2005 @@ -1,6 +1,6 @@ --- xpfe/bootstrap/mozilla.in.orig Sat Apr 17 18:51:11 2004 -+++ xpfe/bootstrap/mozilla.in Thu Feb 17 14:55:17 2005 -@@ -49,139 +49,314 @@ ++++ xpfe/bootstrap/mozilla.in Tue Mar 1 00:12:20 2005 +@@ -49,139 +49,319 @@ ## the mozilla-bin binary to work. ## @@ -145,9 +145,6 @@ + curdir="$MOZILLA_FIVE_HOME" + run_moz="$curdir/run-mozilla.sh" + dist_bin="$curdir" -+ found=1 -+elif [ -x "$run_moz" ]; then -+ dist_bin="$curdir" found=1 - else - here=`/bin/pwd` @@ -166,6 +163,9 @@ - found=1 - break - fi ++elif [ -x "$run_moz" ]; then ++ dist_bin="$curdir" ++ found=1 +else + while [ -h "${progname}" ]; do + bn=`basename "${progname}"` @@ -216,40 +216,29 @@ if [ "$OSTYPE" = "beos" ]; then - mimeset -F $MOZILLA_BIN + mimeset -F "$MOZILLA_BIN" -+fi -+MOZILLA_BIN="${dist_bin}/${progbase}-bin" -+ + fi + +# test for binary apps in ${dist_bin} -+if [ -x "${dist_bin}/mozilla-xremote-client" ]; then -+ MOZ_CLIENT_PROGRAM="${dist_bin}/mozilla-xremote-client -a ${progbase}" -+elif [ -x "${MOZILLA_BIN}" ]; then -+ MOZ_CLIENT_PROGRAM="${MOZILLA_BIN} -remote -a ${progbase}" ++if [ -x "${dist_bin}/${MOZILLA_BIN}" ]; then ++ MOZILLA_BIN="${dist_bin}/${progbase}-bin" +else + echo "$0: Cannot find mozilla binary executable. Exiting." 1>&2 + exit 1 +fi ++if [ -x "${dist_bin}/mozilla-xremote-client" ]; then ++ MOZ_CLIENT_PROGRAM="${dist_bin}/mozilla-xremote-client -a ${progbase}" ++else ++ MOZ_CLIENT_PROGRAM="${MOZILLA_BIN} -remote -a ${progbase}" ++fi + +# guest a default remote command +_remote_cmd="xfeDoCommand(openBrowser)" + -+# test for a running copy of mozilla -+ALREADY_RUNNING= # null -+if [ -n "${DISPLAY}" ]; then -+ if [ -n "${debugging}" ]; then -+ echo "${run_moz} ${MOZ_CLIENT_PROGRAM} ping()" -+ ${run_moz} ${MOZ_CLIENT_PROGRAM} 'ping()' && ALREADY_RUNNING="yes" -+ else -+ ${run_moz} ${MOZ_CLIENT_PROGRAM} 'ping()' >/dev/null 2>&1 && -+ ALREADY_RUNNING="yes" -+ fi -+elif [ -n "${debugging}" ]; then -+ echo "$0: WARN, no DISPLAY environment" 1>&2 - fi - +# parse options +script_args= # null +moreargs= # null +target= # null ++ALREADY_RUNNING="test" while [ $# -gt 0 ] do - case "$1" in @@ -273,11 +262,12 @@ - esac + if [ -n "${target}" ]; then + # well, this can't be the target if not last -+ moreargs="${moreargs} ${target}" ++ moreargs="${moreargs} \"${target}\"" + target= # null + fi + case "$1" in -+ -p | --pure | -pure) ++ # preserve [pP] for profile ++ --pure | -pure) + MOZILLA_BIN="${MOZILLA_BIN}.pure" + shift + ;; @@ -291,31 +281,30 @@ + script_args="${script_args} -d $2" + shift 2 + else -+ "$0: ERROR, -d needs an argument. Exiting" 1>&2 ++ "$0: ERROR, $1 needs an argument. Exiting" 1>&2 + exit 1 + fi + ;; -+ -UILocale) ++ -[Uu][Ii][Ll]ocale) + if [ -n "$2" ]; then + uilocale="$2" + shift 2 + else -+ echo "$0: ERROR, -UILocale needs an argument. Exiting" 1>&2 ++ echo "$0: ERROR, $1 needs an argument. Exiting" 1>&2 + exit 1 + fi + ;; -+ -UIRegion) ++ -[Uu][Ii][Rr]egion) + if [ -n "$2" ]; then + uiregion="$2" + shift 2 + else -+ echo "$0: ERROR, -UIRegion needs an argument. Exiting" 1>&2 ++ echo "$0: ERROR, $1 needs an argument. Exiting" 1>&2 + exit 1 + fi + ;; + -browser) -+ _remote_cmd="xfeDoCommand(openBrowser)" -+ moreargs="${moreargs} $1" ++ # browser is default for mozilla + shift + ;; + -mail) @@ -328,13 +317,14 @@ + moreargs="${moreargs} $1" + shift + ;; -+ -chat | -edit | -webcal) -+ # don't use remote for this -+ ALREADY_RUNNING= # null ++ -turbo | -nosplash | -quiet) ++ # use remote even with this + moreargs="${moreargs} $1" + shift + ;; + -*) ++ # don't use remote with options ++ ALREADY_RUNNING= # null + moreargs="${moreargs} $1" + shift + ;; @@ -347,21 +337,40 @@ -export MRE_HOME -eval "set -- $moreargs" ++# test for a running copy of firefox ++# seems this is not needed ++#if [-n "${ALREADY_RUNNING}" ]; then ++# if [ -n "${DISPLAY}" ]; then ++# if [ -n "${debugging}" ]; then ++# echo "${run_moz} ${MOZ_CLIENT_PROGRAM} ping()" ++# ${run_moz} ${MOZ_CLIENT_PROGRAM} 'ping()' && ALREADY_RUNNING="yes" ++# else ++# ${run_moz} ${MOZ_CLIENT_PROGRAM} 'ping()' >/dev/null 2>&1 && ++# ALREADY_RUNNING="yes" ++# fi ++# elif [ -n "${debugging}" ]; then ++# echo "$0: WARN, no DISPLAY environment" 1>&2 ++# fi ++#fi ++ +# process target +if [ -n "${target}" ]; then -+ if [ `expr "${target}" : '.*:.*'` -eq 0 ]; then -+ if [ `expr "${target}" : '/.*'` -eq 0 ]; then -+ target="${here}/${target}" -+ fi -+ if [ -r "${target}" -o -d "${target}" ]; then -+ [ -n "${use_openFile}" ] || target="file://${target}" ++ moreargs="${moreargs} \"${target}\"" ++ if [ -n "${ALREADY_RUNNING}" ]; then ++ if [ `expr "${target}" : '.*:.*'` -eq 0 ]; then ++ if [ `expr "${target}" : '/.*'` -eq 0 ]; then ++ target="${here}/${target}" ++ fi ++ if [ -r "${target}" -o -d "${target}" ]; then ++ [ -n "${use_openFile}" ] || target="file://${target}" ++ else ++ echo "$0: WARN, target: ${target} not an URI/file/dir" 1>&2 ++ ALREADY_RUNNING= # null ++ fi + else -+ echo "$0: WARN, target: ${target} not an URI/file/dir" 1>&2 -+ ALREADY_RUNNING= # null ++ # an former URI, don't use openFile ++ use_openFile= # null + fi -+ else -+ # an former URI, don't use openFile -+ use_openFile= # null + fi +fi + @@ -397,17 +406,13 @@ +fi +if [ -n "${uilocale}" ]; then + if [ -n "${uiregion}" ]; then -+ moreargs="-UIRegion ${uiregion} ${more_args}" ++ moreargs="-UIRegion ${uiregion} ${moreargs}" + fi -+ moreargs="-UILocale ${uilocale} ${more_args}" ++ moreargs="-UILocale ${uilocale} ${moreargs}" +fi + +# real invocation -+if [ -n "${target}" ]; then -+ eval "set -- ${moreargs} \"${target}\"" -+else -+ eval "set -- ${moreargs}" -+fi ++eval "set -- ${moreargs}" ## Start addon scripts moz_pis_startstop_scripts "start" --- patch-mozilla-devel ends here --- >Release-Note: >Audit-Trail: >Unformatted: