# SPDX-FileCopyrightText: 2022 Samuel Tyler <samuel@samuelt.me>
#
# SPDX-License-Identifier: GPL-2.0-or-later

Our version of gawk does not seem to like printing, at least in the way that
this attempts to use it. Instead, make it print to console and use working
bash redirects.

--- e2fsprogs-1.45.7/lib/et/compile_et.sh.in	2022-05-18 19:26:17.182054784 +1000
+++ e2fsprogs-1.45.7/lib/et/compile_et.sh.in	2022-05-18 19:30:16.489294776 +1000
@@ -44,14 +44,14 @@
     exit 1;
 fi
 
-$AWK -f "${DIR}/et_h.awk" "outfile=${BASE}.h.$$" "outfn=${BASE}.h" "$ROOT.et"
+$AWK -f "${DIR}/et_h.awk" "$ROOT.et" > ${BASE}.h
 if test -f ${BASE}.h && cmp -s ${BASE}.h.$$ ${BASE}.h ; then
     rm -f ${BASE}.h.$$
 else
     mv -f ${BASE}.h.$$ ${BASE}.h
     chmod a-w ${BASE}.h
 fi
-$AWK -f "${DIR}/et_c.awk" "outfile=${BASE}.c.$$" "outfn=${BASE}.c" "$ROOT.et"
+$AWK -f "${DIR}/et_c.awk" "$ROOT.et" > ${BASE}.c
 if test -f ${BASE}.c && cmp -s ${BASE}.c.$$ ${BASE}.c ; then
     rm -f ${BASE}.c.$$
 else
--- e2fsprogs-1.45.7/lib/ss/mk_cmds.sh.in	2022-05-18 19:33:16.024962919 +1000
+++ e2fsprogs-1.45.7/lib/ss/mk_cmds.sh.in	2022-05-18 19:33:39.650576476 +1000
@@ -43,7 +43,7 @@
 fi
 
 ${SED} -f "${DIR}/ct_c.sed"  "${FILE}" \
-	| ${AWK} -f "${DIR}/ct_c.awk" "rootname=${ROOT}" "outfile=${TMP}" -
+	| ${AWK} -f "${DIR}/ct_c.awk" "rootname=${ROOT}" - > "${TMP}"
 
 if grep "^#__ERROR_IN_FILE" "${TMP}" > /dev/null; then
 	rm "${TMP}"
