zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: mkdisttree.sh tweaks
@ 1999-12-08 16:55 zefram
  0 siblings, 0 replies; only message in thread
From: zefram @ 1999-12-08 16:55 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-12-08 16:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-08 16:55 PATCH: mkdisttree.sh tweaks zefram

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).