Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37519217
en ru br
Репозитории ALT
S:2.53.17.1-alt1
5.1: 1.1.18-alt2
4.1: 1.1.16-alt0.M41.1
+updates:1.1.13-alt0.M41.1
4.0: 1.1.12-alt0.M40.1
www.altlinux.org/Changes

Группа :: Сети/WWW
Пакет: seamonkey

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: mozilla-1.7-alt-run-mozilla.patch
Скачать


--- mozilla/build/unix/run-mozilla.sh.run-mozilla	2003-12-15 20:27:28 +0300
+++ mozilla/build/unix/run-mozilla.sh	2004-07-08 02:14:22 +0400
@@ -69,6 +69,10 @@ MOZ_DEFAULT_NAME="./${cmdname}-bin"
 MOZ_APPRUNNER_NAME="./mozilla-bin"
 MOZ_VIEWER_NAME="./viewer"
 MOZ_PROGRAM=""
+MOZ_CLIENT_PROGRAM="${MOZ_DIST_BIN}/mozilla-xremote-client"
+
+ALREADY_RUNNING=""
+RUNS=""
 
 exitcode=0
 #
@@ -155,6 +159,68 @@ moz_get_debugger()
 	return 0
 }
 ##########################################################################
+check_running() {
+    #$MOZ_CLIENT_PROGRAM 'ping()' 2>/dev/null >/dev/null
+    RETURN_VAL=$(pidof $MOZ_PROGRAM)
+    if [ -z "$RETURN_VAL" ]; then
+      echo 0
+      return 0
+    else
+      echo 1
+      return 1
+    fi
+}
+##########################################################################
+open_mail() {
+  if [ "${ALREADY_RUNNING}" -eq "1" ]; then
+	RUNS="$MOZ_CLIENT_PROGRAM xfeDoCommand(openInbox)"
+  else 
+	RUNS="$MOZ_PROGRAM $*"
+  fi
+}
+##########################################################################
+open_compose() {
+  if [ "${ALREADY_RUNNING}" -eq "1" ]; then
+	RUNS="$MOZ_CLIENT_PROGRAM xfeDoCommand(composeMessage)"
+  else
+	RUNS="$MOZ_PROGRAM $*"
+  fi
+}
+##########################################################################
+open_browser() {
+  # If there is no command line argument at all then try to open a new
+  # window in an already running instance.
+  if [ "${ALREADY_RUNNING}" -eq "1" ] && [ -z "$1" ]; then
+	RUNS="$MOZ_CLIENT_PROGRAM xfeDoCommand(openBrowser)"
+  fi
+
+  if [ "${ALREADY_RUNNING}" -eq "1" ] && [ -z "$RUNS" ]; then
+	echo $1 | grep -e '^-' 2>/dev/null > /dev/null
+	RETURN_VAL=$?
+	[ "${RETURN_VAL}" -eq "0" ] && RUNS="$prog ${1+"$@"}"
+
+	# check to make sure that the command contains at least a :/ in it.
+	if [ -z "$RUNS" ]; then
+	  echo $1 | grep -e ':/' 2>/dev/null > /dev/null
+	  RETURN_VAL=$?
+	  if [ "$RETURN_VAL" -eq "1" ]; then
+		# if it doesn't begin with a '/' and it exists when the pwd is
+		# prepended to it then append the full path
+		opt=$1
+		echo $opt | grep -e '^/' 2>/dev/null > /dev/null
+		RETURN_VAL=$?
+		if [ "${RETURN_VAL}" -ne "0" ] && [ -e "$(pwd)/$opt" ]; then
+		  opt="$(pwd)/$opt"
+		fi
+		RUNS="$MOZ_CLIENT_PROGRAM openurl($opt)"
+	  else
+		# just pass it off if it looks like a url
+		RUNS="$MOZ_CLIENT_PROGRAM openurl($1,new-tab)"
+	  fi
+	fi
+  fi
+}
+##########################################################################
 moz_run_program()
 {
 	prog=$MOZ_PROGRAM
@@ -191,7 +257,20 @@ moz_run_program()
 	##
 	## Run the program
 	##
-	"$prog" ${1+"$@"}
+	ALREADY_RUNNING=$(check_running)
+	RUNS=
+
+	if   [ "$1" = "-mail" ]; then
+	    open_mail ${1+"$@"}
+	elif [ "$1" = "-compose" ]; then
+	    open_compose ${1+"$@"}
+	else
+	    open_browser $*
+	fi
+
+	[ -n "$RUNS" ] || RUNS="$prog ${1+"$@"}"
+
+	$RUNS
 	exitcode=$?
 	if [ "$DEBUG_CORE_FILES" ]
 	then
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin