meta: fit build-all into a 80x48 screen and fix a couple edge cases

This commit is contained in:
Connor Olding 2022-10-05 02:07:29 -07:00
parent c5808b668c
commit 3b4bd6d593

View File

@ -1,39 +1,25 @@
#!/usr/bin/env sh #!/usr/bin/env sh
yes_retrieve() yes_retrieve() { : \
{ : \ && local ok=1 out= g= image="${1?missing argument}" && shift \
&& local image="$1" ok=1 out= g= \ && [ -d out ] && out="$(realpath out)" \
&& shift \
&& [ -d out ] \
&& out="$(realpath out)" \
&& for f in "$@" \ && for f in "$@" \
;do : \ ;do g="out/${f##*/}" && { ! [ -e "$g" ] || mv "$g" "$g~" ;} || return \
&& g="out/${f##*/}" \
&& { ! [ -e "$g" ] || mv "$g" "$g~" ;} \
;done \ ;done \
&& podman run -v="$out":/out --rm --entrypoint /bin/busybox "$image" \ && podman run -v="$out":/out --rm --entrypoint /bin/busybox "$image" \
cp -- "$@" "/out/" \ cp -- "$@" "/out/" \
&& for f in "$@" \ && for f in "$@" \
;do : \ ;do if g="out/${f##*/}" && [ -e "$g" ] \
&& g="out/${f##*/}" \ ;then ! [ -e "$g~" ] || rm "$g~" || return \
&& if [ -e "$g" ] \ ;else printf 'yes_retrieve: %s\n' "failed to copy file $f to $g"; ok=0 \
;then : \ ;fi ;done \
&& { ! [ -e "$g~" ] || rm "$g~" ;} \
;else : \
&& printf '%s: %s\n' yes_retrieve "failed to copy file $f to $g" \
&& ok=0 \
;fi \
;done \
&& [ $ok = 1 ] \ && [ $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")" \ && me="$(readlink -f "$0")" && cd "${me%/*}" && { [ -d out ] || mkdir out ;} \
&& cd "${me%/*}" \
\
&& { [ -d out ] || mkdir out ;} \
\ \
&& podman build -t notwa-util notwa-util \ && podman build -t notwa-util notwa-util \
&& podman build -t cosmo cosmo \ && podman build -t cosmo cosmo \