aboutsummaryrefslogtreecommitdiffstats
path: root/os400/make-rpg.sh
diff options
context:
space:
mode:
Diffstat (limited to 'os400/make-rpg.sh')
-rw-r--r--os400/make-rpg.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/os400/make-rpg.sh b/os400/make-rpg.sh
index 95d3249c..664b47bf 100644
--- a/os400/make-rpg.sh
+++ b/os400/make-rpg.sh
@@ -25,8 +25,6 @@ fi
# Map file names to DB2 name syntax.
-> tmpsubstfile
-
for HFILE in *.rpgle *.rpgle.in
do NAME="`basename \"${HFILE}\" .in`"
VAR="`basename \"${NAME}\" .rpgle`"
@@ -36,9 +34,14 @@ do NAME="`basename \"${HFILE}\" .in`"
then VAL=SCHMTYPES
fi
- echo "s/${VAR}/${VAL}/g" >> tmpsubstfile
eval "VAR_${VAR}=\"${VAL}\""
-done
+ echo "${VAR} s/${VAR}/${VAL}/g"
+done > tmpsubstfile1
+
+# Order substitution commands so that a prefix appears after all
+# file names beginning with the prefix.
+
+sort -r tmpsubstfile1 | sed 's/^[^ ]*[ ]*//' > tmpsubstfile2
change_include()
@@ -47,7 +50,7 @@ change_include()
sed -e '\#^....../include *"libxmlrpg/#{' \
-e 's///' \
-e 's/".*//' \
- -f tmpsubstfile \
+ -f tmpsubstfile2 \
-e 's#.*# /include libxmlrpg,&#' \
-e '}'
}