From 4dd6d96c16adeee22e88c167f3b8deef683939e1 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Tue, 5 Nov 2019 09:17:39 +0100
Subject: Update scripts
---
bin/build-release.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
create mode 100755 bin/build-release.sh
(limited to 'bin/build-release.sh')
diff --git a/bin/build-release.sh b/bin/build-release.sh
new file mode 100755
index 0000000..0c32d14
--- /dev/null
+++ b/bin/build-release.sh
@@ -0,0 +1,56 @@
+#! /usr/bin/env sh
+
+readonly BASEDIR=$(CDPATH="" cd -- "$(dirname -- "$0")/.." && pwd -P)
+
+main()
+{
+ # Handle opts
+ opts "$@"
+ shift "$OPTS"
+ unset OPTS
+
+ # Show help
+ [ "$OPT_HELP_ONLY" ] && usage && exit 0
+ [ -z "$1" ] && usage && exit 1
+
+ # Build Rakudo Star from the release tarball
+ mkdir -p -- "$BASEDIR/work/build"
+ cd -- "$BASEDIR/work/build"
+ tar xzf "$BASEDIR/work/release/rakudo-star-$1.tar.gz"
+ cd "rakudo-star-$1"
+ perl Configure.pl --prefix="$BASEDIR/work/install" --backend=moar --gen-moar
+}
+
+opts()
+{
+ OPTS=0
+
+ while getopts ":h" opt
+ do
+ case "$opt" in
+ h) OPT_HELP_ONLY=1 ;;
+ *)
+ printf "Invalid option passed: %s\n" "$OPTARG" >&2
+ ;;
+ esac
+ done
+}
+
+usage()
+{
+ cat <
+
+Build Rakudo Star from a release tarball in $BASEDIR/work/release. This tarball
+can be easily made using mkrelease.sh in this repository. This will not install
+Raku in $BASEDIR/work/install, only build all the required components needed
+for testing.
+
+Options:
+ -h Show this help text and exit.
+EOF
+}
+
+main "$@"
--
cgit v1.1
From 017b7347f27a1553ff39d7b77ad7c65b731af03f Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Tue, 28 Jan 2020 15:52:23 +0100
Subject: Update the utilities to make building a new release easier
---
bin/build-release.sh | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
(limited to 'bin/build-release.sh')
diff --git a/bin/build-release.sh b/bin/build-release.sh
index 0c32d14..fc8319e 100755
--- a/bin/build-release.sh
+++ b/bin/build-release.sh
@@ -13,27 +13,41 @@ main()
[ "$OPT_HELP_ONLY" ] && usage && exit 0
[ -z "$1" ] && usage && exit 1
+ prefix="${OPT_PREFIX:-$BASEDIR/work/install}"
+
+ # Exit after every failure from here on out
+ set -e
+
# Build Rakudo Star from the release tarball
mkdir -p -- "$BASEDIR/work/build"
cd -- "$BASEDIR/work/build"
tar xzf "$BASEDIR/work/release/rakudo-star-$1.tar.gz"
cd "rakudo-star-$1"
- perl Configure.pl --prefix="$BASEDIR/work/install" --backend=moar --gen-moar
+ perl Configure.pl --prefix="$prefix" --backend=moar --gen-moar
+
+ if [ "$OPT_INSTALL" ]
+ then
+ make install
+ fi
}
opts()
{
OPTS=0
- while getopts ":h" opt
+ while getopts ":hip:" opt
do
case "$opt" in
h) OPT_HELP_ONLY=1 ;;
+ i) OPT_INSTALL=1 ; OPTS=$(( OPTS + 1 )) ;;
+ p) OPT_PREFIX=$OPTARG ; OPTS=$(( OPTS + 2 )) ;;
*)
printf "Invalid option passed: %s\n" "$OPTARG" >&2
;;
esac
done
+
+ unset opt
}
usage()
@@ -41,15 +55,18 @@ usage()
cat <
+ $(basename "$0") [-i [-p ]]
Build Rakudo Star from a release tarball in $BASEDIR/work/release. This tarball
-can be easily made using mkrelease.sh in this repository. This will not install
-Raku in $BASEDIR/work/install, only build all the required components needed
-for testing.
+can be easily made using mkrelease.sh in this repository. If you don't specify
+-i, this will not install Raku in $BASEDIR/work/install. This can be convenient
+if you just want to run some simple tests.
Options:
-h Show this help text and exit.
+ -i Also install the freshly built Rakudo Star.
+ -p Set a prefix to install Rakudo Star into. Defaults to ./work/install,
+ relative to the repository root.
EOF
}
--
cgit v1.1