46 lines
1.7 KiB
Bash
Executable file
46 lines
1.7 KiB
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
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~" ;} || return \
|
|
;done \
|
|
&& podman run -v="$out":/out --rm --entrypoint /bin/busybox "$image" \
|
|
cp -- "$@" "/out/" \
|
|
&& for f in "$@" \
|
|
;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() { : \
|
|
&& 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" "$@" \
|
|
;}
|
|
|
|
: \
|
|
&& me="$(readlink -f "$0")" && cd "${me%/*}" && { [ -d out ] || mkdir out ;} \
|
|
\
|
|
&& podman build -t notwa-util notwa-util \
|
|
&& podman build -t cosmo-bootstrap cosmo-bootstrap \
|
|
&& podman build -t cosmo-base cosmo-base \
|
|
&& 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 \
|
|
\
|
|
&& bin=/cosmopolitan/bin \
|
|
&& yes_retrieve cosmo-base $bin/ape $bin/awk.com $bin/gzip.com $bin/make.com \
|
|
$bin/sed.com $bin/unbourne.com $bin/unzip.com $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 /bin/yices-sat.com \
|
|
/bin/yices-smt.com /bin/yices-smt2.com /bin/yices.com \
|
|
;
|