Revision 21768,
1.1 KB
checked in by rbasch, 20 years ago
(diff) |
Add build-registries.sh, a script to be used by package post-install
scripts to build the xpcom and chrome registries.
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | |
---|
3 | # $Id: build-registries.sh,v 1.1 2005-04-19 15:44:58 rbasch Exp $ |
---|
4 | |
---|
5 | # Build the xpcom and chrome registries for Firefox. |
---|
6 | |
---|
7 | MOZILLA_FIVE_HOME=/usr/athena/lib/firefox |
---|
8 | LD_LIBRARY_PATH=$MOZILLA_FIVE_HOME${LD_LIBRARY_PATH:+":$LD_LIBRARY_PATH"} |
---|
9 | export MOZILLA_FIVE_HOME LD_LIBRARY_PATH |
---|
10 | |
---|
11 | umask 022 |
---|
12 | |
---|
13 | # Run a command, and wait up to a minute for it to complete. |
---|
14 | timeout=60 |
---|
15 | run_with_timeout() { |
---|
16 | cmd="$@" |
---|
17 | $cmd & |
---|
18 | child=$! |
---|
19 | count=0 |
---|
20 | while kill -0 $child 2>/dev/null ; do |
---|
21 | count=`expr $count + 1` |
---|
22 | if [ $count -gt $timeout ]; then |
---|
23 | echo "$cmd timed out" 1>&2 |
---|
24 | kill -9 $child 2>/dev/null |
---|
25 | break |
---|
26 | fi |
---|
27 | sleep 1 |
---|
28 | done |
---|
29 | } |
---|
30 | |
---|
31 | if [ -x "$MOZILLA_FIVE_HOME/regxpcom" ]; then |
---|
32 | # Remove any previously generated files. |
---|
33 | rm -rf $MOZILLA_FIVE_HOME/chrome/overlayinfo |
---|
34 | rm -f $MOZILLA_FIVE_HOME/chrome/*.rdf |
---|
35 | rm -f $MOZILLA_FIVE_HOME/components/compreg.dat |
---|
36 | rm -f $MOZILLA_FIVE_HOME/components/xpti.dat |
---|
37 | |
---|
38 | mkdir "$MOZILLA_FIVE_HOME/chrome/overlayinfo" || exit 1 |
---|
39 | |
---|
40 | # Run regxpcom. |
---|
41 | run_with_timeout "$MOZILLA_FIVE_HOME/regxpcom" |
---|
42 | |
---|
43 | # Run regchrome. |
---|
44 | run_with_timeout "$MOZILLA_FIVE_HOME/regchrome" |
---|
45 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.