4 echo >&2 "Usage: $0 <dist-tree-name> <top-source-dir> <top-build-dir> <type> <make-args>"
10 *) disttree
=`pwd`/$1 ;;
15 *) sdir_top
=`pwd`/$2 ;;
20 *) dir_top
=`pwd`/$3 ;;
35 s/^/deplist=;globlist=! /
38 s/ \([^?*[!][^?*[!]*\) / !deplist="$deplist \1"! /g
40 s/! \([^!]*\) !/;globlist="$globlist \1";/g
46 trap 'rm -f $filelist; rm -rf $disttree; exit 1' 1 2 15
49 find .
-name '?*.*' -prune -o -name .distfiles
-print
52 subdir
=`echo $dfn | sed 's,/\.distfiles$,,'`
53 echo >&2 "Processing directory $subdir..."
54 eval "DISTFILES_$type="
56 eval "distfiles=\$DISTFILES_$type"
57 if test -n "$distfiles"; then
58 cmds
=`echo "$distfiles" | sed -e "$sed_separate"`
60 if test -n "$deplist" && test -f $dir_top/$subdir/Makefile
; then
61 ( trap '' 1 2 15; cd $dir_top/$subdir && "$@" $deplist ) ||
exit 1
63 $sdir_top/mkinstalldirs
$disttree/$subdir ||
exit 1
64 for f
in $deplist `test -z "$globlist" || ( cd $dir_top/$subdir && eval "echo $globlist")`; do
65 if test -f $dir_top/$subdir/$f; then
66 # ln $dir_top/$subdir/$f $disttree/$subdir/$f || \
67 cp -p $dir_top/$subdir/$f $disttree/$subdir/$f ||
exit 1
68 elif test -f $sdir_top/$subdir/$f; then
69 # ln $sdir_top/$subdir/$f $disttree/$subdir/$f || \
70 cp -p $sdir_top/$subdir/$f $disttree/$subdir/$f ||
exit 1
72 echo >&2 "$0: can't find file $subdir/$f"
82 if test $status -ne 0; then
87 exec chmod -R a
+rX
,u
+w
,g-s
,go-w
$disttree