meta: simplify build-all a little

This commit is contained in:
Connor Olding 2022-10-04 21:41:16 -07:00
parent df4f8b9dac
commit 0cf6e31d07

View file

@ -1,47 +1,33 @@
#!/usr/bin/env sh
yes_retrieve() \
yes_retrieve()
{ : \
&& local image="$1" \
&& local ok=1 \
&& local out= \
&& local image="$1" ok=1 out= g= \
&& shift \
&& [ -d out ] \
&& out="$(realpath out)" \
&& for f in "$@" \
;do : \
&& local g="out/${f##*/}" \
&& if [ -e "$g" ] \
;then : \
&& mv "$g" "$g~" \
;fi \
&& g="out/${f##*/}" \
&& { ! [ -e "$g" ] || mv "$g" "$g~" ;} \
;done \
&& podman run -v="$out":/out --rm --entrypoint /bin/busybox "$image" \
cp -- "$@" "/out/" \
&& for f in "$@" \
;do : \
&& local g="out/${f##*/}" \
&& g="out/${f##*/}" \
&& if [ -e "$g" ] \
;then : \
&& if [ -e "$g~" ] \
;then : \
&& rm "$g~" \
;fi \
&& { ! [ -e "$g~" ] || rm "$g~" ;} \
;else : \
&& printf '%s: %s\n' yes_retrieve "failed to copy file $f to $g" \
&& ok=0 \
;fi \
;done \
&& [ $ok = 1 ] \
;} \
;
;}
dbg_retrieve() \
{ : \
&& yes_retrieve "$1" "$2" \
&& yes_retrieve "$1" "$2.dbg" \
;} \
;
dbg_retrieve() { yes_retrieve "$1" "$2" && yes_retrieve "$1" "$2.dbg" ;}
: \
&& me="$(readlink -f "$0")" \