Mercurial > emacs
comparison make-dist @ 992:144a9a018e7c
*** empty log message ***
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Fri, 14 Aug 1992 17:44:31 +0000 |
parents | eca8812e61cd |
children | 5b2a1922c4d5 |
comparison
equal
deleted
inserted
replaced
991:13ec07cf910f | 992:144a9a018e7c |
---|---|
14 # Print out each line we read, for debugging's sake. | 14 # Print out each line we read, for debugging's sake. |
15 # set -v | 15 # set -v |
16 | 16 |
17 clean_up=yes | 17 clean_up=yes |
18 make_tar=yes | 18 make_tar=yes |
19 newer="" | |
19 | 20 |
20 while [ $# -gt 0 ]; do | 21 while [ $# -gt 0 ]; do |
21 case "$1" in | 22 case "$1" in |
22 "--no-clean_up" ) | 23 # This option tells make-dist not to delete the staging directory |
24 # after it's done making the tar file. | |
25 "--no-clean-up" ) | |
23 clean_up=no | 26 clean_up=no |
24 ;; | 27 ;; |
28 # This option tells make-dist not to make a tar file. Since it's | |
29 # rather pointless to build the whole staging directory and then | |
30 # nuke it, using this option also selects '--no-clean-up'. | |
25 "--no-tar" ) | 31 "--no-tar" ) |
26 make_tar=no | 32 make_tar=no |
27 clean_up=no | 33 clean_up=no |
28 ;; | 34 ;; |
35 # This option tells make-dist to make the distribution normally, then | |
36 # remove all files newer than the given timestamp file. This is useful | |
37 # for creating incremental or patch distributions | |
38 "--newer") | |
39 newer=$2 | |
40 shift | |
41 ;; | |
29 * ) | 42 * ) |
30 echo "${progname}: Unrecognized argument: $1" >&2 | 43 echo "${progname}: Unrecognized argument: $1" >&2 |
31 exit 1 | 44 exit 1 |
32 ;; | 45 ;; |
33 esac | 46 esac |
34 shift | 47 shift |
35 done | 48 done |
36 | 49 |
37 # Make sure we're running in the right place. | 50 # Make sure we're running in the right place. |
38 if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then | 51 if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then |
39 echo "${progname}: must run in the top directory of the Emacs" >&2 | 52 echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2 |
53 echo "${progname} must be run in the top directory of the Emacs" >&2 | |
40 echo "distribution tree. Cd to that directory and try again." >&2 | 54 echo "distribution tree. Cd to that directory and try again." >&2 |
41 exit 1 | 55 exit 1 |
42 fi | 56 fi |
43 | 57 |
44 # Find out which version of Emacs this is. | 58 # Find out which version of Emacs this is. |
45 version=`grep 'defconst[ ]*emacs-version' lisp/version.el \ | 59 version=`grep 'defconst[ ]*emacs-version' lisp/version.el \ |
46 | sed -e 's/^.*"\([0-9]+\.[0-9]+\)\..*$/\1/'` | 60 | sed -e 's/^.*"\([0-9]+\.[0-9]+\)\..*$/\1/'` |
47 if [ ! "${version}" ]; then | 61 if [ ! "${version}" ]; then |
48 echo "${progname}: can't find current emacs version in ./lisp/version.el." >&2 | 62 echo "${progname}: can't find current emacs version in \`./lisp/version.el'." >&2 |
49 exit 1 | 63 exit 1 |
50 fi | 64 fi |
51 | 65 |
52 # Make sure the subdirectory is available. | 66 # Make sure the subdirectory is available. |
53 tempparent="make-dist.$$" | 67 tempparent="make-dist.tmp.$$" |
54 if [ -d ${tempparent} ]; then | 68 if [ -d ${tempparent} ]; then |
55 echo "${progname}: staging directory ${tempparent} already exists. | 69 echo "${progname}: staging directory \`${tempparent}' already exists. |
56 Perhaps a previous invocation of ${progname} failed to clean up | 70 Perhaps a previous invocation of \`${progname}' failed to clean up after |
57 after itself. Check that directories whose names are of the form | 71 itself. Check that directories whose names are of the form |
58 make-dist.NNNNN don't contain any important information, remove them, | 72 \`make-dist.tmp.NNNNN' don't contain any important information, remove |
59 and try again." >&2 | 73 them, and try again." >&2 |
60 exit 1 | 74 exit 1 |
61 fi | 75 fi |
62 | 76 |
63 echo "Creating staging directory: ${tempparent}" | 77 echo "Creating staging directory: \`${tempparent}'" |
64 mkdir ${tempparent} | 78 mkdir ${tempparent} |
65 emacsname="emacs-${version}" | 79 emacsname="emacs-${version}" |
66 tempdir="${tempparent}/${emacsname}" | 80 tempdir="${tempparent}/${emacsname}" |
67 | 81 |
68 echo "Creating top directory: ${tempdir}" | 82 echo "Creating top directory: \`${tempdir}'" |
69 mkdir ${tempdir} | 83 mkdir ${tempdir} |
70 | 84 |
71 # We copy in the top-level files before creating the subdirectories in | 85 # We copy in the top-level files before creating the subdirectories in |
72 # hopes that this will make the top-level files appear first in the | 86 # hopes that this will make the top-level files appear first in the |
73 # tar file; this means that people can start reading the INSTALL and | 87 # tar file; this means that people can start reading the INSTALL and |
74 # README while the rest of the tar file is still unpacking. Whoopee. | 88 # README while the rest of the tar file is still unpacking. Whoopee. |
75 echo "Copying top-level files." | 89 echo "Making links to top-level files." |
76 ln GETTING.GNU.SOFTWARE INSTALL PROBLEMS README ${tempdir} | 90 ln GETTING.GNU.SOFTWARE INSTALL PROBLEMS README move-if-change ${tempdir} |
77 ln ChangeLog Makefile.in build-install.in configure make-dist ${tempdir} | 91 ln ChangeLog Makefile.in build-install.in configure make-dist ${tempdir} |
78 | 92 |
79 echo "Creating subdirectories." | 93 echo "Creating subdirectories." |
80 for subdir in lisp lisp/term src src/m src/s lib-src oldXMenu \ | 94 for subdir in lisp lisp/term local-lisp external-lisp \ |
81 etc lock local-lisp arch-lib cpp info man shortnames; do | 95 src src/m src/s lib-src oldXMenu \ |
96 etc lock arch-lib cpp info man shortnames; do | |
82 mkdir ${tempdir}/${subdir} | 97 mkdir ${tempdir}/${subdir} |
83 done | 98 done |
84 | 99 |
85 echo "Copying lisp." | 100 echo "Making links to \`lisp'." |
86 # Don't distribute =*.el files, site-init.el, or site-load.el. | 101 # Don't distribute =*.el files, site-init.el, or site-load.el. |
87 (cd lisp | 102 (cd lisp |
88 ln [a-zA-Z]*.el ../${tempdir}/lisp | 103 ln [a-zA-Z]*.el ../${tempdir}/lisp |
89 ln [a-zA-Z]*.elc ../${tempdir}/lisp | 104 ln [a-zA-Z]*.elc ../${tempdir}/lisp |
90 ln [a-zA-Z]*.defns ../${tempdir}/lisp | 105 # simula.el doesn't keep abbreviations in simula.defns any more. |
106 # ln [a-zA-Z]*.defns ../${tempdir}/lisp | |
91 ln ChangeLog README ../${tempdir}/lisp | 107 ln ChangeLog README ../${tempdir}/lisp |
92 cd ../${tempdir}/lisp | 108 cd ../${tempdir}/lisp |
93 rm -f site-init site-init.el site-init.elc | 109 rm -f site-init site-init.el site-init.elc |
94 rm -f site-load site-load.el site-load.elc) | 110 rm -f site-load site-load.el site-load.elc) |
95 | 111 |
96 echo "Copying lisp/term." | 112 echo "Making links to \`lisp/term'." |
97 # Don't distribute =*.el files. | 113 # Don't distribute =*.el files. |
98 (cd lisp/term | 114 (cd lisp/term |
99 ln [a-zA-Z]*.el ../../${tempdir}/lisp/term | 115 ln [a-zA-Z]*.el ../../${tempdir}/lisp/term |
100 ln [a-zA-Z]*.elc ../../${tempdir}/lisp/term | 116 ln [a-zA-Z]*.elc ../../${tempdir}/lisp/term |
101 ln README ../../${tempdir}/lisp/term) | 117 ln README ../../${tempdir}/lisp/term) |
102 | 118 |
103 echo "Copying src." | 119 echo "Making links to \`external-lisp'." |
120 # Don't distribute =*.el files. | |
121 (cd external-lisp | |
122 ln [a-zA-Z]*.el ../${tempdir}/external-lisp | |
123 ln [a-zA-Z]*.elc ../${tempdir}/external-lisp | |
124 ln ChangeLog README ../${tempdir}/external-lisp) | |
125 | |
126 echo "Making links to \`src'." | |
104 # Don't distribute =*.[ch] files, or the configured versions of | 127 # Don't distribute =*.[ch] files, or the configured versions of |
105 # config.h.in, paths.h.in, or Makefile.in. | 128 # config.h.in, paths.h.in, or Makefile.in. |
106 (cd src | 129 (cd src |
107 ln [a-zA-Z]*.c ../${tempdir}/src | 130 ln [a-zA-Z]*.c ../${tempdir}/src |
108 ln [a-zA-Z]*.h ../${tempdir}/src | 131 ln [a-zA-Z]*.h ../${tempdir}/src |
110 ln README Makefile.in ymakefile ChangeLog config.h.in paths.h.in \ | 133 ln README Makefile.in ymakefile ChangeLog config.h.in paths.h.in \ |
111 ../${tempdir}/src | 134 ../${tempdir}/src |
112 ln .gdbinit .dbxinit ../${tempdir}/src | 135 ln .gdbinit .dbxinit ../${tempdir}/src |
113 ln *.com *.opt vms-pp.trans vmsbuild ../${tempdir}/src | 136 ln *.com *.opt vms-pp.trans vmsbuild ../${tempdir}/src |
114 cd ../${tempdir}/src | 137 cd ../${tempdir}/src |
138 rm -f config.h paths.h Makefile | |
115 etags *.h *.c ../lisp/*.el) | 139 etags *.h *.c ../lisp/*.el) |
116 | 140 |
117 echo "Copying src/m." | 141 echo "Making links to \`src/m'." |
118 (cd src/m | 142 (cd src/m |
119 ln README *.h ../../${tempdir}/src/m) | 143 ln README *.h ../../${tempdir}/src/m) |
120 | 144 |
121 echo "Copying src/s." | 145 echo "Making links to \`src/s'." |
122 (cd src/s | 146 (cd src/s |
123 ln README *.h ../../${tempdir}/src/s) | 147 ln README *.h ../../${tempdir}/src/s) |
124 | 148 |
125 echo "Copying lib-src." | 149 echo "Making links to \`lib-src'." |
126 (cd lib-src | 150 (cd lib-src |
127 ln [a-zA-Z]*.c [a-zA-Z]*.h [a-zA-Z]*.y [a-zA-Z]*.lex ../${tempdir}/lib-src | 151 ln [a-zA-Z]*.c [a-zA-Z]*.h [a-zA-Z]*.y [a-zA-Z]*.lex ../${tempdir}/lib-src |
128 ln ChangeLog Makefile.in README testfile ../${tempdir}/lib-src) | 152 ln ChangeLog Makefile.in README testfile vcdiff rcs2log ../${tempdir}/lib-src |
129 | 153 cd ../${tempdir}/lib-src |
130 echo "Copying oldXMenu." | 154 rm -f getdate.c getdate.tab.c y.tab.c y.tab.h) |
155 | |
156 echo "Making links to \`oldXMenu'." | |
131 (cd oldXMenu | 157 (cd oldXMenu |
132 ln *.c *.h ../${tempdir}/oldXMenu | 158 ln *.c *.h ../${tempdir}/oldXMenu |
133 ln README Makefile Imakefile ChangeLog ../${tempdir}/oldXMenu) | 159 ln README Makefile Imakefile ChangeLog ../${tempdir}/oldXMenu) |
134 | 160 |
135 echo "Copying etc." | 161 echo "Making links to \`etc'." |
136 # Don't distribute DOC files, backups, autosaves, or tex litter. | 162 # Don't distribute TAGS, DOC files, backups, autosaves, or tex litter. |
137 (cd etc | 163 (cd etc |
138 ln [0-9a-zA-Z]* ../${tempdir}/etc | 164 ln [0-9a-zA-Z]* ../${tempdir}/etc |
139 cd ../${tempdir}/etc | 165 cd ../${tempdir}/etc |
140 # Avoid an error when expanding the wildcards later. | 166 # Avoid an error when expanding the wildcards later. |
141 for dummy in DOC-dummy dummy~ \#dummy\# dummy.dvi dummy.log; do | 167 for dummy in DOC-dummy dummy~ \#dummy\# dummy.dvi dummy.log; do |
142 ln MACHINES ${dummy} | 168 ln MACHINES ${dummy} |
143 done | 169 done |
144 rm -f DOC* *~ \#*\# *.dvi *.log core) | 170 rm -f TAGS DOC* *~ \#*\# *.dvi *.log core) |
145 | 171 |
146 # For now, we comment these out, since I'm not changing them any. | 172 # For now, we comment these out, since I'm not changing them any. |
147 #!! echo "Copying cpp." | 173 #!! echo "Making links to \`cpp'." |
148 #!! (cd cpp | 174 #!! (cd cpp |
149 #!! ln cccp.c cexp.y Makefile README ../${tempdir}/cpp) | 175 #!! ln cccp.c cexp.y Makefile README ../${tempdir}/cpp) |
150 #!! | 176 #!! |
151 #!! echo "Copying info." | 177 #!! echo "Making links to \`info'." |
152 #!! # Don't distribute backups or autosaves. | 178 #!! # Don't distribute backups or autosaves. |
153 #!! (cd info | 179 #!! (cd info |
154 #!! ln [a-zA-Z]* ../${tempdir}/info | 180 #!! ln [a-zA-Z]* ../${tempdir}/info |
155 #!! cd ../${tempdir}/info | 181 #!! cd ../${tempdir}/info |
156 #!! # Avoid an error when expanding the wildcards later. | 182 #!! # Avoid an error when expanding the wildcards later. |
157 #!! ln emacs dummy~ ; ln emacs \#dummy\# | 183 #!! ln emacs dummy~ ; ln emacs \#dummy\# |
158 #!! rm -f *~ \#*\# core) | 184 #!! rm -f *~ \#*\# core) |
159 #!! | 185 #!! |
160 #!! echo "Copying man." | 186 #!! echo "Making links to \`man'." |
161 #!! (cd man | 187 #!! (cd man |
162 #!! ln *.tex *.texinfo *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man | 188 #!! ln *.tex *.texinfo *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man |
163 #!! ln *.c ../${tempdir}/man | 189 #!! ln *.c ../${tempdir}/man |
164 #!! ln ChangeLog Makefile README split-man ../${tempdir}/man) | 190 #!! ln ChangeLog Makefile README split-man ../${tempdir}/man) |
165 | 191 |
166 echo "Copying shortnames." | 192 echo "Making links to \`shortnames'." |
167 (cd shortnames | 193 (cd shortnames |
168 ln *.c ../${tempdir}/shortnames | 194 ln *.c ../${tempdir}/shortnames |
169 ln Makefile reserved special ../${tempdir}/shortnames) | 195 ln Makefile reserved special ../${tempdir}/shortnames) |
170 | 196 |
171 echo "Making sure copying notices are symlinks." | 197 echo "Making sure copying notices are all symlinks to \`etc/COPYING'." |
172 if [ -f ${tempdir}/etc/COPYING ]; then | 198 rm -f ${tempdir}/etc/COPYING |
173 rm ${tempdir}/etc/COPYING | 199 cp etc/COPYING ${tempdir}/etc/COPYING |
174 ln etc/COPYING ${tempdir}/etc/COPYING | 200 for subdir in lisp external-lisp src lib-src info shortnames; do |
175 fi | |
176 for subdir in lisp src lib-src info shortnames; do | |
177 if [ -f ${tempdir}/${subdir}/COPYING ]; then | 201 if [ -f ${tempdir}/${subdir}/COPYING ]; then |
178 rm ${tempdir}/${subdir}/COPYING | 202 rm ${tempdir}/${subdir}/COPYING |
179 fi | 203 fi |
180 ln -s ../etc/COPYING ${tempdir}/${subdir} | 204 ln -s ../etc/COPYING ${tempdir}/${subdir} |
181 done | 205 done |
182 | 206 |
207 if [ "${newer}" ]; then | |
208 echo "Removing files older than $newer." | |
209 # We remove .elc files unconditionally, on the theory that anyone picking | |
210 # up an incremental distribution already has a running Emacs to byte-compile | |
211 # them with. | |
212 find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \; | |
213 fi | |
214 | |
183 if [ "${make_tar}" = yes ]; then | 215 if [ "${make_tar}" = yes ]; then |
184 echo "Creating tar file." | 216 echo "Creating tar file." |
185 (cd ${tempparent}; tar cvf - ${emacsname}) | compress > ${emacsname}.tar.Z | 217 (cd ${tempparent}; tar cvf - ${emacsname}) | compress > ${emacsname}.tar.Z |
186 fi | 218 fi |
187 | 219 |