annotate lisp/blessmail.el @ 2456:f4e405a9d18d

[xemacs-hg @ 2004-12-27 12:25:14 by michaels] 2004-12-18 Mike Sperber <mike@xemacs.org> * package-admin.el: * startup.el: Reflect the changes made in packages.el. * packages.el: * loadup.el: * make-docfile.el: * package-admin.el: * startup.el: * update-elc.el (early-package-hierarchies) (late-package-hierarchies) (last-package-hierarchies): Renamed these from `early-packages', `late-packages' and `last-packages'. * packages.el: Rewrote package-finding logic to separate the concepts of "package directories" and "package hierarchies". Added explanation of these concepts. * setup-paths.el: * find-paths.el: Added parameter descriptions to some of the docstrings. * packages.el, setup-paths.el: Make terminology more explicit about "package hierarchies" * startup.el (emacs-roots, emacs-data-roots) (user-init-directory-base, user-init-directory) (user-init-file-base, user-init-file-base-list) (user-home-init-file-base-list) (load-home-init-file, load-user-init-file-p) (startup-find-load-path, startup-setup-paths) (startup-find-load-path-for-packages): Moved these back from setup-paths.el where they belong---setup-paths.el now again, as documented, contains no code that sets global variables. (They were moved from startup.el to setup-paths.el on 2003-02-28.) Clarify that in the comment at the top. * setup-paths.el (paths-find-emacs-roots): Restored `invocation-directory' 'invocation-name' parameters removed on 2003-02-28; they're useful for debugging.
author michaels
date Mon, 27 Dec 2004 12:27:05 +0000
parents d44af0c54775
children 308d34e9f07d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
217
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
1 ;;; blessmail.el --- Decide whether movemail needs special privileges.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
2
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
3 ;; Copyright (C) 1994 Free Software Foundation, Inc.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
4
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
5 ;; Maintainer: FSF
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
6 ;; Keywords: internal
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
7
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
9
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify it
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
11 ;; under the terms of the GNU General Public License as published by
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
13 ;; any later version.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
14
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
18 ;; General Public License for more details.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
19
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
23 ;; 02111-1307, USA.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
24
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
25 ;;; Synched up with: FSF 19.34.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
26
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
27 ;;; Commentary:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
28
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
29 ;; This is loaded into a bare Emacs to create the blessmail script,
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
30 ;; which (on systems that need it) is used during installation
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
31 ;; to give appropriate permissions to movemail.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
32 ;;
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
33 ;; It has to be done from lisp in order to be sure of getting the
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
34 ;; correct value of rmail-spool-directory.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
35
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
36 ;;; Code:
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
37
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
38 ;; These are no longer needed because we run this in emacs instead of temacs.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
39 ;; (message "Using load-path %s" load-path)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
40 ;; (load "paths.el")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
41 ;; It is not safe to load site-init.el here, because it might have things in it
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
42 ;; that won't load properly unless all the rest of Emacs is loaded.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
43
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
44 (let ((dirname (directory-file-name rmail-spool-directory))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
45 linkname attr modes)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
46 ;; Check for symbolic link
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
47 (while (setq linkname (file-symlink-p dirname))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
48 (setq dirname (if (file-name-absolute-p linkname)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
49 linkname
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
50 (concat (file-name-directory dirname) linkname))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
51 (insert "#!/bin/sh\n")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
52 (setq attr (file-attributes dirname))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
53 (if (not (eq t (car attr)))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
54 (insert (format "echo %s is not a directory\n" rmail-spool-directory))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
55 (setq modes (nth 8 attr))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
56 (cond ((= ?w (aref modes 8))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
57 ;; Nothing needs to be done.
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
58 )
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
59 ((= ?w (aref modes 5))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
60 (insert "chgrp " (number-to-string (nth 3 attr))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
61 " $* && chmod g+s $*\n"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
62 ((= ?w (aref modes 2))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
63 (insert "chown " (number-to-string (nth 2 attr))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
64 " $* && chmod u+s $*\n"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
65 (t
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
66 (insert "chown root $* && chmod u+s $*\n"))))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
67 (insert "echo mail directory = " dirname "\n"))
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
68 (write-region (point-min) (point-max) "blessmail")
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
69 (kill-emacs)
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
70
d44af0c54775 Import from CVS: tag r20-4b7
cvs
parents:
diff changeset
71 ;;; blessmail.el ends here