annotate lib-src/fix-perms.sh @ 5294:bbff29a01820

Add compiler macros and compilation sanity-checks for functions with keywords. 2010-10-25 Aidan Kehoe <kehoea@parhasard.net> Add compiler macros and compilation sanity-checking for various functions that take keywords. * byte-optimize.el (side-effect-free-fns): #'symbol-value is side-effect free and not error free. * bytecomp.el (byte-compile-normal-call): Check keyword argument lists for sanity; store information about the positions where keyword arguments start using the new byte-compile-keyword-start property. * cl-macs.el (cl-const-expr-val): Take a new optional argument, cl-not-constant, defaulting to nil, in this function; return it if the expression is not constant. (cl-non-fixnum-number-p): Make this into a separate function, we want to pass it to #'every. (eql): Use it. (define-star-compiler-macros): Use the same code to generate the member*, assoc* and rassoc* compiler macros; special-case some code in #'add-to-list in subr.el. (remove, remq): Add compiler macros for these two functions, in preparation for #'remove being in C. (define-foo-if-compiler-macros): Transform (remove-if-not ...) calls to (remove ... :if-not) at compile time, which will be a real win once the latter is in C. (define-substitute-if-compiler-macros) (define-subst-if-compiler-macros): Similarly for these functions. (delete-duplicates): Change this compiler macro to use #'plists-equal; if we don't have information about the type of SEQUENCE at compile time, don't bother attempting to inline the call, the function will be in C soon enough. (equalp): Remove an old commented-out compiler macro for this, if we want to see it it's in version control. (subst-char-in-string): Transform this to a call to nsubstitute or nsubstitute, if that is appropriate. * cl.el (ldiff): Don't call setf here, this makes for a load-time dependency problem in cl-macs.el
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 25 Oct 2010 13:04:04 +0100
parents 4faad22a9fe5
children 308d34e9f07d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4947
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
1 #!/bin/sh
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
2 ### fix-perms.sh --- Correct the permissions on XEmacs source/build files
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
3
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
4 # Copyright (C) 2010 Ben Wing.
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
5
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
6 # Author: Ben Wing
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
7 # Keywords: internal
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
8
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
9 # This file is part of XEmacs.
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
10
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
11 # XEmacs is free software; you can redistribute it and/or modify it
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
12 # under the terms of the GNU General Public License as published by
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
13 # the Free Software Foundation; either version 2, or (at your option)
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
14 # any later version.
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
15
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
16 # XEmacs is distributed in the hope that it will be useful, but
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
19 # General Public License for more details.
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
20
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
21 # You should have received a copy of the GNU General Public License
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
22 # along with XEmacs; see the file COPYING. If not, write to
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
23 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
24 # Boston, MA 02111-1307, USA.
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
25
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
26 ### Commentary:
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
27
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
28 # This program sets the executable bit on all scripts and executable files
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
29 # in the XEmacs source tree, including those that are built.
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
30
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
31 ### Code:
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
32
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
33 # List of executable source files in various directories (root, lib-src, etc)
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
34 # other than .sh files. Note that we are free to list files in
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
35 # subdirectories here rather than creating a separate item list"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
36 ROOT_EXES="configure config.guess install-sh move-if-change \
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
37 modules/canna/configure"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
38 LIB_SRC_EXES="ad2c gnuattach gnudoit rcs2log vcdiff *.pl"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
39 ETC_EXES=""
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
40
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
41 LIB_SRC_BUILT_EXES="`cd lib-src; ls -1 *.c | sed 's/\.c$//g'`"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
42 LIB_SRC_BUILT_EXES="minitar ctags $LIB_SRC_BUILT_EXES"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
43 SRC_BUILT_EXES="temacs xemacs"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
44
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
45 find . -type f -print0 | xargs -0 chmod a-x
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
46
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
47 for dir in . lib-src etc ; do
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
48 if [ "$dir" = "." ]; then
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
49 exes="$ROOT_EXES"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
50 elif [ "$dir" = "lib-src" ]; then
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
51 exes="$LIB_SRC_EXES"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
52 elif [ "$dir" = "etc" ]; then
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
53 exes="$ETC_EXES"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
54 else
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
55 echo "Error! Don't know how to handle directory '$dir'"; exit 2
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
56 fi
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
57 pwd=`pwd`
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
58 cd $dir
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
59 for x in $exes *.sh ; do
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
60 if [ ! -f $x ]; then
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
61 echo "Warning: file '$dir/$x' doesn't exist"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
62 else
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
63 chmod a+x $x
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
64 fi
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
65 done
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
66 cd "$pwd"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
67 done
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
68
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
69 # Now do the built executables. Don't warn or anything if we don't find
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
70 # anything, since they may not be built.
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
71 for dir in lib-src src ; do
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
72 if [ "$dir" = "src" ]; then
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
73 exes="$SRC_BUILT_EXES"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
74 elif [ "$dir" = "lib-src" ]; then
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
75 exes="$LIB_SRC_BUILT_EXES"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
76 else
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
77 echo "Error! Don't know how to handle directory '$dir'"; exit 2
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
78 fi
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
79 pwd=`pwd`
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
80 cd $dir
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
81 for x in $exes *.exe ; do
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
82 if [ -f $x ]; then
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
83 chmod a+x $x
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
84 fi
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
85 done
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
86 cd "$pwd"
4faad22a9fe5 Somehow fix-perms.sh didn't get committed
Ben Wing <ben@xemacs.org>
parents:
diff changeset
87 done