diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-26 16:31:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-26 16:31:15 +0200 |
commit | 0f5498f0bf2f81e7917cc65c45323c472829d29b (patch) | |
tree | bbfdd3431107d48f6fbf829a311a9bd752240c1e | |
parent | 879a40d7a6c56bb9b369d4553255c538a3d80e06 (diff) |
Add -s option (only prepare install scripts) to stage script
-rwxr-xr-x | stage | 53 |
1 files changed, 37 insertions, 16 deletions
@@ -6,6 +6,8 @@ # Packages baseutils/mingw. # -o # Only package baseutils/mingw. +# -s +# Only prepare the install scripts and regenerate toolchain.sha256. # -q # Put packages into the queue instead of staging. Used to update for # queue. @@ -33,7 +35,9 @@ fi mode= base= -only= +base_only= +script_only= + dist_src=staging/0 dist_dst=stage.build2.org:/var/www/stage.build2.org/public/0 @@ -44,7 +48,11 @@ while [ $# -gt 0 ]; do shift ;; -o) - only=true + base_only=true + shift + ;; + -s) + script_only=true shift ;; -q) @@ -65,11 +73,15 @@ while [ $# -gt 0 ]; do esac done +# Note that this structure is seriously hard-wired in the install scripts. +# Specifically, they assume paths in toolchain.sha256 are in the <ver>/<file> +# form. +# mkdir -p "$dist_src/$v" # Generate baseutils if requested. # -if [ -n "$base" ]; then +if [ "$base" = true ]; then cd private/baseutils echo "$v" >version @@ -115,7 +127,7 @@ if [ -n "$base" ]; then mv "/tmp/build2-mingw-$v-x86_64-windows.tar.xz.sha256" "$dist_src/$v/" fi -if [ "$only" = true ]; then +if [ "$base_only" = true ]; then exit 0 fi @@ -126,23 +138,28 @@ mkdir -p /tmp/dist # Dist build2-toolchain. # -# @@ .sha256 sums: make sure they don't contain full paths! +if [ "$script_only" != true ]; then -# Cleanup old stuff. -# -rm -f "$owd/$dist_src/$v"/build2-toolchain-* + # Cleanup old stuff. + # + rm -f "$owd/$dist_src/$v"/build2-toolchain-* -b "dist(build2-toolchain-default/)" \ - "config.dist.archives=$owd/$dist_src/$v/tar.xz $owd/$dist_src/$v/tar.gz" + b "dist(build2-toolchain-default/)" \ + "config.dist.archives=$owd/$dist_src/$v/tar.xz $owd/$dist_src/$v/tar.gz" -cd "$owd/$dist_src/$v/" + cd "$owd/$dist_src/$v/" -tv="$(echo build2-toolchain-*.tar.gz | sed -re 's/build2-toolchain-(.+).tar.gz/\1/')" + tv="$(echo build2-toolchain-*.tar.gz | sed -re 's/build2-toolchain-(.+).tar.gz/\1/')" -sha256sum -b "build2-toolchain-$tv.tar.gz" >"build2-toolchain-$tv.tar.gz.sha256" -sha256sum -b "build2-toolchain-$tv.tar.xz" >"build2-toolchain-$tv.tar.xz.sha256" + sha256sum -b "build2-toolchain-$tv.tar.gz" >"build2-toolchain-$tv.tar.gz.sha256" + sha256sum -b "build2-toolchain-$tv.tar.xz" >"build2-toolchain-$tv.tar.xz.sha256" -cd "$owd" + cd "$owd" +else + cd "$owd/$dist_src/$v/" + tv="$(echo build2-toolchain-*.tar.gz | sed -re 's/build2-toolchain-(.+).tar.gz/\1/')" + cd "$owd" +fi # Prepare the toolchain.sha256 checksums file. # @@ -172,6 +189,7 @@ esac scripts=($(private/install/prepare "$o" "$dist_src")) for f in "${scripts[@]}"; do + info "prepared $f" checksum_line "$f" done @@ -179,7 +197,6 @@ if [ "$mode" = "-p" ]; then exit 0 fi - # Sync the distribution. # # Note that we do the distribution first so that the toolchain changes are @@ -193,6 +210,10 @@ rsync -v -rlpt -c --copy-unsafe-links --prune-empty-dirs --delete-after \ ##fi ## +if [ "$script_only" = true ]; then + exit 0 +fi + # Distribute packages, regenerate and sync the repository. # etc/stage-pkg -c $mode -d apr packaging/apr/libapr1 |