stargazing/build-all

64 lines
1.9 KiB
Text
Raw Normal View History

2022-09-23 13:21:45 -07:00
#!/usr/bin/env sh
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 "$@" \
;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 "$@" \
;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-14 16:35:09 -07:00
build() { : \
&& local t="${1?missing argument}" && shift \
&& printf >&2 ' \033[1m\033[7m <-- \033[0m\033[1m ' \
&& printf >&2 '%22sbuilding %-19s%13s' '' "$t" '' \
&& printf >&2 ' \033[1m\033[7m --> \033[0m\n' \
&& podman build -t "$t" "$t" "$@" \
;}
2022-09-23 13:21:45 -07:00
: \
&& me="$(readlink -f "$0")" && cd "${me%/*}" && { [ -d out ] || mkdir out ;} \
2022-10-14 16:35:09 -07:00
;: \
`# phase 1` \
&& build notwa-util \
`# phase 2` \
&& build cosmo-build \
`# phase 3` \
&& build cosmo-assimilate \
&& build cosmo-awk \
&& build cosmo-build-all \
&& build cosmo-dist \
&& build cosmo-make \
&& build cosmo-sed \
`# phase 4` \
&& build cosmo-base \
&& echo build cosmo-chibicc \
&& echo build cosmo-python \
&& echo build cosmo-quickjs \
&& echo build cosmo-sqlite \
&& echo build cosmo-unbourne \
`# phase 5` \
&& build cosmo-kuroko \
&& build cosmo-muon \
&& build cosmo-perl \
&& build cosmo-yices \
2022-09-23 13:21:45 -07:00
\
2022-10-05 02:59:01 -07:00
&& bin=/cosmopolitan/bin \
2022-09-23 13:21:45 -07:00
;