Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Apr 2003 16:26:45 +0200 (CEST)
From:      Guido Berhoerster <ich@guido-berhoerster.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/50643: [PATCH] Add a wrapper script to phoenix
Message-ID:  <200304061426.h36EQjgP039072@hal.privat.lan>
Resent-Message-ID: <200304061430.h36EUI0v033447@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         50643
>Category:       ports
>Synopsis:       [PATCH] Add a wrapper script to phoenix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 06 07:30:18 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Guido Berhoerster
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
>Environment:
System: FreeBSD hal.privat.lan 4.8-RELEASE FreeBSD 4.8-RELEASE #1: Fri Apr 4 15:35:08 CEST 2003 root@hal.privat.lan:/usr/obj/usr/src/sys/HAL i386


	
>Description:

Unlike the mozilla* ports phoenix does not use a wrapper script
that checks if a process of phoenix is already running. Instead
${PREFIX}/bin/phoenix is a symlink to the phoenix startup script
in ${PREFIX}/lib/phoenix/bin/. So if phoenix is already running and
then called again the profile manager will pop up which is quite
annoying.
There is an extra script 'phoenix.rb' which does this but it's
rather impractical since it requires ruby to be installed.

>How-To-Repeat:

Call phoenix again when it is already running.

>Fix:

The following shell script which is heavily inspired by its
equivalents from the mozilla* ports acts as a wrapper for the
phoenix startup script. If phoenix is already running and called
again it will open up a new tab just like the mozilla* ports do.

--- phoenix.sh begins here ---
#!/bin/sh

MOZILLA_DIR="%%PREFIX%%/lib/phoenix/bin"
MOZILLA_EXEC="phoenix"
LOCATION='new-tab'

cd $MOZILLA_DIR                                     || exit 1

case $1 in
    -*)
    	exec ./$MOZILLA_EXEC "$@"
	;;
    *)
    	REMOTE_COMMAND="openURL($@, $LOCATION)"
	;;
esac
    
# process found
./$MOZILLA_EXEC -remote "ping()"                    &&
./$MOZILLA_EXEC -remote "$REMOTE_COMMAND"           && exit 0

# no existing process
exec ./$MOZILLA_EXEC "$@"
--- phoenix.sh ends here ---

Apply this to the Makefile.

--- Makefile.diff begins here ---
--- Makefile.orig	Fri Mar  7 07:12:52 2003
+++ Makefile	Sun Apr  6 15:32:44 2003
@@ -103,21 +103,23 @@
 		<${FILESDIR}/mozconfig.in >${WRKSRC}/.mozconfig
 
 post-build:
+	${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \
+		${FILESDIR}/phoenix.sh >${WRKSRC}/phoenix
 	${RM} -f ${PLIST}
 	${TOUCH} ${PLIST}
 
 pre-install:
 	${RM} -fr ${LOCAL_PREFIX}
 
+do-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/phoenix ${PREFIX}/bin
+
 install-extra:
 .for i in ${EXTRA_SCRIPTS}
 	${INSTALL_SCRIPT} ${FILESDIR}/${i} ${PREFIX}/bin
 .endfor # i in ${EXTRA_SCRIPTS}
 
 link-bins:
-	${RM} -f ${PREFIX}/bin/phoenix
-	${LN} -s ${LOCAL_PREFIX}/bin/phoenix \
-		${PREFIX}/bin/phoenix
 	${RM} -f ${PREFIX}/bin/phoenix-config
 	${LN} -s ${LOCAL_PREFIX}/bin/mozilla-config \
 		${PREFIX}/bin/phoenix-config
--- Makefile.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304061426.h36EQjgP039072>