Skip to content

Commit 1816217

Browse files
committed
toolfile fix: make sure there is new line at the end of toolfile
1 parent 74a5767 commit 1816217

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

scram/tool-conf-src.file

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,11 @@ for type in selected available ; do
169169
[ -d %{i}/tools/${type} ] || continue
170170
for xml in $(ls %{i}/tools/${type}/*.xml) ; do
171171
tool=$(basename $xml)
172-
echo "cat << \\EOF_TOOLFILE >> %%{i}/tools/${type}/${tool}" >> %{i}/tools/${type}.tmpl
173-
cat $xml >> %{i}/tools/${type}.tmpl
174-
echo "EOF_TOOLFILE" >> %{i}/tools/${type}.tmpl
175-
echo "" >> %{i}/tools/${type}.tmpl
172+
echo "cat << \\EOF_TOOLFILE >> %%{i}/tools/${type}/${tool}" > tmp-tool.txt
173+
cat $xml >> tmp-tool.txt
174+
echo -e "\nEOF_TOOLFILE\n" >> tmp-tool.txt
175+
grep -v '^\s*$' tmp-tool.txt >> %{i}/tools/${type}.tmpl
176+
rm -f tmp-tool.txt
176177
done
177178
rm -rf %{i}/tools/${type}
178179
done

scram/toolfile-src.file

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ touch ${tmpl}
2020
if [ -d %{i}/tools/selected ] ; then
2121
for xml in $(ls %{i}/tools/selected/*.xml) ; do
2222
tool=$(basename $xml)
23-
echo "cat << \\EOF_TOOLFILE >> %%{i}/etc/scram.d/${tool}" >> ${tmpl}
24-
cat $xml >> ${tmpl}
25-
echo "EOF_TOOLFILE" >> ${tmpl}
26-
echo "" >> ${tmpl}
23+
echo "cat << \\EOF_TOOLFILE >> %%{i}/etc/scram.d/${tool}" > tmp-tool.txt
24+
cat $xml >> tmp-tool.txt
25+
echo -e "\nEOF_TOOLFILE\n" >> tmp-tool.txt
26+
grep -v '^\s*$' tmp-tool.txt >> ${tmpl}
27+
rm -f tmp-tool.txt
2728
done
2829
fi
2930

0 commit comments

Comments
 (0)