Mercurial > emacs
comparison make-dist @ 110959:88da5c66a589
More make-dist simplification.
* make-dist: Remove --compress. Check for the appropriate
gzip-like executable, and if not found, don't compress.
Check version number in README, don't change it.
Use find for nt/inc/*.h.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Tue, 12 Oct 2010 20:08:45 -0700 |
parents | 495ef3733d20 |
children | b6368ce2d119 |
comparison
equal
deleted
inserted
replaced
110958:ea91aa0b9743 | 110959:88da5c66a589 |
---|---|
47 | 47 |
48 update=yes | 48 update=yes |
49 check=yes | 49 check=yes |
50 clean_up=no | 50 clean_up=no |
51 make_tar=no | 51 make_tar=no |
52 default_gzip=gzip | |
52 newer="" | 53 newer="" |
53 | 54 |
54 while [ $# -gt 0 ]; do | 55 while [ $# -gt 0 ]; do |
55 case "$1" in | 56 case "$1" in |
56 ## This option tells make-dist to delete the staging directory | 57 ## This option tells make-dist to delete the staging directory |
76 "--newer") | 77 "--newer") |
77 newer="$2" | 78 newer="$2" |
78 new_extension=".new" | 79 new_extension=".new" |
79 shift | 80 shift |
80 ;; | 81 ;; |
81 ## This option tells make-dist to use `compress' instead of gzip. | 82 ## This option tells make-dist to use `bzip2' instead of gzip. |
82 ## Normally, make-dist uses gzip whenever it is present. | |
83 "--compress") | |
84 default_gzip="compress" | |
85 ;; | |
86 ## Same with bzip2. | |
87 "--bzip2") | 83 "--bzip2") |
88 default_gzip="bzip2" | 84 default_gzip="bzip2" |
89 ;; | 85 ;; |
90 ## Same with lzma. | 86 ## Same with lzma. |
91 "--lzma") | 87 "--lzma") |
102 "--help") | 98 "--help") |
103 echo "Usage: ${progname} [options]" | 99 echo "Usage: ${progname} [options]" |
104 echo "" | 100 echo "" |
105 echo " --bzip2 use bzip2 instead of gzip" | 101 echo " --bzip2 use bzip2 instead of gzip" |
106 echo " --clean-up delete staging directories when done" | 102 echo " --clean-up delete staging directories when done" |
107 echo " --compress use compress instead of gzip" | |
108 echo " --lzma use lzma instead of gzip" | 103 echo " --lzma use lzma instead of gzip" |
109 echo " --newer=TIME don't include files older than TIME" | 104 echo " --newer=TIME don't include files older than TIME" |
110 echo " --no-check don't check for bad file names etc." | 105 echo " --no-check don't check for bad file names etc." |
111 echo " --no-update don't recompile or do analogous things" | 106 echo " --no-update don't recompile or do analogous things" |
112 echo " --snapshot same as --clean-up --no-update --tar --no-check" | 107 echo " --snapshot same as --clean-up --no-update --tar --no-check" |
159 exit 1 | 154 exit 1 |
160 fi | 155 fi |
161 | 156 |
162 echo Version number is $version | 157 echo Version number is $version |
163 | 158 |
164 if [ $update = yes ]; | 159 if [ $update = yes ]; then |
165 then | 160 if ! grep -q "@set EMACSVER *${version}" doc/emacs/emacsver.texi || \ |
166 if grep -s "@set EMACSVER *${version}" ./doc/emacs/emacsver.texi > /dev/null; then | 161 ! grep -q "tree holds version *${version}" README; then |
167 true | 162 echo "WARNING: README and/or emacsver.texi have the wrong version number" |
168 else | 163 echo "Consider running M-x set-version from admin/admin.el" |
169 echo "You must update the version number in \`./doc/emacs/emacsver.texi'" | |
170 sleep 5 | 164 sleep 5 |
171 fi | 165 fi |
172 fi | 166 fi |
173 | 167 |
174 ### Make sure we don't already have a directory emacs-${version}. | 168 ### Make sure we don't already have a directory emacs-${version}. |
310 ln INSTALL README BUGS move-if-change ${tempdir} | 304 ln INSTALL README BUGS move-if-change ${tempdir} |
311 ln ChangeLog Makefile.in configure configure.in ${tempdir} | 305 ln ChangeLog Makefile.in configure configure.in ${tempdir} |
312 ln config.bat make-dist update-subdirs vpath.sed .dir-locals.el ${tempdir} | 306 ln config.bat make-dist update-subdirs vpath.sed .dir-locals.el ${tempdir} |
313 ln mkinstalldirs config.sub config.guess install-sh ${tempdir} | 307 ln mkinstalldirs config.sub config.guess install-sh ${tempdir} |
314 | 308 |
315 ## FIXME why do we bother doing this? set-version in admin/admin.el | |
316 ## does this, and more besides. | |
317 echo "Updating version number in README" | |
318 (cd ${tempdir} | |
319 awk \ | |
320 '$1 " " $2 " " $3 " " $4 " " $5 == "This directory tree holds version" { $6 = version; print $0 } | |
321 $1 " " $2 " " $3 " " $4 " " $5 != "This directory tree holds version"' \ | |
322 version=${version} README > tmp.README | |
323 mv -f tmp.README README) | |
324 | |
325 | |
326 echo "Creating subdirectories" | 309 echo "Creating subdirectories" |
327 for subdir in site-lisp \ | 310 for subdir in site-lisp \ |
328 leim leim/CXTERM-DIC leim/MISC-DIC \ | 311 leim leim/CXTERM-DIC leim/MISC-DIC \ |
329 leim/SKK-DIC leim/ja-dic leim/quail \ | 312 leim/SKK-DIC leim/ja-dic leim/quail \ |
330 src src/m src/s src/bitmaps lib-src oldXMenu lwlib \ | 313 src src/m src/s src/bitmaps lib-src oldXMenu lwlib \ |
415 | 398 |
416 echo "Making links to \`m4'" | 399 echo "Making links to \`m4'" |
417 (cd m4 | 400 (cd m4 |
418 ln *.m4 ../${tempdir}/m4) | 401 ln *.m4 ../${tempdir}/m4) |
419 | 402 |
403 ## Exclude README.W32 because it is specific to pre-built binaries(?). | |
420 echo "Making links to \`nt'" | 404 echo "Making links to \`nt'" |
421 (cd nt | 405 (cd nt |
422 ln emacs.manifest emacs.rc emacsclient.rc config.nt ../${tempdir}/nt | 406 ln emacs.manifest emacs.rc emacsclient.rc config.nt ../${tempdir}/nt |
423 ln emacs-src.tags nmake.defs gmake.defs subdirs.el ../${tempdir}/nt | 407 ln emacs-src.tags nmake.defs gmake.defs subdirs.el ../${tempdir}/nt |
424 ln [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt | 408 ln [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt |
425 ln ChangeLog INSTALL README README.W32 makefile.w32-in ../${tempdir}/nt) | 409 ln ChangeLog INSTALL README makefile.w32-in ../${tempdir}/nt) |
426 | 410 |
427 echo "Making links to \`nt/inc'" | 411 echo "Making links to \`nt/inc' and its subdirectories" |
428 (cd nt/inc | 412 for f in `find nt/inc -type f -name '[a-z]*.h'`; do |
429 ln [a-z]*.h ../../${tempdir}/nt/inc) | 413 ln $f $tempdir/$f |
430 | 414 done |
431 echo "Making links to \`nt/inc/sys'" | |
432 (cd nt/inc/sys | |
433 ln [a-z]*.h ../../../${tempdir}/nt/inc/sys) | |
434 | |
435 echo "Making links to \`nt/inc/arpa'" | |
436 (cd nt/inc/arpa | |
437 ln [a-z]*.h ../../../${tempdir}/nt/inc/arpa) | |
438 | |
439 echo "Making links to \`nt/inc/netinet'" | |
440 (cd nt/inc/netinet | |
441 ln [a-z]*.h ../../../${tempdir}/nt/inc/netinet) | |
442 | 415 |
443 echo "Making links to \`nt/icons'" | 416 echo "Making links to \`nt/icons'" |
444 (cd nt/icons | 417 (cd nt/icons |
445 ln README [a-z]*.ico ../../${tempdir}/nt/icons | 418 ln README [a-z]*.ico ../../${tempdir}/nt/icons |
446 ln [a-z]*.cur ../../${tempdir}/nt/icons) | 419 ln [a-z]*.cur ../../${tempdir}/nt/icons) |
491 esac | 464 esac |
492 ln $f $tempdir/$f | 465 ln $f $tempdir/$f |
493 done | 466 done |
494 | 467 |
495 echo "Making links to \`info'" | 468 echo "Making links to \`info'" |
496 (cd info | 469 ln `find info -type f -print` ${tempdir}/info |
497 ln `find . -type f -print` ../${tempdir}/info) | |
498 | 470 |
499 echo "Making links to \`doc/emacs'" | 471 echo "Making links to \`doc/emacs'" |
500 (cd doc/emacs | 472 (cd doc/emacs |
501 ln *.texi *.in makefile.w32-in ChangeLog* ../../${tempdir}/doc/emacs) | 473 ln *.texi *.in makefile.w32-in ChangeLog* ../../${tempdir}/doc/emacs) |
502 | 474 |
540 ## Don't distribute backups, autosaves, etc. | 512 ## Don't distribute backups, autosaves, etc. |
541 echo "Removing unwanted files" | 513 echo "Removing unwanted files" |
542 find ${tempparent} \( -name '*~' -o -name '#*#' -o -name '.*ignore' -o -name '=*' -o -name 'TAGS' \) -exec rm -f {} \; | 514 find ${tempparent} \( -name '*~' -o -name '#*#' -o -name '.*ignore' -o -name '=*' -o -name 'TAGS' \) -exec rm -f {} \; |
543 | 515 |
544 if [ "${make_tar}" = yes ]; then | 516 if [ "${make_tar}" = yes ]; then |
545 if [ "${default_gzip}" = "" ]; then | 517 echo "Looking for $default_gzip" |
546 echo "Looking for gzip" | 518 found=0 |
547 temppath=`echo $PATH | sed 's/^:/.:/ | 519 temppath=`echo $PATH | sed -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \ |
548 s/::/:.:/g | 520 -e 's/:/ /g'` |
549 s/:$/:./ | 521 for dir in ${temppath}; do |
550 s/:/ /g'` | 522 [ -x ${dir}/$default_gzip ] || continue |
551 default_gzip=`( | 523 found=1; break |
552 for dir in ${temppath}; do | 524 done |
553 if [ -f ${dir}/gzip ]; then echo 'gzip --best'; exit 0; fi | 525 if [ "$found" = "0" ]; then |
554 done | 526 echo "WARNING: \`$default_gzip' not found, will not compress" >&2 |
555 echo compress | 527 default_gzip=cat |
556 )` | |
557 fi | 528 fi |
558 case "${default_gzip}" in | 529 case "${default_gzip}" in |
559 bzip2) gzip_extension=.bz2 ;; | 530 bzip2) gzip_extension=.bz2 ;; |
560 compress* ) gzip_extension=.Z ;; | 531 lzma) gzip_extension=.lzma ;; |
561 lzma) gzip_extension=.lzma ;; | 532 gzip) gzip_extension=.gz ; default_gzip="gzip --best";; |
562 * ) gzip_extension=.gz ;; | 533 *) gzip_extension= ;; |
563 esac | 534 esac |
564 echo "Creating tar file" | 535 echo "Creating tar file" |
565 (cd ${tempparent} ; tar cvf - ${emacsname} ) \ | 536 (cd ${tempparent} ; tar cvf - ${emacsname} ) \ |
566 | ${default_gzip} \ | 537 | ${default_gzip} \ |
567 > ${emacsname}.tar${gzip_extension} | 538 > ${emacsname}.tar${gzip_extension} |