aboutsummaryrefslogtreecommitdiffstats
path: root/make-dist
diff options
context:
space:
mode:
authorPaul Eggert2018-04-09 13:34:44 -0700
committerPaul Eggert2018-04-09 13:35:15 -0700
commit83a6224d607c645cadbe371c921928166da0aef0 (patch)
tree8c0995e17e590779421f6d10c67456cbe13e02d9 /make-dist
parent32dc0cb1b5ae895d237c7118ccaeb084715934fd (diff)
downloademacs-83a6224d607c645cadbe371c921928166da0aef0.tar.gz
emacs-83a6224d607c645cadbe371c921928166da0aef0.zip
make-dist: check exit statuses more carefully
* make-dist: Do a better job checking for subprocess failure.
Diffstat (limited to 'make-dist')
-rwxr-xr-xmake-dist250
1 files changed, 144 insertions, 106 deletions
diff --git a/make-dist b/make-dist
index d651e18b83a..7fd227862b6 100755
--- a/make-dist
+++ b/make-dist
@@ -346,7 +346,7 @@ fi # $update = yes
346 346
347echo "Creating staging directory: '${tempparent}'" 347echo "Creating staging directory: '${tempparent}'"
348 348
349mkdir ${tempparent} 349mkdir ${tempparent} || exit
350tempdir="${tempparent}/${emacsname}" 350tempdir="${tempparent}/${emacsname}"
351 351
352### This trap ensures that the staging directory will be cleaned up even 352### This trap ensures that the staging directory will be cleaned up even
@@ -356,7 +356,7 @@ if [ "${clean_up}" = yes ]; then
356fi 356fi
357 357
358echo "Creating top directory: '${tempdir}'" 358echo "Creating top directory: '${tempdir}'"
359mkdir ${tempdir} 359mkdir ${tempdir} || exit
360 360
361if [ "$changelog" = yes ]; then 361if [ "$changelog" = yes ]; then
362 if test -r .git; then 362 if test -r .git; then
@@ -379,10 +379,13 @@ fi
379### tar file; this means that people can start reading the INSTALL and 379### tar file; this means that people can start reading the INSTALL and
380### README while the rest of the tar file is still unpacking. Whoopee. 380### README while the rest of the tar file is still unpacking. Whoopee.
381echo "Making links to top-level files" 381echo "Making links to top-level files"
382ln INSTALL README BUGS ${tempdir} 382top_level='
383ln ChangeLog.*[0-9] Makefile.in autogen.sh configure configure.ac ${tempdir} 383 INSTALL README BUGS
384ln config.bat make-dist .dir-locals.el ${tempdir} 384 ChangeLog.*[0-9] Makefile.in autogen.sh configure configure.ac
385ln aclocal.m4 CONTRIBUTE ChangeLog ${tempdir} 385 config.bat make-dist .dir-locals.el
386 aclocal.m4 CONTRIBUTE ChangeLog
387'
388ln $top_level $tempdir || exit
386 389
387echo "Creating subdirectories" 390echo "Creating subdirectories"
388for subdir in site-lisp \ 391for subdir in site-lisp \
@@ -412,132 +415,151 @@ do
412 [ "$subdir" = "site-lisp" ] || [ -d "$subdir" ] || \ 415 [ "$subdir" = "site-lisp" ] || [ -d "$subdir" ] || \
413 echo "WARNING: $subdir not found, making anyway" 416 echo "WARNING: $subdir not found, making anyway"
414 [ "$verbose" = "yes" ] && echo " ${tempdir}/${subdir}" 417 [ "$verbose" = "yes" ] && echo " ${tempdir}/${subdir}"
415 mkdir ${tempdir}/${subdir} 418 mkdir ${tempdir}/${subdir} || exit
416done 419done
417 420
418echo "Making links to 'lisp' and its subdirectories" 421echo "Making links to 'lisp' and its subdirectories"
419files=`find lisp \( -name '*.el' -o -name '*.elc' -o -name 'ChangeLog*' \ 422files=`find lisp \( -name '*.el' -o -name '*.elc' -o -name 'ChangeLog*' \
420 -o -name 'README' \)` 423 -o -name 'README' \)` || exit
421 424
422### Don't distribute site-init.el, site-load.el, or default.el. 425### Don't distribute site-init.el, site-load.el, or default.el.
423for file in lisp/Makefile.in $files; do 426for file in lisp/Makefile.in $files; do
424 case $file in 427 case $file in
425 */site-init*|*/site-load*|*/default*) continue ;; 428 */site-init*|*/site-load*|*/default*) continue ;;
426 esac 429 esac
427 ln $file $tempdir/$file 430 ln $file $tempdir/$file || exit
428done 431done
429 432
430echo "Making links to 'leim' and its subdirectories" 433echo "Making links to 'leim' and its subdirectories"
431(cd leim 434(cd leim &&
432 ln ChangeLog.*[0-9] README ../${tempdir}/leim 435 ln ChangeLog.*[0-9] README ../${tempdir}/leim &&
433 ln CXTERM-DIC/README CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC 436 ln CXTERM-DIC/README CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC &&
434 ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC 437 ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC &&
435 ln MISC-DIC/README MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC 438 ln MISC-DIC/README MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC &&
436 ln Makefile.in ../${tempdir}/leim/Makefile.in 439 ln Makefile.in ../${tempdir}/leim/Makefile.in &&
437 ln leim-ext.el ../${tempdir}/leim/leim-ext.el) 440 ln leim-ext.el ../${tempdir}/leim/leim-ext.el &&
441:) || exit
438 442
439## FIXME Can we not just use the "find -type f" method for this one? 443## FIXME Can we not just use the "find -type f" method for this one?
440echo "Making links to 'build-aux'" 444echo "Making links to 'build-aux'"
441(cd build-aux 445(cd build-aux &&
442 ln config.guess config.sub msys-to-w32 ../${tempdir}/build-aux 446 ln config.guess config.sub msys-to-w32 ../${tempdir}/build-aux &&
443 ln gitlog-to-changelog gitlog-to-emacslog ../${tempdir}/build-aux 447 ln gitlog-to-changelog gitlog-to-emacslog ../${tempdir}/build-aux &&
444 ln install-sh move-if-change ../${tempdir}/build-aux 448 ln install-sh move-if-change ../${tempdir}/build-aux &&
445 ln update-copyright update-subdirs ../${tempdir}/build-aux 449 ln update-copyright update-subdirs ../${tempdir}/build-aux &&
446 ln dir_top make-info-dir ../${tempdir}/build-aux) 450 ln dir_top make-info-dir ../${tempdir}/build-aux &&
451:) || exit
447 452
448echo "Making links to 'src'" 453echo "Making links to 'src'"
449### Don't distribute the configured versions of 454### Don't distribute the configured versions of
450### config.in, paths.in, buildobj.h, or Makefile.in. 455### config.in, paths.in, buildobj.h, or Makefile.in.
451(cd src 456(cd src &&
452 echo " (It is ok if ln fails in some cases.)" 457 ln [a-zA-Z]*.[chm] ../${tempdir}/src &&
453 ln [a-zA-Z]*.[chm] ../${tempdir}/src 458 ln [a-zA-Z]*.in ../${tempdir}/src &&
454 ln [a-zA-Z]*.in ../${tempdir}/src 459 ln deps.mk ../${tempdir}/src &&
455 ln deps.mk ../${tempdir}/src 460 ln README ChangeLog.*[0-9] ../${tempdir}/src &&
456 ln README ChangeLog.*[0-9] ../${tempdir}/src 461 ln .gdbinit .dbxinit ../${tempdir}/src &&
457 ln .gdbinit .dbxinit ../${tempdir}/src 462 cd ../${tempdir}/src &&
458 cd ../${tempdir}/src 463 rm -f globals.h config.h epaths.h Makefile buildobj.h &&
459 rm -f globals.h config.h epaths.h Makefile buildobj.h) 464:) || exit
460 465
461echo "Making links to 'src/bitmaps'" 466echo "Making links to 'src/bitmaps'"
462(cd src/bitmaps 467(cd src/bitmaps &&
463 ln README *.xbm ../../${tempdir}/src/bitmaps) 468 ln README *.xbm ../../${tempdir}/src/bitmaps &&
469:) || exit
464 470
465echo "Making links to 'lib'" 471echo "Making links to 'lib'"
466(cd lib 472(cd lib &&
467 ln [a-zA-Z_]*.[ch] ../${tempdir}/lib 473 ln [a-zA-Z_]*.[ch] ../${tempdir}/lib &&
468 ln gnulib.mk.in Makefile.in ../${tempdir}/lib 474 ln gnulib.mk.in Makefile.in ../${tempdir}/lib &&
469 cd ../${tempdir}/lib 475 cd ../${tempdir}/lib &&
470 script='/[*]/d; s/\.in\.h$/.h/' 476 script='/[*]/d; s/\.in\.h$/.h/' &&
471 rm -f `ls *.in.h | sed "$script"`) 477 rm -f `ls *.in.h | sed "$script"` &&
478:) || exit
472 479
473echo "Making links to 'lib-src'" 480echo "Making links to 'lib-src'"
474(cd lib-src 481(cd lib-src &&
475 ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src 482 ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src &&
476 ln ChangeLog.*[0-9] Makefile.in README ../${tempdir}/lib-src 483 ln ChangeLog.*[0-9] Makefile.in README ../${tempdir}/lib-src &&
477 ln rcs2log ../${tempdir}/lib-src) 484 ln rcs2log ../${tempdir}/lib-src &&
485:) || exit
478 486
479echo "Making links to 'm4'" 487echo "Making links to 'm4'"
480(cd m4 488(cd m4 &&
481 ln *.m4 ../${tempdir}/m4) 489 ln *.m4 ../${tempdir}/m4 &&
490:) || exit
482 491
483echo "Making links to 'modules'" 492echo "Making links to 'modules'"
484(cd modules 493(cd modules &&
485 ln *.py ../${tempdir}/modules 494 ln *.py ../${tempdir}/modules &&
486) 495:) || exit
487 496
488echo "Making links to 'nt'" 497echo "Making links to 'nt'"
489(cd nt 498(cd nt &&
490 ln emacs-x86.manifest emacs-x64.manifest ../${tempdir}/nt 499 ln emacs-x86.manifest emacs-x64.manifest ../${tempdir}/nt &&
491 ln [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt 500 ln [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt &&
492 ln *.in gnulib-cfg.mk ../${tempdir}/nt 501 ln *.in gnulib-cfg.mk ../${tempdir}/nt &&
493 ln mingw-cfg.site epaths.nt INSTALL.W64 ../${tempdir}/nt 502 ln mingw-cfg.site epaths.nt INSTALL.W64 ../${tempdir}/nt &&
494 ln ChangeLog.*[0-9] INSTALL README README.W32 ../${tempdir}/nt) 503 ln ChangeLog.*[0-9] INSTALL README README.W32 ../${tempdir}/nt &&
504:) || exit
495 505
496echo "Making links to 'nt/inc' and its subdirectories" 506echo "Making links to 'nt/inc' and its subdirectories"
497for f in `find nt/inc -type f -name '[a-z]*.h'`; do 507for f in `find nt/inc -type f -name '[a-z]*.h'`; do
498 ln $f $tempdir/$f 508 ln $f $tempdir/$f || exit
499done 509done
500 510
501echo "Making links to 'nt/icons'" 511echo "Making links to 'nt/icons'"
502(cd nt/icons 512(cd nt/icons &&
503 ln README [a-z]*.ico ../../${tempdir}/nt/icons 513 ln README [a-z]*.ico ../../${tempdir}/nt/icons &&
504 ln [a-z]*.cur ../../${tempdir}/nt/icons) 514 ln [a-z]*.cur ../../${tempdir}/nt/icons &&
515:) || exit
505 516
506echo "Making links to 'msdos'" 517echo "Making links to 'msdos'"
507(cd msdos 518(cd msdos &&
508 ln ChangeLog.*[0-9] INSTALL README emacs.ico emacs.pif ../${tempdir}/msdos 519 ln ChangeLog.*[0-9] INSTALL README emacs.ico emacs.pif ../${tempdir}/msdos &&
509 ln depfiles.bat inttypes.h ../${tempdir}/msdos 520 ln depfiles.bat inttypes.h ../${tempdir}/msdos &&
510 ln mainmake.v2 sed*.inp ../${tempdir}/msdos) 521 ln mainmake.v2 sed*.inp ../${tempdir}/msdos &&
522:) || exit
511 523
512echo "Making links to 'nextstep'" 524echo "Making links to 'nextstep'"
513(cd nextstep 525(cd nextstep &&
514 ln ChangeLog.*[0-9] README INSTALL Makefile.in ../${tempdir}/nextstep) 526 ln ChangeLog.*[0-9] README INSTALL Makefile.in ../${tempdir}/nextstep &&
527:) || exit
515 528
516echo "Making links to 'nextstep/templates'" 529echo "Making links to 'nextstep/templates'"
517(cd nextstep/templates 530(cd nextstep/templates &&
518 ln Emacs.desktop.in Info-gnustep.plist.in Info.plist.in InfoPlist.strings.in ../../${tempdir}/nextstep/templates) 531 ln Emacs.desktop.in Info-gnustep.plist.in Info.plist.in InfoPlist.strings.in \
532 ../../${tempdir}/nextstep/templates &&
533:) || exit
519 534
520echo "Making links to 'nextstep/Cocoa/Emacs.base/Contents'" 535echo "Making links to 'nextstep/Cocoa/Emacs.base/Contents'"
521(cd nextstep/Cocoa/Emacs.base/Contents 536(cd nextstep/Cocoa/Emacs.base/Contents &&
522 ln PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents) 537 ln PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents &&
538:) || exit
523 539
524echo "Making links to 'nextstep/Cocoa/Emacs.base/Contents/Resources'" 540echo "Making links to 'nextstep/Cocoa/Emacs.base/Contents/Resources'"
525(cd nextstep/Cocoa/Emacs.base/Contents/Resources 541(cd nextstep/Cocoa/Emacs.base/Contents/Resources &&
526 ln Credits.html *.icns ../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources) 542 ln Credits.html *.icns \
543 ../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources &&
544:) || exit
527 545
528echo "Making links to 'nextstep/GNUstep/Emacs.base/Resources'" 546echo "Making links to 'nextstep/GNUstep/Emacs.base/Resources'"
529(cd nextstep/GNUstep/Emacs.base/Resources 547(cd nextstep/GNUstep/Emacs.base/Resources &&
530 ln README emacs.tiff ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources ) 548 ln README emacs.tiff \
549 ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources &&
550:) || exit
531 551
532echo "Making links to 'oldXMenu'" 552echo "Making links to 'oldXMenu'"
533(cd oldXMenu 553(cd oldXMenu &&
534 ln *.[ch] *.in *.mk ../${tempdir}/oldXMenu 554 ln *.[ch] *.in *.mk ../${tempdir}/oldXMenu &&
535 ln README ChangeLog.*[0-9] ../${tempdir}/oldXMenu) 555 ln README ChangeLog.*[0-9] ../${tempdir}/oldXMenu &&
556:) || exit
536 557
537echo "Making links to 'lwlib'" 558echo "Making links to 'lwlib'"
538(cd lwlib 559(cd lwlib &&
539 ln *.[ch] *.in *.mk ../${tempdir}/lwlib 560 ln *.[ch] *.in *.mk ../${tempdir}/lwlib &&
540 ln README ChangeLog.*[0-9] ../${tempdir}/lwlib) 561 ln README ChangeLog.*[0-9] ../${tempdir}/lwlib &&
562:) || exit
541 563
542## It is important to distribute admin/ because it contains sources 564## It is important to distribute admin/ because it contains sources
543## for generated lisp/international/uni-*.el files. 565## for generated lisp/international/uni-*.el files.
@@ -546,7 +568,7 @@ for f in `find admin -type f`; do
546 case $f in 568 case $f in
547 */Makefile) [ -f $f.in ] && continue ;; 569 */Makefile) [ -f $f.in ] && continue ;;
548 esac 570 esac
549 ln $f $tempdir/$f 571 ln $f $tempdir/$f || exit
550done 572done
551 573
552if [ "$with_tests" = "yes" ]; then 574if [ "$with_tests" = "yes" ]; then
@@ -557,7 +579,7 @@ if [ "$with_tests" = "yes" ]; then
557 case $f in 579 case $f in
558 */Makefile) [ -f $f.in ] && continue ;; 580 */Makefile) [ -f $f.in ] && continue ;;
559 esac 581 esac
560 ln $f $tempdir/$f 582 ln $f $tempdir/$f || exit
561 done 583 done
562fi 584fi
563 585
@@ -569,45 +591,50 @@ for f in `find etc -type f`; do
569 etc/refcards/*.aux|etc/refcards/*.dvi|etc/refcards/*.log|etc/refcards/*.ps) 591 etc/refcards/*.aux|etc/refcards/*.dvi|etc/refcards/*.log|etc/refcards/*.ps)
570 continue ;; 592 continue ;;
571 esac 593 esac
572 ln $f $tempdir/$f 594 ln $f $tempdir/$f || exit
573done 595done
574 596
575echo "Making links to 'info'" 597echo "Making links to 'info'"
576ln `find info -type f -print` ${tempdir}/info 598ln `find info -type f -print` ${tempdir}/info || exit
577 599
578echo "Making links to 'doc/emacs'" 600echo "Making links to 'doc/emacs'"
579(cd doc/emacs 601(cd doc/emacs &&
580 ln *.texi *.in ChangeLog.*[0-9] ../../${tempdir}/doc/emacs) 602 ln *.texi *.in ChangeLog.*[0-9] ../../${tempdir}/doc/emacs &&
603:) || exit
581 604
582echo "Making links to 'doc/misc'" 605echo "Making links to 'doc/misc'"
583(cd doc/misc 606(cd doc/misc &&
584 ln *.texi *.tex *.in gnus-news.el ChangeLog.*[0-9] \ 607 ln *.texi *.tex *.in gnus-news.el ChangeLog.*[0-9] \
585 ../../${tempdir}/doc/misc) 608 ../../${tempdir}/doc/misc &&
609:) || exit
586 610
587echo "Making links to 'doc/lispref'" 611echo "Making links to 'doc/lispref'"
588(cd doc/lispref 612(cd doc/lispref &&
589 ln *.texi *.in README ChangeLog.*[0-9] ../../${tempdir}/doc/lispref 613 ln *.texi *.in README ChangeLog.*[0-9] ../../${tempdir}/doc/lispref &&
590 ln spellfile ../../${tempdir}/doc/lispref 614 ln spellfile ../../${tempdir}/doc/lispref &&
591 ln two-volume.make two-volume-cross-refs.txt ../../${tempdir}/doc/lispref) 615 ln two-volume.make two-volume-cross-refs.txt ../../${tempdir}/doc/lispref &&
616:) || exit
592 617
593echo "Making links to 'doc/lispintro'" 618echo "Making links to 'doc/lispintro'"
594(cd doc/lispintro 619(cd doc/lispintro &&
595 ln *.texi *.in *.eps *.pdf ../../${tempdir}/doc/lispintro 620 ln *.texi *.in *.eps *.pdf ../../${tempdir}/doc/lispintro &&
596 ln README ChangeLog.*[0-9] ../../${tempdir}/doc/lispintro 621 ln README ChangeLog.*[0-9] ../../${tempdir}/doc/lispintro &&
597 cd ../../${tempdir}/doc/lispintro) 622 cd ../../${tempdir}/doc/lispintro &&
623:) || exit
598 624
599echo "Making links to 'doc/man'" 625echo "Making links to 'doc/man'"
600(cd doc/man 626(cd doc/man &&
601 ln *.*[0-9] *.in ../../${tempdir}/doc/man 627 ln *.*[0-9] *.in ../../${tempdir}/doc/man &&
602 cd ../../${tempdir}/doc/man 628 cd ../../${tempdir}/doc/man &&
603 rm -f emacs.1) 629 rm -f emacs.1 &&
630:) || exit
604 631
605### It would be nice if they could all be symlinks to top-level copy, but 632### It would be nice if they could all be symlinks to top-level copy, but
606### you're not supposed to have any symlinks in distribution tar files. 633### you're not supposed to have any symlinks in distribution tar files.
607echo "Making sure copying notices are all copies of 'COPYING'" 634echo "Making sure copying notices are all copies of 'COPYING'"
608for subdir in . etc leim lib lib-src lisp lwlib msdos nt src; do 635for subdir in . etc leim lib lib-src lisp lwlib msdos nt src; do
609 rm -f ${tempdir}/${subdir}/COPYING 636 rm -f ${tempdir}/${subdir}/COPYING || exit
610 cp COPYING ${tempdir}/${subdir} 637 cp COPYING ${tempdir}/${subdir} || exit
611done 638done
612 639
613if [ "${newer}" ]; then 640if [ "${newer}" ]; then
@@ -615,12 +642,13 @@ if [ "${newer}" ]; then
615 ## We remove .elc files unconditionally, on the theory that anyone picking 642 ## We remove .elc files unconditionally, on the theory that anyone picking
616 ## up an incremental distribution already has a running Emacs to byte-compile 643 ## up an incremental distribution already has a running Emacs to byte-compile
617 ## them with. 644 ## them with.
618 find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \; 645 find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) \
646 -exec rm -f {} \; || exit
619fi 647fi
620 648
621## Don't distribute backups, autosaves, etc. 649## Don't distribute backups, autosaves, etc.
622echo "Removing unwanted files" 650echo "Removing unwanted files"
623find ${tempparent} \( -name '*~' -o -name '#*#' -o -name '.*ignore' -o -name '=*' -o -name 'TAGS' \) -exec rm -f {} \; 651find ${tempparent} \( -name '*~' -o -name '#*#' -o -name '.*ignore' -o -name '=*' -o -name 'TAGS' \) -exec rm -f {} \; || exit
624 652
625if [ "${make_tar}" = yes ]; then 653if [ "${make_tar}" = yes ]; then
626 echo "Looking for $default_gzip" 654 echo "Looking for $default_gzip"
@@ -648,13 +676,23 @@ if [ "${make_tar}" = yes ]; then
648 taropt="$taropt --sort=name" 676 taropt="$taropt --sort=name"
649 [ "$verbose" = "yes" ] && taropt="$taropt --verbose" 677 [ "$verbose" = "yes" ] && taropt="$taropt --verbose"
650 678
651 (cd ${tempparent} ; tar $taropt -cf - ${emacsname} ) \ 679 (cd $tempparent &&
652 | ${default_gzip} \ 680 case $default_gzip in
653 > ${emacsname}.tar${gzip_extension} 681 cat) tar $taropt -cf - $emacsname;;
682 *) if tar $taropt -cf /dev/null --use-compress-program="$default_gzip" \
683 $emacsname/src/lisp.h
684 then
685 tar $taropt -cf - --use-compress-program="$default_gzip" $emacsname
686 else
687 tar $taropt -cf $emacsname.tar $emacsname &&
688 $default_gzip <$emacsname.tar
689 fi;;
690 esac
691 ) >$emacsname.tar$gzip_extension || exit
654fi 692fi
655 693
656if [ "${clean_up}" != yes ]; then 694if [ "${clean_up}" != yes ]; then
657 (cd ${tempparent}; mv ${emacsname} ..) 695 (cd ${tempparent} && mv ${emacsname} ..) &&
658 rm -rf ${tempparent} 696 rm -rf ${tempparent}
659fi 697fi
660 698