summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xstage53
1 files changed, 37 insertions, 16 deletions
diff --git a/stage b/stage
index 40d5bee..68b2fde 100755
--- a/stage
+++ b/stage
@@ -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