r1765 - /unstable/evolution/debian/evolution.preinst

corsac at users.alioth.debian.org corsac at users.alioth.debian.org
Tue Oct 12 05:36:28 UTC 2010


Author: corsac
Date: Tue Oct 12 05:36:18 2010
New Revision: 1765

URL: http://svn.debian.org/wsvn/pkg-evolution/?sc=1&rev=1765
Log:
update preinst to handle the “kill and continue” process

Modified:
    unstable/evolution/debian/evolution.preinst

Modified: unstable/evolution/debian/evolution.preinst
URL: http://svn.debian.org/wsvn/pkg-evolution/unstable/evolution/debian/evolution.preinst?rev=1765&op=diff
==============================================================================
--- unstable/evolution/debian/evolution.preinst (original)
+++ unstable/evolution/debian/evolution.preinst Tue Oct 12 05:36:18 2010
@@ -2,6 +2,7 @@
 set -e
 
 . /usr/share/debconf/confmodule
+EVO_PROCESS="'evolution|/usr/lib/evolution/.*/evolution-exchange-storage|/usr/lib/evolution/evolution-data-server-.*'"
 
 error_msg() {
   db_title Upgrading evolution
@@ -10,20 +11,37 @@
   db_go
 }
 
-end() {
+end_msg() {
   db_title Evolution processes still present
   db_input high evolution/kill_processes || true
 }
 
 upgrade_check() {
   seen=0
-  while pgrep -fx 'evolution|/usr/lib/evolution/.*/evolution-exchange-storage|/usr/lib/evolution/evolution-data-server-.*' > /dev/null; do
+  while pgrep -fx ${EVO_PROCESS} > /dev/null; do
     error_msg
     seen=$(($seen + 1))
     if [ $seen = 3 ]; then
-      db_stop
-      echo "Evolution is still running, aborting..."
-      exit 1
+      end_msg
+      db_get evolution/kill_processes
+      if [ "$RET" = "Abort" ];
+      then
+        db_stop
+        echo "Evolution is still running, aborting..."
+        exit 1
+      else
+        # proceed with the upgrade, try to kill any remaining evolution process
+        # before
+        db_stop
+        echo "Evolution is still running but proceeding with the upgrade..." 
+        pkill -fx ${EVO_PROCESS} > /dev/null
+      fi
+    fi
+    if [ $seen = 4 ]; then
+      # means we choose to proceed and tried to kill evo process but failed for
+      # some reason. Try harder, then continue anyway
+      pkill -9 -fx ${EVO_PROCESS} > /dev/null
+      return
     fi
   done
 




More information about the pkg-evolution-commits mailing list