2022-09-23 13:21:45 -07:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
2022-10-05 02:07:29 -07:00
|
|
|
yes_retrieve() { : \
|
|
|
|
&& local ok=1 out= g= image="${1?missing argument}" && shift \
|
|
|
|
&& [ -d out ] && out="$(realpath out)" \
|
2022-09-23 15:55:45 -07:00
|
|
|
&& for f in "$@" \
|
2022-10-05 02:07:29 -07:00
|
|
|
;do g="out/${f##*/}" && { ! [ -e "$g" ] || mv "$g" "$g~" ;} || return \
|
2022-09-23 15:55:45 -07:00
|
|
|
;done \
|
|
|
|
&& podman run -v="$out":/out --rm --entrypoint /bin/busybox "$image" \
|
|
|
|
cp -- "$@" "/out/" \
|
|
|
|
&& for f in "$@" \
|
2022-10-05 02:07:29 -07:00
|
|
|
;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 \
|
2022-09-23 15:55:45 -07:00
|
|
|
&& [ $ok = 1 ] \
|
2022-10-04 21:41:16 -07:00
|
|
|
;}
|
2022-09-23 13:21:45 -07:00
|
|
|
|
2022-10-05 02:59:01 -07:00
|
|
|
dbg_retrieve() { : \
|
|
|
|
&& local o=0 container="${1?missing argument}" && shift \
|
|
|
|
&& for f in "$@" \
|
|
|
|
;do [ $o = 0 ] && o=1 && set -- "$f" "$f.dbg" || set -- "$f" "$f.dbg" "$@" \
|
|
|
|
;done \
|
|
|
|
&& yes_retrieve "$container" "$@" \
|
|
|
|
;}
|
2022-09-23 13:21:45 -07:00
|
|
|
|
|
|
|
: \
|
2022-10-05 02:07:29 -07:00
|
|
|
&& me="$(readlink -f "$0")" && cd "${me%/*}" && { [ -d out ] || mkdir out ;} \
|
2022-09-23 13:30:01 -07:00
|
|
|
\
|
2022-10-05 02:59:01 -07:00
|
|
|
&& 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 \
|
2022-09-23 13:21:45 -07:00
|
|
|
\
|
2022-10-05 02:59:01 -07:00
|
|
|
&& bin=/cosmopolitan/bin \
|
2022-10-09 12:39:27 -07:00
|
|
|
&& yes_retrieve cosmo $bin/ape $bin/awk.com $bin/gzip.com $bin/make.com \
|
|
|
|
$bin/sed.com $bin/unbourne.com $bin/unzip.com $bin/zip.com \
|
2022-09-23 13:21:45 -07:00
|
|
|
&& dbg_retrieve cosmo-kuroko /bin/kuroko.com \
|
2022-10-04 04:55:39 -07:00
|
|
|
&& dbg_retrieve cosmo-muon /bin/muon.com \
|
2022-09-23 17:08:10 -07:00
|
|
|
&& dbg_retrieve cosmo-perl /bin/perl.com \
|
2022-10-05 02:59:01 -07:00
|
|
|
&& dbg_retrieve cosmo-yices /bin/kissat.com /bin/yices-sat.com \
|
|
|
|
/bin/yices-smt.com /bin/yices-smt2.com /bin/yices.com \
|
2022-09-23 13:21:45 -07:00
|
|
|
;
|