From 193db015b0c8cddb4ca3f1601d5c67f16bde6bbc Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 16 Jan 2008 16:30:06 +0000 Subject: [PATCH] Fixed *.ad (not configure.ad or Makefile.ad but other files) to correctly remove trailing slashes and copy the processed file. --- apps/autodist/CHANGES | 6 ++++++ apps/autodist/autodist.in | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/autodist/CHANGES b/apps/autodist/CHANGES index 08898ce0..4df53681 100644 --- a/apps/autodist/CHANGES +++ b/apps/autodist/CHANGES @@ -1,3 +1,9 @@ +Wed Jan 16 17:17:41 EET 2008 Pekka Riikonen + + * Fixed *.ad (excluding configure.ad and Makefile.ad files) + processing to correctly remove trailing backslashes and + copy the processed file to new name. + Thu Sep 13 18:50:00 EEST 2007 Pekka Riikonen * Fixed prerequisite version checking to work on all shells. diff --git a/apps/autodist/autodist.in b/apps/autodist/autodist.in index 16a789ac..3154d5ff 100755 --- a/apps/autodist/autodist.in +++ b/apps/autodist/autodist.in @@ -565,16 +565,22 @@ ad_process_ads() for i in $files do fname=`echo $i | sed s/\.ad//` + orig=$i ad_debug "Processing $i to be $fname" ad_log " $i into $fname" # Run the distribution processing for this file - ad_process_file $i $fname false - if test -f $fname; then - cp -p $i $fname || exit 1 + ad_process_file $i $fname.tmp false + + # Remove any trailing backslashes + if test -f "$fname.tmp"; then + sed -e :a -e '/\\$/N; s/[ ]*\\\n//; ta' < $fname.tmp > $fname + else + cp -p $orig $fname || exit 1 fi + rm -f $fname.tmp done ad_log "" -- 2.24.0