summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2008-11-01 10:01:51 +0000
committerUlrich Müller <ulm@gentoo.org>2008-11-01 10:01:51 +0000
commita610243b11ac724f1becb596c040b5a542768a31 (patch)
tree46eb1f788ec4a2d0814bfa80e495e0a22ad764e0
parentUse --quiet option for start-stop-daemon. (diff)
downloademacs-a610243b11ac724f1becb596c040b5a542768a31.tar.gz
emacs-a610243b11ac724f1becb596c040b5a542768a31.tar.bz2
emacs-a610243b11ac724f1becb596c040b5a542768a31.zip
Pidfile support.
svn path=/emacs-overlay/; revision=1192
-rw-r--r--app-editors/emacs-cvs/ChangeLog4
-rw-r--r--app-editors/emacs-cvs/Manifest5
-rw-r--r--app-editors/emacs-cvs/emacs-cvs-23.0.9999-r1.ebuild (renamed from app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild)3
-rw-r--r--app-editors/emacs-cvs/files/emacs-cvs-pidfile.patch76
4 files changed, 86 insertions, 2 deletions
diff --git a/app-editors/emacs-cvs/ChangeLog b/app-editors/emacs-cvs/ChangeLog
index 32cd8b1..302a365 100644
--- a/app-editors/emacs-cvs/ChangeLog
+++ b/app-editors/emacs-cvs/ChangeLog
@@ -2,6 +2,10 @@
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 01 Nov 2008; Ulrich Mueller <ulm@gentoo.org> +files/emacs-cvs-pidfile.patch,
+ -emacs-cvs-23.0.9999.ebuild, +emacs-cvs-23.0.9999-r1.ebuild:
+ Pidfile support.
+
29 Oct 2008; Ulrich Mueller <ulm@gentoo.org> -files/emacs-daemon.conf,
-files/emacs-daemon.rc, metadata.xml, emacs-cvs-23.0.9999.ebuild:
Move daemon support to app-emacs/emacs-daemon to avoid SLOT collisions.
diff --git a/app-editors/emacs-cvs/Manifest b/app-editors/emacs-cvs/Manifest
index 3fa8222..82b3ea4 100644
--- a/app-editors/emacs-cvs/Manifest
+++ b/app-editors/emacs-cvs/Manifest
@@ -1,4 +1,5 @@
AUX emacs-cvs-freebsd-sparc-1.patch 448 RMD160 4f131b630ec09e1d9170374fc60a1620f0f718e9 SHA1 5bc71be91bb8008cec2473479184e250e5284c68 SHA256 e2c2e53e2995d4a505c480d17e0a7e5abff61ea96c4d3451a1e019c985a59cd8
-EBUILD emacs-cvs-23.0.9999.ebuild 8382 RMD160 3587ee2fa54df88b9d98be1e889e8353fb3db6a2 SHA1 496b4f699c11b144e52ed5f2a2af12202f70648a SHA256 e247105dcf4e1b7a3fdca0fa9006ef8ceba410db0ea1d144bc82e545966000da
-MISC ChangeLog 722 RMD160 ceed3d991a477b1d9010af8a254e3209921213b6 SHA1 b726f3cbaea03b9bc8acd655bf1789deadb30d0f SHA256 56bbb8da895d494d1dafda3aa75ff0e36d23f59e0660d041a477b79bc3846247
+AUX emacs-cvs-pidfile.patch 2418 RMD160 3700958321def7b143ed01610e1f8ad5cd3437f4 SHA1 9f0f0350fed330e8daaa41785a753507aeca0edb SHA256 301777a2835f681fa7ba7ec194f9c6148dacbb517a9954f11be3d7d8e50c9013
+EBUILD emacs-cvs-23.0.9999-r1.ebuild 8481 RMD160 a06bf80224cda22af3c87d25340caf29d466fea0 SHA1 28dc3f74b84dad1d4c3e80f4f6d7e5a0b1a46006 SHA256 089ba311ae886ce29d9d3b9e8925fe6c4916969fc6a4a2078dbadc028d9c240d
+MISC ChangeLog 884 RMD160 98d761126f86f1bdffb83ea1d17ea78bb394ca6d SHA1 65e61da66b638c744a1891352c22e92453b890fc SHA256 250abb36974031fe52d962a9507d1548ee488aa4973ed29d69fec521e66c8a76
MISC metadata.xml 1606 RMD160 f898da13dfc3bdb1636e9ff7bc241997d235498b SHA1 2dea9901bc80a1d91f38628707395d9b4ef0df70 SHA256 f4df95b7db6f7b3375bdd658024520a03a763e75f4ca846ab494609f6094c9bd
diff --git a/app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild b/app-editors/emacs-cvs/emacs-cvs-23.0.9999-r1.ebuild
index c53896c..05b45cc 100644
--- a/app-editors/emacs-cvs/emacs-cvs-23.0.9999.ebuild
+++ b/app-editors/emacs-cvs/emacs-cvs-23.0.9999-r1.ebuild
@@ -87,6 +87,9 @@ src_unpack() {
epatch "${FILESDIR}/${PN}-freebsd-sparc-1.patch"
+ # support creating a pid file when running as a daemon
+ epatch "${FILESDIR}/${PN}-pidfile.patch"
+
sed -i -e "s:/usr/lib/crtbegin.o:$(`tc-getCC` -print-file-name=crtbegin.o):g" \
-e "s:/usr/lib/crtend.o:$(`tc-getCC` -print-file-name=crtend.o):g" \
"${S}"/src/s/freebsd.h || die "unable to sed freebsd.h settings"
diff --git a/app-editors/emacs-cvs/files/emacs-cvs-pidfile.patch b/app-editors/emacs-cvs/files/emacs-cvs-pidfile.patch
new file mode 100644
index 0000000..ed2f1c9
--- /dev/null
+++ b/app-editors/emacs-cvs/files/emacs-cvs-pidfile.patch
@@ -0,0 +1,76 @@
+2008-10-31 Ulrich Mueller <ulm@kph.uni-mainz.de>
+
+ * emacs.c (pid_file): New variable.
+ (main): Save process id of child in file pid_file.
+ (shut_down_emacs): Unlink pid_file.
+ (standard_args, USAGE1): Add --pidfile.
+
+--- emacs-orig/src/emacs.c 29 Oct 2008 18:03:03 -0000 1.454
++++ emacs/src/emacs.c 31 Oct 2008 17:08:19 -0000
+@@ -242,6 +242,9 @@
+ startup. */
+ int daemon_pipe[2];
+
++/* Name of the file where the daemon's process id is saved. */
++static char *pid_file;
++
+ /* Save argv and argc. */
+ char **initial_argv;
+ int initial_argc;
+@@ -274,6 +277,7 @@
+ --no-site-file do not load site-start.el\n\
+ --no-splash do not display a splash screen on startup\n\
+ --no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\
++--pidfile FILE save process id in FILE; only with --daemon\n\
+ --quick, -Q equivalent to -q --no-site-file --no-splash\n\
+ --script FILE run FILE as an Emacs Lisp script\n\
+ --terminal, -t DEVICE use DEVICE for terminal I/O\n\
+@@ -1080,6 +1084,7 @@
+ {
+ #ifndef DOS_NT
+ pid_t f;
++ char *pfile_arg = NULL;
+
+ /* Start as a daemon: fork a new child process which will run the
+ rest of the initialization code, then exit.
+@@ -1146,6 +1151,20 @@
+ #ifdef HAVE_SETSID
+ setsid();
+ #endif
++ if (argmatch (argv, argc, "-pidfile", "--pidfile", 5,
++ &pfile_arg, &skip_args))
++ {
++ FILE *fp;
++ pid_file = xstrdup (pfile_arg);
++ if (!(fp = fopen (pid_file, "w")))
++ {
++ fprintf (stderr, "Cannot create pid file %s: %s\n",
++ pid_file, strerror (errno));
++ exit (1);
++ }
++ fprintf (fp, "%ld\n", (long) getpid ());
++ fclose (fp);
++ }
+ #else /* DOS_NT */
+ fprintf (stderr, "This platform does not support the -daemon flag.\n");
+ exit (1);
+@@ -1804,6 +1823,7 @@
+ { "-batch", "--batch", 100, 0 },
+ { "-script", "--script", 100, 1 },
+ { "-daemon", "--daemon", 99, 0 },
++ { "-pidfile", "--pidfile", 98, 1 },
+ { "-help", "--help", 90, 0 },
+ { "-no-unibyte", "--no-unibyte", 83, 0 },
+ { "-multibyte", "--multibyte", 82, 0 },
+@@ -2155,6 +2175,11 @@
+ #endif /* HAVE_X_WINDOWS */
+ #endif
+
++#ifndef DOS_NT
++ if (pid_file)
++ unlink (pid_file);
++#endif
++
+ #ifdef SIGIO
+ /* There is a tendency for a SIGIO signal to arrive within exit,
+ and cause a SIGHUP because the input descriptor is already closed. */