summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/inject.sh6
-rw-r--r--include/lib.sh13
2 files changed, 15 insertions, 4 deletions
diff --git a/include/inject.sh b/include/inject.sh
index 0886adc8..2e821d86 100644
--- a/include/inject.sh
+++ b/include/inject.sh
@@ -283,7 +283,7 @@ extract_tbfw()
chkvars TBFW_size # size in bytes, matching TBFW's flash IC
x_ mkdir -p tmp
- x_ rm -f tmp/tb.bin && fx_ copy_tbfw "$appdir" -type f -name "TBT.bin"
+ x_ rm -f tmp/tb.bin && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin"
x_ dd if=/dev/null of=tmp/tb.bin bs=1 seek=$TBFW_size
x_ cp "tmp/tb.bin" "$_dest"
@@ -421,7 +421,7 @@ patch_release_roms()
x_ mkdir -p "tmp"
if readkconfig; then
- fx_ prep_rom "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
+ fe_ prep_rom "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
[ "$nukemode" != "nuke" ] || \
printf "Make sure you inserted vendor files: %s\n" \
"$vguide" > "$tmpromdir/README.md" || :
@@ -571,7 +571,7 @@ modify_mac()
[ "$new_mac" != "restore" ] && x_ make -C util/nvmutil && \
x_ "$nvm" tmp/gbe setmac "$new_mac"
- fx_ newmac "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
+ fe_ newmac "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
printf "\nGbE NVM written to '%s':\n" "$archive"
x_ "$nvm" tmp/gbe dump | grep -v "bytes read from file" || :
diff --git a/include/lib.sh b/include/lib.sh
index 507a37c1..3f5e5d37 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -128,11 +128,22 @@ setvars()
printf "%s\n" "${_setvars% }"
}
+fe_()
+{
+ find_ex "x_" "$@"
+}
+
fx_()
{
+ find_ex "" "$@"
+}
+
+find_ex()
+{
+ errx="$1" && shift 1
fd="`mktemp`"
xx="$1" && shift 1
- find "$@" | sort > "$fd" || $err "!find $(echo "$@") > \"$fd\""
+ $errx find "$@" | sort > "$fd" || $err "!find $(echo "$@") > \"$fd\""
while read -r fx; do
"$xx" "$fx" || break; :
done < "$fd"