60 lines
1.8 KiB
Bash
Executable file
60 lines
1.8 KiB
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
yes_retrieve()
|
|
{ : \
|
|
&& local image="$1" ok=1 out= g= \
|
|
&& shift \
|
|
&& [ -d out ] \
|
|
&& out="$(realpath out)" \
|
|
&& for f in "$@" \
|
|
;do : \
|
|
&& 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 : \
|
|
&& 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 \
|
|
&& [ $ok = 1 ] \
|
|
;}
|
|
|
|
dbg_retrieve() { yes_retrieve "$1" "$2" && yes_retrieve "$1" "$2.dbg" ;}
|
|
|
|
: \
|
|
&& me="$(readlink -f "$0")" \
|
|
&& cd "${me%/*}" \
|
|
\
|
|
&& { [ -d out ] || mkdir out ;} \
|
|
\
|
|
&& podman build -t notwa-util notwa-util \
|
|
&& podman build -t cosmo cosmo \
|
|
&& podman build -t cosmo-kuroko cosmo-kuroko \
|
|
&& podman build -t cosmo-muon cosmo-muon \
|
|
&& podman build -t cosmo-perl cosmo-perl \
|
|
&& podman build -t cosmo-yices cosmo-yices \
|
|
\
|
|
&& yes_retrieve cosmo /cosmopolitan/bin/ape \
|
|
&& yes_retrieve cosmo /cosmopolitan/bin/awk.com \
|
|
&& yes_retrieve cosmo /cosmopolitan/bin/gzip.com \
|
|
&& yes_retrieve cosmo /cosmopolitan/bin/make.com \
|
|
&& yes_retrieve cosmo /cosmopolitan/bin/sed.com \
|
|
&& yes_retrieve cosmo /cosmopolitan/bin/unzip.com \
|
|
&& yes_retrieve cosmo /cosmopolitan/bin/zip.com \
|
|
&& dbg_retrieve cosmo-kuroko /bin/kuroko.com \
|
|
&& dbg_retrieve cosmo-muon /bin/muon.com \
|
|
&& dbg_retrieve cosmo-perl /bin/perl.com \
|
|
&& dbg_retrieve cosmo-yices /bin/kissat.com \
|
|
&& dbg_retrieve cosmo-yices /bin/yices-sat.com \
|
|
&& dbg_retrieve cosmo-yices /bin/yices-smt.com \
|
|
&& dbg_retrieve cosmo-yices /bin/yices-smt2.com \
|
|
&& dbg_retrieve cosmo-yices /bin/yices.com \
|
|
;
|