From josemi@freebsd.jazztel.es  Thu Dec 23 11:17:11 2004
Return-Path: <josemi@freebsd.jazztel.es>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 17D4F16A4CE; Thu, 23 Dec 2004 11:17:11 +0000 (GMT)
Received: from smtp1.jazztel.es (smtp1.jazztel.es [62.14.3.161])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 3B54843D39; Thu, 23 Dec 2004 11:17:10 +0000 (GMT)
	(envelope-from josemi@freebsd.jazztel.es)
Received: from antivirus
	by smtp1.jazztel.es
	with antivirus id 1ChQyF-0006jj-00
	Thu, 23 Dec 2004 12:17:27 +0100
Received: from [212.106.253.64] (helo=antares.redesjm.local)
	by smtp1.jazztel.es
	with esmtp id 1ChQyF-0006i0-00
	Thu, 23 Dec 2004 12:17:27 +0100
Received: from redesjm.local (orion.redesjm.local [192.168.254.16])
	by antares.redesjm.local (8.13.1/8.13.1) with ESMTP id iBNBH6ro038704;
	Thu, 23 Dec 2004 12:17:06 +0100 (CET)
	(envelope-from freebsd@redesjm.local)
Received: (from freebsd@localhost)
	by redesjm.local (8.13.1/8.13.1/Submit) id iBNBH55H002761;
	Thu, 23 Dec 2004 12:17:05 +0100 (CET)
	(envelope-from freebsd)
Message-Id: <200412231117.iBNBH55H002761@redesjm.local>
Date: Thu, 23 Dec 2004 12:17:05 +0100 (CET)
From: Jose M Rodriguez (freebsd) <josemi@freebsd.jazztel.es>
To: FreeBSD-gnats-submit@freebsd.org
Cc: gnome@freebsd.org
Subject: [PATCH] www/mozilla: update mozilla.sh
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         75428
>Category:       ports
>Synopsis:       [PATCH] www/mozilla: update mozilla.sh
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 23 11:20:16 GMT 2004
>Closed-Date:    Fri Dec 24 18:30:03 GMT 2004
>Last-Modified:  Fri Dec 24 18:30:03 GMT 2004
>Originator:     Jose M Rodriguez (freebsd)
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
Redes JM
>Environment:
System: FreeBSD orion.redesjm.local 5.3-STABLE FreeBSD 5.3-STABLE #0: Wed Dec 22 19:41:23 CET 2004
>Description:
- Update mozilla.sh script
	Correct fail with remote and MOZILLA_UILOCALE
	Add artsdsp/esddsp support

Port maintainer (gnome@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- mozilla-1.7.5,2.patch begins here ---
diff -ruN --exclude=CVS /usr/HEAD/ports/www/mozilla/files/mozilla.sh /junk/wk/www/mozilla/files/mozilla.sh
--- /usr/HEAD/ports/www/mozilla/files/mozilla.sh	Sun Dec 19 21:02:25 2004
+++ /junk/wk/www/mozilla/files/mozilla.sh	Thu Dec 23 11:18:49 2004
@@ -1,12 +1,18 @@
 #!/bin/sh
 
 MOZILLA_DIR="%%PREFIX%%/lib/%%MOZILLA%%"
-MOZILLA_EXEC="mozilla"
+MOZILLA_EXEC="./mozilla"
+MOZILLA_REMOTE_EXEC="${MOZILLA_EXEC} -remote"
+APPLICATION_ID="mozilla"
+
 LOCATION='new-tab'
+#MOZILLA_UILOCALE="en-US"
+#MOZILLA_UIREGION="US"
+#MOZILLA_DSP="auto"
 
 cd $MOZILLA_DIR                                     || exit 1
 
-# LANG, MOZILLA_UILOCALE, MOZILLA_REGION
+# LANG, MOZILLA_UILOCALE, MOZILLA_UIREGION
 if [ -n "$LANG" -a ! -n "${MOZILLA_UILOCALE}" ]; then
     _locale="${LANG%%.*}"
     if [ "${_locale}" != "en_US" -a "${_locale}" != "C" ]; then
@@ -22,6 +28,32 @@
     fi
 fi
 
+# find a /dev/dsp handler
+case "${MOZILLA_DSP}" in
+    [Ee][Ss][Dd]|esddsp) # Use the esd dsp wrapper
+	MOZILLA_DSP="esddsp"
+	;;
+    [Aa][Rr][Tt][Ss]|artsdsp) # Use the arts dsp wrapper
+	MOZILLA_DSP="artsdsp"
+	;;
+    [Nn][Oo][Nn][Ee]) # Direct dsp output
+	MOZILLA_DSP=""
+	;;
+    *) # Guest one (auto)
+	if [ -n "${KDE_FULL_SESSION}" ]; then
+		MOZILLA_DSP="artsdsp"
+	elif [ -r ${HOME}/.esd_auth ]; then
+		MOZILLA_DSP="esddsp"
+	else
+		MOZILLA_DSP=""
+	fi
+	;;
+esac
+
+if [ -n "${MOZILLA_DSP}" ] && type "${MOZILLA_DSP}" > /dev/null 2>&1; then
+	MOZILLA_EXEC="${MOZILLA_DSP} ${MOZILLA_EXEC}"
+fi
+
 case $1 in
     -browser)
     	REMOTE_COMMAND="xfeDoCommand (openBrowser)"
@@ -33,17 +65,21 @@
     	REMOTE_COMMAND="xfeDoCommand (composeMessage)"
 	;;
     -*)
-    	exec ./$MOZILLA_EXEC "$@"
+    	exec ${MOZILLA_EXEC} "$@"
 	;;
     *)
-    	REMOTE_COMMAND="openURL($@,$LOCATION)"
+	if [ -n "${LOCATION}" ]; then
+    		REMOTE_COMMAND="openURL($@,$LOCATION)"
+	else
+		REMOTE_COMMAND="openURL($@)"
+	fi
 	;;
 esac
 
 # process found
-./$MOZILLA_EXEC -remote "ping()"                    &&
-./$MOZILLA_EXEC -remote "$REMOTE_COMMAND"           && exit 0
+${MOZILLA_REMOTE_EXEC} "ping()" >/dev/null 2>&1     &&
+${MOZILLA_REMOTE_EXEC} "${REMOTE_COMMAND}"          && exit 0
 
 # no existing process
-exec ./$MOZILLA_EXEC "$@"
+exec ${MOZILLA_EXEC} "$@"
 
--- mozilla-1.7.5,2.patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->gnome  
Responsible-Changed-By: krion 
Responsible-Changed-When: Thu Dec 23 11:45:03 GMT 2004 
Responsible-Changed-Why:  
Over to maintainers. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75428 

From: Jose M Rodriguez <josemi@freebsd.jazztel.es>
To: Cc: FreeBSD-gnats-submit@FreeBSD.org, gnome@FreeBSD.org
Subject: Re: ports/75428: [PATCH] www/mozilla: update mozilla.sh
Date: Thu, 23 Dec 2004 15:23:00 +0100

 Jose M Rodriguez (freebsd) wrote:
 
 please, comment out esddsp detection/use.  At last here, (RELENG_5) I 
 found bus segfaults (int 6) with esddsp that must be investigated first.
 
 No errors so far with artsdsp
 
 --
   josemi
 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Fri Dec 24 18:29:51 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75428 
>Unformatted:
