meta: fit build-all into a 80x48 screen and fix a couple edge cases
This commit is contained in:
parent
c5808b668c
commit
3b4bd6d593
1 changed files with 9 additions and 23 deletions
32
build-all
32
build-all
|
@ -1,39 +1,25 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
yes_retrieve()
|
||||
{ : \
|
||||
&& local image="$1" ok=1 out= g= \
|
||||
&& shift \
|
||||
&& [ -d out ] \
|
||||
&& out="$(realpath out)" \
|
||||
yes_retrieve() { : \
|
||||
&& local ok=1 out= g= image="${1?missing argument}" && shift \
|
||||
&& [ -d out ] && out="$(realpath out)" \
|
||||
&& for f in "$@" \
|
||||
;do : \
|
||||
&& g="out/${f##*/}" \
|
||||
&& { ! [ -e "$g" ] || mv "$g" "$g~" ;} \
|
||||
;do g="out/${f##*/}" && { ! [ -e "$g" ] || mv "$g" "$g~" ;} || return \
|
||||
;done \
|
||||
&& podman run -v="$out":/out --rm --entrypoint /bin/busybox "$image" \
|
||||
cp -- "$@" "/out/" \
|
||||
&& for f in "$@" \
|
||||
;do : \
|
||||
&& g="out/${f##*/}" \
|
||||
&& if [ -e "$g" ] \
|
||||
;then : \
|
||||
&& { ! [ -e "$g~" ] || rm "$g~" ;} \
|
||||
;else : \
|
||||
&& printf '%s: %s\n' yes_retrieve "failed to copy file $f to $g" \
|
||||
&& ok=0 \
|
||||
;fi \
|
||||
;done \
|
||||
;do if g="out/${f##*/}" && [ -e "$g" ] \
|
||||
;then ! [ -e "$g~" ] || rm "$g~" || return \
|
||||
;else printf 'yes_retrieve: %s\n' "failed to copy file $f to $g"; ok=0 \
|
||||
;fi ;done \
|
||||
&& [ $ok = 1 ] \
|
||||
;}
|
||||
|
||||
dbg_retrieve() { yes_retrieve "$1" "$2" && yes_retrieve "$1" "$2.dbg" ;}
|
||||
|
||||
: \
|
||||
&& me="$(readlink -f "$0")" \
|
||||
&& cd "${me%/*}" \
|
||||
\
|
||||
&& { [ -d out ] || mkdir out ;} \
|
||||
&& me="$(readlink -f "$0")" && cd "${me%/*}" && { [ -d out ] || mkdir out ;} \
|
||||
\
|
||||
&& podman build -t notwa-util notwa-util \
|
||||
&& podman build -t cosmo cosmo \
|
||||
|
|
Loading…
Reference in a new issue