Update of /home/halls/cvs/debian-openoffice/oo-debian-files/bin
In directory gluck:/tmp/cvs-serv31628/bin

Modified Files:
        openoffice 
Log Message:
  * If setup fails, report error code to stderr 
  * Detect .lock that indicates that OOo is already running,
    and do not attempt to run setup if found (Closes: #241224) 
  * doc/README.Debian: Add advice about checking for lockd when using
    NFS filesystems 
  * debian/control: Update dependencies to require openoffice >> 1.1.1


Index: openoffice
===================================================================
RCS file: /home/halls/cvs/debian-openoffice/oo-debian-files/bin/openoffice,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- openoffice  16 Apr 2004 21:50:12 -0000      1.25
+++ openoffice  16 Apr 2004 21:51:37 -0000      1.26
@@ -143,6 +143,20 @@
   return 1
 }
 
+### get_lock_info <path-to-OOo-install>
+### return 0 if .lock file is not found
+### otherwise set LOCK_USER, LOCK_HOST and LOCK_FILE
+get_lock_info()
+{
+  LOCK_FILE="$1/.lock"
+  if [ -f "$LOCK_FILE" ]; then
+    LOCK_USER="$(sed -n '/^User=/ s///p' < "$LOCK_FILE")"
+    LOCK_USER="$(sed -n '/^Host=/ s///p' < "$LOCK_FILE")"
+    return 1
+  fi
+  return 0
+}
+
 ## OOo does not start if /proc is not mounted, so check for it
 if [ ! -f /proc/version ]; then
   echo "openoffice.org:  You must have a working /proc filesystem to use 
openoffice." >&2
@@ -207,6 +221,14 @@
 ## install OO for this user if needed
 ##
 if [ -z "$OOHOME" ] ; then
+  if ! get_lock_info "$OOHOME"; then
+    # We need to upgrade but OOo is already running
+    echo "Lockfile $LOCK_FILE found" >&2
+    echo "OpenOffice.org is already running as user $LOCK_USER on host 
$LOCK_HOST" >&2
+    echo "Please shut down all instances of soffice.bin and OOo quickstarter 
and try again">&2
+    exit 1
+  fi
+
   if [ -e /etc/openoffice${VER}/autoresponse.conf ] && \
     grep -q DESTINATIONPATH /etc/openoffice${VER}/autoresponse.conf ; then
     echo "OpenOffice.org for Debian - see 
/usr/share/doc/openoffice.org${VER}/README.Debian.gz"
@@ -219,9 +241,9 @@
       echo "upgrading openoffice.org user configuration..."
 
       if ! /usr/lib/openoffice${VER}/program/setup -nogui -R:$TMPFILE ; then
-        rm -f $TMPFILE
-        echo "setup failed.. abort" >&2
+        echo "setup failed (code $?).. abort" >&2
         echo "---- Please read 
/usr/share/doc/openoffice.org${VER}/README.Debian.gz for known problems -----" 
>&2
+        rm -f $TMPFILE
         exit 1
       fi
 
@@ -244,7 +266,7 @@
       echo "running openoffice.org setup..."
 
       if ! /usr/lib/openoffice${VER}/program/setup -nogui 
-R:/etc/openoffice${VER}/autoresponse.conf ; then
-        echo "setup failed.. abort" >&2
+        echo "setup failed (code $?).. abort" >&2
         echo "---- Please read 
/usr/share/doc/openoffice.org${VER}/README.Debian.gz for known problems -----" 
>&2
         exit 1
       fi
@@ -284,8 +306,14 @@
   esac
 fi
 
-## Change locale of OOo
-change_locale "$LOCALEOO"
+if ! get_lock_info "$OOHOME"; then
+  # OOo is already running
+  echo "OpenOffice.org lockfile found ($LOCK_FILE)"
+  echo "Using existing OpenOffice.org"
+else
+  ## Change locale of OOo
+  change_locale "$LOCALEOO"
+fi
 
 ##
 ## That's it. Launch the beast (with the given args)

Reply via email to