[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: upgrading emacs when emacs is still running

On 2011-10-20 01:20 +0200, jidanni@jidanni.org wrote:

> Every time on Debian I use aptitude to
> The following packages will be upgraded:
>   emacs-snapshot  emacs-snapshot-bin-common (for emacs-snapshot)
>   emacs-snapshot-common (for emacs-snapshot, emacs-snapshot-el)
>   emacs-snapshot-el
> I have to remember to exit any running emacs sessions first, lest
> later encountering problems when old emacs reads new .elcs, etc.
> Updating Firefox never has such problems.
> OK, hard to work around, also too much fuss to put warnings into the
> Debian update script: "a running emacs session was detected, proceed?"

FWIW, there used to be one, but it was removed in the 20080613 snapshot:

$ git show 241c879e25
commit 241c879e25b8b40dbff3871277c911c1b8a333eb
Author: Romain Francoise <romain@orebokech.com>
Date:   Fri Jun 13 19:24:40 2008 +0200

    Drop check for running emacsen in preinst
    lsof hangs if the system has unreachable NFS mounts, which happens more
    often than one may think.  As this prevents installation of the package,
    a rather grave bug, let's drop the check instead of trying to tune
    lsof's parameters.

diff --git a/emacs.preinst b/emacs.preinst
old mode 100644
new mode 100755
index e92f3c8..f059cf8
--- a/emacs.preinst
+++ b/emacs.preinst
@@ -8,21 +8,6 @@ if [ "$1" = "upgrade" ] && \
     update-alternatives --remove emacs /usr/bin/@BIN_NAME@-@X_SUPPORT@
-# If lsof is installed, look for running Emacsen.  If any are found,
-# warn the user that changing Emacs's files from under it isn't safe...
-# We don't bother trying to find processes if lsof isn't installed;
-# using pgrep or something similar would turn up false positives.
-if [ -f $F ] && [ -x /usr/bin/lsof ]; then
-    PIDS=`lsof -F p $F 2>/dev/null | wc -l || true`
-    if [ $PIDS -ne 0 ]; then
-	[ $PIDS -ge 2 ] && S="es"
-	printf "%d %s process%s found\n" $PIDS `basename $F` "$S"
-	echo "NOTE: closing all running Emacsen before upgrading" \
-	    "is strongly recommended!"
-    fi
 exit 0


Reply to: