Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: mkdisttree.sh tweaks



This fixes a portability problem in mkdisttree.sh (not all finds have
-false), and makes the error handling much more reliable.

diff -cr ../zsh-cvs-snapshot-08.12.1999.04.04.02/Util/mkdisttree.sh Util/mkdisttree.sh
*** ../zsh-cvs-snapshot-08.12.1999.04.04.02/Util/mkdisttree.sh	Thu Apr 15 19:05:41 1999
--- Util/mkdisttree.sh	Wed Dec  8 16:51:52 1999
***************
*** 42,51 ****
      s/;;*/;/g
  '
  
  (
      cd $sdir_top
!     find . \( -name '*.*' -prune -false \) -o \( -name .distfiles -print \)
! ) | while read dfn; do
      subdir=`echo $dfn | sed 's,/\.distfiles$,,'`
      echo >&2 "Processing directory $subdir..."
      eval "DISTFILES_$type="
--- 42,54 ----
      s/;;*/;/g
  '
  
+ filelist=filelist$$
+ trap 'rm -f $filelist; rm -rf $disttree; exit 1' 1 2 15
  (
      cd $sdir_top
!     find . \( -name '*.*' -prune \) -o \( -name .distfiles -print \)
! ) > $filelist
! ( while read dfn; do
      subdir=`echo $dfn | sed 's,/\.distfiles$,,'`
      echo >&2 "Processing directory $subdir..."
      eval "DISTFILES_$type="
***************
*** 55,61 ****
  	cmds=`echo "$distfiles" | sed -e "$sed_separate"`
  	eval "$cmds"
  	if test -n "$deplist" && test -f $dir_top/$subdir/Makefile; then
! 	    ( cd $dir_top/$subdir && "$@" $deplist ) || exit 1
  	fi
  	$sdir_top/mkinstalldirs $disttree/$subdir || exit 1
  	for f in $deplist `test -z "$globlist" || ( cd $dir_top/$subdir && eval "echo $globlist")`; do
--- 58,64 ----
  	cmds=`echo "$distfiles" | sed -e "$sed_separate"`
  	eval "$cmds"
  	if test -n "$deplist" && test -f $dir_top/$subdir/Makefile; then
! 	    ( trap '' 1 2 15; cd $dir_top/$subdir && "$@" $deplist ) || exit 1
  	fi
  	$sdir_top/mkinstalldirs $disttree/$subdir || exit 1
  	for f in $deplist `test -z "$globlist" || ( cd $dir_top/$subdir && eval "echo $globlist")`; do
***************
*** 71,76 ****
  	    fi
  	done
      fi
! done
  
  exec chmod -R a+rX,u+w,go-w $disttree
--- 74,87 ----
  	    fi
  	done
      fi
! done ) < $filelist
! 
! status=$?
! rm -f $filelist
! trap '' 1 2 15
! if test $status -ne 0; then
!     rm -rf $disttree
!     exit $status
! fi
  
  exec chmod -R a+rX,u+w,go-w $disttree
END



Messages sorted by: Reverse Date, Date, Thread, Author