comparison lib-src/fix-perms.sh @ 4947:4faad22a9fe5

Somehow fix-perms.sh didn't get committed
author Ben Wing <ben@xemacs.org>
date Mon, 25 Jan 2010 02:48:52 -0600
parents
children 308d34e9f07d
comparison
equal deleted inserted replaced
4946:9b5d4b35f8d7 4947:4faad22a9fe5
1 #!/bin/sh
2 ### fix-perms.sh --- Correct the permissions on XEmacs source/build files
3
4 # Copyright (C) 2010 Ben Wing.
5
6 # Author: Ben Wing
7 # Keywords: internal
8
9 # This file is part of XEmacs.
10
11 # XEmacs is free software; you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2, or (at your option)
14 # any later version.
15
16 # XEmacs is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
20
21 # You should have received a copy of the GNU General Public License
22 # along with XEmacs; see the file COPYING. If not, write to
23 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 # Boston, MA 02111-1307, USA.
25
26 ### Commentary:
27
28 # This program sets the executable bit on all scripts and executable files
29 # in the XEmacs source tree, including those that are built.
30
31 ### Code:
32
33 # List of executable source files in various directories (root, lib-src, etc)
34 # other than .sh files. Note that we are free to list files in
35 # subdirectories here rather than creating a separate item list"
36 ROOT_EXES="configure config.guess install-sh move-if-change \
37 modules/canna/configure"
38 LIB_SRC_EXES="ad2c gnuattach gnudoit rcs2log vcdiff *.pl"
39 ETC_EXES=""
40
41 LIB_SRC_BUILT_EXES="`cd lib-src; ls -1 *.c | sed 's/\.c$//g'`"
42 LIB_SRC_BUILT_EXES="minitar ctags $LIB_SRC_BUILT_EXES"
43 SRC_BUILT_EXES="temacs xemacs"
44
45 find . -type f -print0 | xargs -0 chmod a-x
46
47 for dir in . lib-src etc ; do
48 if [ "$dir" = "." ]; then
49 exes="$ROOT_EXES"
50 elif [ "$dir" = "lib-src" ]; then
51 exes="$LIB_SRC_EXES"
52 elif [ "$dir" = "etc" ]; then
53 exes="$ETC_EXES"
54 else
55 echo "Error! Don't know how to handle directory '$dir'"; exit 2
56 fi
57 pwd=`pwd`
58 cd $dir
59 for x in $exes *.sh ; do
60 if [ ! -f $x ]; then
61 echo "Warning: file '$dir/$x' doesn't exist"
62 else
63 chmod a+x $x
64 fi
65 done
66 cd "$pwd"
67 done
68
69 # Now do the built executables. Don't warn or anything if we don't find
70 # anything, since they may not be built.
71 for dir in lib-src src ; do
72 if [ "$dir" = "src" ]; then
73 exes="$SRC_BUILT_EXES"
74 elif [ "$dir" = "lib-src" ]; then
75 exes="$LIB_SRC_BUILT_EXES"
76 else
77 echo "Error! Don't know how to handle directory '$dir'"; exit 2
78 fi
79 pwd=`pwd`
80 cd $dir
81 for x in $exes *.exe ; do
82 if [ -f $x ]; then
83 chmod a+x $x
84 fi
85 done
86 cd "$pwd"
87 done