]> code.delx.au - gnu-emacs/blob - update-subdirs
Convert consecutive FSF copyright years to ranges.
[gnu-emacs] / update-subdirs
1 #!/bin/sh
2 # Write into $1/subdirs.el a list of subdirs of directory $1.
3
4 # Copyright (C) 1994-1995, 1997, 1999, 2001-2011 Free Software Foundation, Inc.
5
6 # This file is part of GNU Emacs.
7
8 # GNU Emacs is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12
13 # GNU Emacs is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
20
21
22 cd $1
23 for file in *; do
24 case $file in
25 *.elc | *.el | term | RCS | CVS | Old | . | .. | =* | *~ | *.orig | *.rej)
26 ;;
27 *)
28 if [ -d $file ]; then
29 if [ "$file" = "obsolete" ]; then
30 subdirs="$subdirs \"$file\""
31 else
32 subdirs="\"$file\" $subdirs"
33 fi
34 fi
35 ;;
36 esac
37 done
38
39 if [ "x$subdirs" = x ]; then
40 rm -f subdirs.el
41 else
42 rm -f subdirs.el~
43 echo ";; -*- no-byte-compile: t -*-
44 ;; In load-path, after this directory should come
45 ;; certain of its subdirectories. Here we specify them.
46 (normal-top-level-add-to-load-path '($subdirs))
47 ;; Local" "Variables:
48 ;; version-control: never
49 ;; no-byte-compile: t
50 ;; End:" > subdirs.el~
51 if cmp "subdirs.el" "subdirs.el~" >/dev/null 2>&1; then
52 :; # echo "subdirs.el unchanged";
53 else
54 mv subdirs.el~ subdirs.el
55 fi
56 fi