X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fautodist%2Fautodist.in;h=0b3638ff9f7f2170b6494b5218c21231ee4c7428;hb=b61df5d9f82725e7ed48203244d32104c5302d28;hp=b16f696bf61307b3fd041dc9744bbbdd2a6ebeea;hpb=6576a5432b7f646cd4f4e265f58c19fef186d0d1;p=autodist.git diff --git a/apps/autodist/autodist.in b/apps/autodist/autodist.in index b16f696..0b3638f 100755 --- a/apps/autodist/autodist.in +++ b/apps/autodist/autodist.in @@ -224,26 +224,29 @@ ad_create_distdefs_h() fname=$DISTDEFS rm -f $fname - echo "/*" > $fname - echo " Automatically generated by Autodist $ver. Do not edit." >> $fname - echo >> $fname - echo " Generated: `date` by `whoami`" >> $fname - echo " Distribution: $distribution" >> $fname - echo " License: $license" >> $fname - echo "*/" >> $fname - echo >> $fname - echo "#ifndef _"$DP"_DISTDEFS_H" >> $fname - echo "#define _"$DP"_DISTDEFS_H" >> $fname - echo >> $fname + cat > $fname <>$fname done - echo >> $fname - echo "#endif /* _"$DP"_DISTDEFS_H */" >> $fname + cat >> $fname < $fname - echo "# To make changes edit the configure.ad file in the source tree." >> $fname - echo >> $fname - echo "# Source: configure.ad" >> $fname - echo "# Generated: `date` by `whoami`" >> $fname - echo "# Distribution: $distribution" >> $fname - echo "# License: $license" >> $fname - echo >> $fname + cat > $fname < configure.ac + sed -e :a -e '/\\$/N; s/[ ]*\\\n//; ta' < $fname > configure.ac else cp -p $fname.tmp configure.ac fi @@ -426,14 +431,16 @@ ad_make_makefile_ams() fname=`echo $ff | sed s/\.ad//` # Header for the Makefile.am - echo "# Automatically generated by Autodist $ver from Makefile.ad. Do not edit." > $fname.am - echo "# To make changes edit the $ff file in the source tree." >> $fname.am - echo >> $fname.am - echo "# Source: $ff" >> $fname.am - echo "# Generated: `date` by `whoami`" >> $fname.am - echo "# Distribution: $distribution" >> $fname.am - echo "# License: $license" >> $fname.am - echo >> $fname.am + cat > $fname.am <> $fname.am + sed -e :a -e '/\\$/N; s/[ ]*\\\n//; ta' < $fname.tmp >> $fname.am else cat $ff >> $fname.am fi @@ -467,16 +474,6 @@ ad_process_ads() do fname=`echo $i | sed s/\.ad//` - # Header - echo "# Automatically generated by Autodist $ver. Do not edit." > $fname - echo "# To make changes edit the $i file in the source tree." >> $fname - echo >> $fname - echo "# Source: $i" >> $fname - echo "# Generated: `date` by `whoami`" >> $fname - echo "# Distribution: $distribution" >> $fname - echo "# License: $license" >> $fname - echo >> $fname - # Run the distribution processing for this file ad_debug "Processing $i to be $fname" ad_process_file $i $fname @@ -605,7 +602,7 @@ ad_dist_includes() fi # Recursively call this function with expanded pathnames. The - # reason why we don't let sh by default expand patnames is that + # reason why we don't let sh by default expand pathnames is that # the include's destination is optional. If sh expands by default # we don't know the destination. For this reason, we handle the # expansion here ourselves. @@ -691,11 +688,16 @@ ad_process_tree() { ad_debug ">ad_process_tree: $1" - # We take all files, other than *.ad, including source files, in case - # they use the non-C-compiler-friendly format of distdefs, which is - # possible. - - files=`find $am_distdir \! -name \*\.ad` + # Take files, except source and .ad files. + files=`find $am_distdir \! -name \*\.ad \( \ + \! -name \*\.[cC] -a \ + \! -name \*\.[cC][cCpP] -a \ + \! -name \*\.[cC][xX][xX] -a \ + \! -name \*\.[cC][pP][pP] -a \ + \! -name \*\.[cC]++ -a \ + \! -name \*\.m -a \ + \! -name \*\.[hH] -a \ + \! -name \*\.hh \)` files=`echo $files | sed 's/$am_distdir//'` # Take away noprocess list @@ -826,9 +828,9 @@ ad_makedist() fi # Parse the requested distribution - distribution=`cat autodist.dist | grep "dist:" | cut -d: -f2` || exit 1 - dist_version=`cat autodist.dist | grep "ver:" | cut -d: -f2` || exit 1 - am_distdir=`cat autodist.dist | grep "distdir:" | cut -d: -f2` || exit 1 + distribution=`grep "dist:" < autodist.dist | cut -d: -f2` || exit 1 + dist_version=`grep "ver:" < autodist.dist | cut -d: -f2` || exit 1 + am_distdir=`grep "distdir:" < autodist.dist | cut -d: -f2` || exit 1 ad_parse_distribution $distribution false ad_process_distdefs @@ -994,11 +996,11 @@ ad_parse_distribution() fi # Get inherited - inhs=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + inhs=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "inherit " | cut -d' ' -f2 | sort | uniq` # Get distdefs - defs=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + defs=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "define " | cut -d' ' -f2 | sort | uniq` if test "$inhs" = "" && test "$defs" = ""; then @@ -1006,23 +1008,23 @@ ad_parse_distribution() fi # Get undefined distdefs - undefs=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + undefs=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "undef " | cut -d' ' -f2 | sort | uniq` # Get includes - incs=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + incs=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "include " | sed 's/include / : /'` # Get excludes - excs=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + excs=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "exclude " | cut -d' ' -f2- | sort | uniq` # Get noprocesses - nops=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + nops=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "noprocess " | cut -d' ' -f2- | sort | uniq` # Get options - opts=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + opts=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "option " | cut -d' ' -f2- | sort | uniq` # Check options @@ -1059,9 +1061,9 @@ ad_parse_distribution() done # Get license - license=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + license=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "license " | cut -d' ' -f2` - licenseh=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + licenseh=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "license-header " | sed 's/license-header / : /'` ad_debug "license: $license" @@ -1069,7 +1071,7 @@ ad_parse_distribution() if test x$2 = xfalse; then # Get distribution name - dname=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + dname=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "name " | cut -d' ' -f2-` if test "$dname"; then @@ -1077,7 +1079,7 @@ ad_parse_distribution() fi # Get distribution package name (optional) - dpname=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + dpname=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "package " | cut -d' ' -f2` if test "$dpname"; then @@ -1087,7 +1089,7 @@ ad_parse_distribution() fi # Get Bug-report email address (optional) - bugr=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + bugr=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "bug-report " | cut -d' ' -f2-` if test "$bugr"; then @@ -1099,18 +1101,18 @@ ad_parse_distribution() ad_debug "bug-report: $bug_report" # Get hooks (optional) - prh=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + prh=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "pre-hook " | cut -d' ' -f2-` - poh=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ + poh=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ | grep "post-hook " | cut -d' ' -f2-` - prdh=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ - | grep "pre-dist-hook " | sed 's/^[ ]*//' | cut -d' ' -f2-` - podh=`cat $distdir/$1 | grep -v "^#" \ - | grep "post-dist-hook " | sed 's/^[ ]*//' | cut -d' ' -f2-` - prpdh=`cat $distdir/$1 | sed 's/^[ ]*//' | grep -v "^#" \ - | grep "pre-process-dist-hook " | sed 's/^[ ]*//' | cut -d' ' -f2-` - popdh=`cat $distdir/$1 | grep -v "^#" \ - | grep "post-process-dist-hook " | sed 's/^[ ]*//' | cut -d' ' -f2-` + prdh=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ + | grep "pre-dist-hook " | cut -d' ' -f2-` + podh=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ + | grep "post-dist-hook " | cut -d' ' -f2-` + prpdh=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ + | grep "pre-process-dist-hook " | cut -d' ' -f2-` + popdh=`sed 's/^[ ]*//' < $distdir/$1 | grep -v "^#" \ + | grep "post-process-dist-hook " | cut -d' ' -f2-` pre_hooks="$pre_hooks $prh" post_hooks="$post_hooks $poh" @@ -1159,7 +1161,7 @@ ad_process_distdefs() do echo $i >>autodist.tmp.defs done - distdefs=`cat autodist.tmp.defs | sort | uniq` + distdefs=`sort < autodist.tmp.defs | uniq` distdefs=`echo $distdefs` rm -f autodist.tmp.defs