author | Wolfgang Rosenauer <wr@rosenauer.org> |
Sun, 27 Aug 2023 10:23:20 +0200 | |
branch | firefox116 |
changeset 1192 | 7612b8d8c46f |
parent 1171 | 130d464159be |
permissions | -rw-r--r-- |
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
1 |
#!/bin/sh |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
2 |
# |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
3 |
# ***** BEGIN LICENSE BLOCK ***** |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
4 |
# Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
5 |
# |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
6 |
# The contents of this file are subject to the Mozilla Public License Version |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
7 |
# 1.1 (the "License"); you may not use this file except in compliance with |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
8 |
# the License. You may obtain a copy of the License at |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
9 |
# http://www.mozilla.org/MPL/ |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
10 |
# |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
11 |
# Software distributed under the License is distributed on an "AS IS" basis, |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
12 |
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
13 |
# for the specific language governing rights and limitations under the |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
14 |
# License. |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
15 |
# |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
16 |
# The Original Code is mozilla.org Code. |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
17 |
# |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
18 |
# The Initial Developer of the Original Code is |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
19 |
# Netscape Communications Corporation. |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
20 |
# Portions created by the Initial Developer are Copyright (C) 1998 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
21 |
# the Initial Developer. All Rights Reserved. |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
22 |
# |
212
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
23 |
# Contributor(s): |
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
24 |
# Wolfgang Rosenauer <wolfgang.rosenauer@suse.de> |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
25 |
# <wr@rosenauer.org> |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
26 |
# |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
27 |
# Alternatively, the contents of this file may be used under the terms of |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
28 |
# either the GNU General Public License Version 2 or later (the "GPL"), or |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
29 |
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
30 |
# in which case the provisions of the GPL or the LGPL are applicable instead |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
31 |
# of those above. If you wish to allow use of your version of this file only |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
32 |
# under the terms of either the GPL or the LGPL, and not to allow others to |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
33 |
# use your version of this file under the terms of the MPL, indicate your |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
34 |
# decision by deleting the provisions above and replace them with the notice |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
35 |
# and other provisions required by the GPL or the LGPL. If you do not delete |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
36 |
# the provisions above, a recipient may use your version of this file under |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
37 |
# the terms of any one of the MPL, the GPL or the LGPL. |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
38 |
# |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
39 |
# ***** END LICENSE BLOCK ***** |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
40 |
|
212
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
41 |
## |
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
42 |
## Usage: |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
43 |
## |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
44 |
## $ mozilla [args] |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
45 |
## |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
46 |
## This script is meant to run a mozilla program from the mozilla |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
47 |
## rpm installation. |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
48 |
## |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
49 |
## The script will setup all the environment voodoo needed to make |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
50 |
## mozilla work. |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
51 |
|
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
52 |
cmdname=`basename $0` |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
53 |
|
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
54 |
## |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
55 |
## Variables |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
56 |
## |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
57 |
MOZ_DIST_BIN="%PREFIX" |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
58 |
MOZ_DIST_LIB="%PROGDIR" |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
59 |
MOZ_APPNAME="%APPNAME" |
502
ba1be580e369
start firefox (not firefox-bin) anymore as it's the same binary anyway
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
465
diff
changeset
|
60 |
MOZ_PROGRAM="$MOZ_DIST_LIB/$MOZ_APPNAME" |
1138 | 61 |
MOZ_LANGPACKS_DIR="$MOZ_DIST_LIB/langpacks" |
62 |
MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" |
|
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
63 |
|
212
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
64 |
MOZ_APP_LAUNCHER="$MOZ_DIST_LIB/$MOZ_APPNAME.sh" |
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
65 |
if [ "$0" = "$MOZ_APP_LAUNCHER" ]; then |
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
66 |
[ -h "/usr/bin/$MOZ_APPNAME" ] && \ |
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
67 |
_link=$(readlink -f "/usr/bin/$MOZ_APPNAME") |
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
68 |
if [ "$_link" = "$MOZ_APP_LAUNCHER" ]; then |
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
69 |
export MOZ_APP_LAUNCHER="/usr/bin/$MOZ_APPNAME" |
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
70 |
fi |
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
71 |
else |
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
72 |
export MOZ_APP_LAUNCHER="/usr/bin/$MOZ_APPNAME" |
f25759227036
put some more logic into MOZ_APP_LAUNCHER setting
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
5
diff
changeset
|
73 |
fi |
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
74 |
|
264
73231d44ef1f
fix startscript for non standalone glue
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
212
diff
changeset
|
75 |
MOZILLA_FIVE_HOME="$MOZ_DIST_LIB" |
73231d44ef1f
fix startscript for non standalone glue
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
212
diff
changeset
|
76 |
export MOZILLA_FIVE_HOME |
73231d44ef1f
fix startscript for non standalone glue
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
212
diff
changeset
|
77 |
LD_LIBRARY_PATH=$MOZ_DIST_LIB${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} |
73231d44ef1f
fix startscript for non standalone glue
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
212
diff
changeset
|
78 |
export LD_LIBRARY_PATH |
73231d44ef1f
fix startscript for non standalone glue
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
212
diff
changeset
|
79 |
|
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
80 |
# needed for SUN Java under Xorg >= 7.2 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
81 |
export LIBXCB_ALLOW_SLOPPY_LOCK=1 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
82 |
|
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
83 |
# disable Gnome crash dialog (doesn't make sense anyway) |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
84 |
export GNOME_DISABLE_CRASH_DIALOG=1 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
85 |
|
1122 | 86 |
# Wayland |
1157 | 87 |
# Only supported on newer systems |
88 |
WAYLAND_SUPPORTED=%WAYLAND_SUPPORTED |
|
89 |
||
1122 | 90 |
# $XDG_SESSION_TYPE should contain either x11 or wayland |
1163
849d6343405b
latest 92.0.1 version
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1157
diff
changeset
|
91 |
if [ $WAYLAND_SUPPORTED -eq 1 ] && [ "$XDG_SESSION_TYPE" = "wayland" ] && [ -z "$MOZ_ENABLE_WAYLAND" ]; then |
1122 | 92 |
export MOZ_ENABLE_WAYLAND=1 |
93 |
fi |
|
94 |
||
1138 | 95 |
## |
96 |
## Use D-Bus remote exclusively when there's Wayland display. |
|
97 |
## |
|
98 |
if [ "$WAYLAND_DISPLAY" ]; then |
|
99 |
export MOZ_DBUS_REMOTE=1 |
|
100 |
fi |
|
101 |
||
102 |
# xinput2 (boo#1173320) |
|
1171 | 103 |
. /etc/os-release |
1138 | 104 |
if [ "$ID" = "opensuse-tumbleweed" ]; then |
105 |
export MOZ_USE_XINPUT2=1 |
|
106 |
fi |
|
107 |
||
108 |
## |
|
109 |
## To disable the use of Firefox localization handling for |
|
110 |
## the home profile, set MOZ_DISABLE_LANGPACKS=1 |
|
111 |
## in your environment before launching Firefox. |
|
112 |
## currently disabled by default since langpacks |
|
113 |
## are shipped as app sideloading addons |
|
114 |
## |
|
115 |
# |
|
116 |
MOZ_DISABLE_LANGPACKS=1 |
|
117 |
export MOZ_DISABLE_LANGPACKS |
|
118 |
# |
|
119 |
||
120 |
## |
|
121 |
## Automatically installed langpacks are tracked by .suse-langpack-install |
|
122 |
## config file. |
|
123 |
## |
|
124 |
SUSE_LANGPACK_CONFIG="$MOZ_EXTENSIONS_PROFILE_DIR/.suse-langpack-install" |
|
125 |
||
126 |
# MOZ_DISABLE_LANGPACKS disables language packs completely |
|
127 |
MOZILLA_DOWN=0 |
|
128 |
if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then |
|
129 |
if [ -x $MOZ_PROGRAM ]; then |
|
130 |
# Is firefox running? |
|
131 |
/bin/pidof %APPNAME% > /dev/null 2>&1 |
|
132 |
MOZILLA_DOWN=$? |
|
133 |
fi |
|
134 |
fi |
|
135 |
||
136 |
# Modify language pack configuration only when firefox is not running |
|
137 |
# and language packs are not disabled |
|
138 |
if [ $MOZILLA_DOWN -ne 0 ]; then |
|
139 |
# Clear already installed langpacks |
|
140 |
mkdir -p $MOZ_EXTENSIONS_PROFILE_DIR |
|
141 |
if [ -f $SUSE_LANGPACK_CONFIG ]; then |
|
142 |
rm `cat $SUSE_LANGPACK_CONFIG` > /dev/null 2>&1 |
|
143 |
rm $SUSE_LANGPACK_CONFIG > /dev/null 2>&1 |
|
144 |
# remove all empty langpacks dirs while they block installation of langpacks |
|
145 |
rmdir $MOZ_EXTENSIONS_PROFILE_DIR/langpack* > /dev/null 2>&1 |
|
146 |
fi |
|
147 |
# Get locale from system |
|
148 |
CURRENT_LOCALE=$LC_ALL |
|
149 |
CURRENT_LOCALE=${CURRENT_LOCALE:-$LC_MESSAGES} |
|
150 |
CURRENT_LOCALE=${CURRENT_LOCALE:-$LANG} |
|
151 |
# Try with a local variant first, then without a local variant |
|
152 |
SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g" | sed "s|\..*||g"` |
|
153 |
MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g" | sed "s|\..*||g"` |
|
1171 | 154 |
create_langpack_link() { |
1138 | 155 |
local language=$* |
156 |
local langpack=langpack-${language}@firefox.mozilla.org.xpi |
|
157 |
if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then |
|
158 |
rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack |
|
159 |
# If the target file is a symlink (the fallback langpack), |
|
160 |
# install the original file instead of the fallback one |
|
161 |
if [ -h $MOZ_LANGPACKS_DIR/$langpack ]; then |
|
162 |
langpack=`readlink $MOZ_LANGPACKS_DIR/$langpack` |
|
163 |
fi |
|
164 |
ln -s $MOZ_LANGPACKS_DIR/$langpack \ |
|
165 |
$MOZ_EXTENSIONS_PROFILE_DIR/$langpack |
|
166 |
echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $SUSE_LANGPACK_CONFIG |
|
167 |
return 0 |
|
168 |
fi |
|
169 |
return 1 |
|
170 |
} |
|
171 |
create_langpack_link $MOZLOCALE || create_langpack_link $SHORTMOZLOCALE || true |
|
172 |
fi |
|
173 |
||
956 | 174 |
|
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
175 |
moz_debug=0 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
176 |
script_args="" |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
177 |
pass_arg_count=0 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
178 |
while [ $# -gt $pass_arg_count ] |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
179 |
do |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
180 |
case "$1" in |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
181 |
-d | --debugger) |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
182 |
moz_debugger=$2; |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
183 |
if [ "${moz_debugger}" != "" ]; then |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
184 |
shift 2 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
185 |
moz_debug=1 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
186 |
else |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
187 |
echo "-d requires an argument" |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
188 |
exit 1 |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
189 |
fi |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
190 |
;; |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
191 |
*) |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
192 |
# Move the unrecognized argument to the end of the list. |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
193 |
arg="$1" |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
194 |
shift |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
195 |
set -- "$@" "$arg" |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
196 |
pass_arg_count=`expr $pass_arg_count + 1` |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
197 |
;; |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
198 |
esac |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
199 |
done |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
200 |
|
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
201 |
if [ $moz_debug -eq 1 ]; then |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
202 |
tmpfile=`mktemp /tmp/mozargs.XXXXXX` || { echo "Cannot create temporary file" >&2; exit 1; } |
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
203 |
trap " [ -f \"$tmpfile\" ] && /bin/rm -f -- \"$tmpfile\"" 0 1 2 3 13 15 |
820 | 204 |
echo "set args ${1+"$@"}" > $tmpfile |
205 |
echo "run" >> $tmpfile |
|
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
206 |
echo "$moz_debugger $MOZ_PROGRAM -x $tmpfile" |
465
c49024069c9d
do not spawn a new shell but use exec (bnc#766006)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
392
diff
changeset
|
207 |
exec $moz_debugger "$MOZ_PROGRAM" -x $tmpfile |
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
208 |
else |
465
c49024069c9d
do not spawn a new shell but use exec (bnc#766006)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
392
diff
changeset
|
209 |
exec $MOZ_PROGRAM "$@" |
5
17b1dd932700
Add MozillaFirefox package
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff
changeset
|
210 |
fi |