summaryrefslogtreecommitdiff
path: root/Util
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-04-05 19:28:07 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-04-05 19:28:07 +0000
commit3acc9f80efa7bf4a65b5efdb3c5d9f5ef25d3c22 (patch)
tree4ee721cf19be7090fcb1598937ab7df66bab2b16 /Util
parent80ac43783a990ecb1e5234e3d7a682508102e42f (diff)
downloadzsh-3acc9f80efa7bf4a65b5efdb3c5d9f5ef25d3c22.tar.gz
zsh-3acc9f80efa7bf4a65b5efdb3c5d9f5ef25d3c22.zip
Patches 10513, 10516 (Alexandre), 10519 (Oliver), 10524
Diffstat (limited to 'Util')
-rwxr-xr-xUtil/mkdisttree.sh25
1 files changed, 18 insertions, 7 deletions
diff --git a/Util/mkdisttree.sh b/Util/mkdisttree.sh
index 837ebbcc2..80139c716 100755
--- a/Util/mkdisttree.sh
+++ b/Util/mkdisttree.sh
@@ -42,10 +42,13 @@ sed_separate='
s/;;*/;/g
'
+filelist=filelist$$
+trap 'rm -f $filelist; rm -rf $disttree; exit 1' 1 2 15
(
cd $sdir_top
- find . \( -name '*.*' -prune -false \) -o \( -name .distfiles -print \)
-) | while read dfn; do
+ 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,15 +58,15 @@ sed_separate='
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
+ ( 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
if test -f $dir_top/$subdir/$f; then
- ln $dir_top/$subdir/$f $disttree/$subdir/$f || \
+# ln $dir_top/$subdir/$f $disttree/$subdir/$f || \
cp -p $dir_top/$subdir/$f $disttree/$subdir/$f || exit 1
elif test -f $sdir_top/$subdir/$f; then
- ln $sdir_top/$subdir/$f $disttree/$subdir/$f || \
+# ln $sdir_top/$subdir/$f $disttree/$subdir/$f || \
cp -p $sdir_top/$subdir/$f $disttree/$subdir/$f || exit 1
else
echo >&2 "$0: can't find file $subdir/$f"
@@ -71,6 +74,14 @@ sed_separate='
fi
done
fi
-done
+done ) < $filelist
-exec chmod -R a+rX,u+w,go-w $disttree
+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,g-s,go-w $disttree