Tests fail when the build directory contains
'@' in its path, as its sent to 'sed' unescaped.
This patch allows to build in such environments,
which typically happen on automated systems (for
example, when building concurrently with Jenkins).
# remove non comparable parts of fdisk output
if [ -n "${DEVNAME}" ]; then
- sed -i -e "s@${DEVNAME}@<removed>@;" $TS_OUTPUT $TS_ERRLOG
+ # escape "@" with "@@" in $img. This way sed correctly
+ # replaces paths containing "@" characters
+ sed -i -e "s@${DEVNAME//\@/\\\@}@<removed>@;" $TS_OUTPUT $TS_ERRLOG
fi
sed -i \
rm -f $img
-sed -i "s@$img@image@g" $TS_OUTPUT
+# escape "@" with "@@" in $img. This way sed correctly
+# replaces paths containing "@" characters
+sed -i "s@${img//\@/\\\@}@image@g" $TS_OUTPUT
+
ts_finalize