aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-03-29 17:37:01 +0200
committerPatrick Spek <p.spek@tyil.nl>2020-03-29 17:37:01 +0200
commit1a3c36278c39a275455a0a524f8a494d90f77324 (patch)
treef071b471f1eb123fe0260974bd22eb759925e3d6
parent98c35cddda61236ad92e1ba47cf52ab86a1d16f3 (diff)
Consolidate fetch data in fetch_core.txt
-rw-r--r--README.md9
-rw-r--r--etc/dist_moarvm.txt2
-rw-r--r--etc/dist_nqp.txt2
-rw-r--r--etc/dist_rakudo.txt2
-rw-r--r--etc/fetch_core.txt12
-rw-r--r--lib/actions/clean.bash1
-rw-r--r--lib/actions/dist.bash3
-rw-r--r--lib/actions/fetch.bash4
-rw-r--r--lib/actions/install.bash20
-rw-r--r--lib/actions/test.bash2
10 files changed, 34 insertions, 23 deletions
diff --git a/README.md b/README.md
index 8440553..7d09641 100644
--- a/README.md
+++ b/README.md
@@ -83,10 +83,8 @@ extracted sources are moved into the `dist` directory.
Your first step will be to prepare a new tarball.
- rstar clean # Clean up old sources
- $EDITOR etc/dist_moarvm.txt # Update values as necessary
- $EDITOR etc/dist_nqp.txt # Update values as necessary
- $EDITOR etc/dist_rakudo.txt # Update values as necessary
+ rstar clean -s # Clean up old sources
+ $EDITOR etc/fetch_core.txt # Update values as necessary
$EDITOR etc/modules.txt # Update values as necessary
rstar fetch # Download new sources
rstar install # Compile and install Rakudo Star
@@ -96,7 +94,8 @@ Your first step will be to prepare a new tarball.
Once you have a tarball, you should upload it to be available to others. Common
places include:
-- rakudo.org (ask around in #raku-dev for someone to help you if needed);
+- [rakudo.org](https://rakudo.org/) (ask around in `#raku-dev` for someone to
+ help you if needed);
- Your personal website.
Next up, you will have to tell people of the new distribution tarball existing.
diff --git a/etc/dist_moarvm.txt b/etc/dist_moarvm.txt
deleted file mode 100644
index eb62af2..0000000
--- a/etc/dist_moarvm.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-url=https://www.moarvm.org/releases/MoarVM-%s.tar.gz
-version=2020.01.1
diff --git a/etc/dist_nqp.txt b/etc/dist_nqp.txt
deleted file mode 100644
index daf0962..0000000
--- a/etc/dist_nqp.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-url=https://github.com/perl6/nqp/releases/download/%s/nqp-%s.tar.gz
-version=2020.01
diff --git a/etc/dist_rakudo.txt b/etc/dist_rakudo.txt
deleted file mode 100644
index 2000f5c..0000000
--- a/etc/dist_rakudo.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-url=https://github.com/rakudo/rakudo/releases/download/%s/rakudo-%s.tar.gz
-version=2020.01
diff --git a/etc/fetch_core.txt b/etc/fetch_core.txt
new file mode 100644
index 0000000..7c48386
--- /dev/null
+++ b/etc/fetch_core.txt
@@ -0,0 +1,12 @@
+# These are the version numbers of the core components of Rakudo Star. Change
+# these if you want to create a distribution containing different core
+# component versions.
+moarvm_version=2020.01.1
+nqp_version=2020.01
+rakudo_version=2020.01
+
+# These are the URLs to fetch the sources from. You can use %s in the URLs as a
+# placeholder for the version number, specified above.
+moarvm_url=https://www.moarvm.org/releases/MoarVM-%s.tar.gz
+nqp_url=https://github.com/perl6/nqp/releases/download/%s/nqp-%s.tar.gz
+rakudo_url=https://github.com/rakudo/rakudo/releases/download/%s/rakudo-%s.tar.gz
diff --git a/lib/actions/clean.bash b/lib/actions/clean.bash
index 0ed521d..eec2736 100644
--- a/lib/actions/clean.bash
+++ b/lib/actions/clean.bash
@@ -27,5 +27,6 @@ action() {
if [[ $clean_src ]]
then
rm -fr -- "$BASEDIR/src"
+ rm -f -- "$BASEDIR/etc/epoch.txt"
fi
}
diff --git a/lib/actions/dist.bash b/lib/actions/dist.bash
index 137576d..434c981 100644
--- a/lib/actions/dist.bash
+++ b/lib/actions/dist.bash
@@ -45,6 +45,9 @@ action() {
# Include the component sources
dist_include "/src"
+ # Set the SOURCE_DATE_EPOCH for the installation phase
+ printf "%d\n" "$SOURCE_DATE_EPOCH" > "$WORKDIR/etc/epoch.txt"
+
# Add a MANIFEST.txt
chgdir "$WORKDIR"
touch MANIFEST.txt
diff --git a/lib/actions/fetch.bash b/lib/actions/fetch.bash
index 8582865..8af563f 100644
--- a/lib/actions/fetch.bash
+++ b/lib/actions/fetch.bash
@@ -37,8 +37,8 @@ download_core() {
local source
local destination
- version="$(config_etc_kv "dist_$1.txt" "version")"
- source="$(config_etc_kv "dist_$1.txt" "url" | sed "s/%s/$version/g")"
+ version="$(config_etc_kv "fetch_core.txt" "${1}_version")"
+ source="$(config_etc_kv "fetch_core.txt" "${1}_url" | sed "s/%s/$version/g")"
destination="$BASEDIR/src/$1-$version"
if [[ -d $destination ]]
diff --git a/lib/actions/install.bash b/lib/actions/install.bash
index 42c27f5..0295fb1 100644
--- a/lib/actions/install.bash
+++ b/lib/actions/install.bash
@@ -18,6 +18,7 @@ action() {
local SOURCE_DATE_EPOCH
local duration
local init
+ local prefix_absolute
while getopts ":b:p:" opt
do
@@ -32,9 +33,12 @@ action() {
# Prepare environment for a reproducible install
LC_ALL=C.UTF-8
- SOURCE_DATE_EPOCH="$(git log -1 --pretty=format:%at)"
- debug "SOURCE_DATE_EPOCH set to $SOURCE_DATE_EPOCH"
+ if [[ -f "$BASEDIR/etc/epoch.txt" ]]
+ then
+ SOURCE_DATE_EPOCH="$(head -n1 "$BASEDIR/etc/epoch.txt")"
+ debug "SOURCE_DATE_EPOCH set to $SOURCE_DATE_EPOCH (epoch.txt)"
+ fi
export LC_ALL
export SOURCE_DATE_EPOCH
@@ -49,6 +53,10 @@ action() {
# on
init="$(date +%s)"
+ # Use an absolute path when reporting about the installation path
+ prefix_absolute="$(CDPATH="" cd -- "$RSTAR_PREFIX" && pwd -P)"
+ info "Installing Raku in $prefix_absolute"
+
# Create the installation directory
mkdir -p -- "$RSTAR_PREFIX"
@@ -78,16 +86,10 @@ action() {
}
action_install_core() {
- local prefix_absolute
-
- prefix_absolute="$(CDPATH="" cd -- "$RSTAR_PREFIX" && pwd -P)"
-
- info "Installing Raku in $prefix_absolute"
-
# Compile all core components
for component in moarvm nqp rakudo
do
- VERSION="$(config_etc_kv "dist_$component.txt" "version")" \
+ VERSION="$(config_etc_kv "fetch_core.txt" "${component}_version")" \
build_"$component" \
--prefix="$RSTAR_PREFIX" \
--relocatable \
diff --git a/lib/actions/test.bash b/lib/actions/test.bash
index f95be96..820a689 100644
--- a/lib/actions/test.bash
+++ b/lib/actions/test.bash
@@ -104,7 +104,7 @@ action_test_spectest() {
local source
destination="$(tmpdir)"
- source="$BASEDIR/src/rakudo-$(config_etc_kv "dist_rakudo.txt" "version")"
+ source="$BASEDIR/src/rakudo-$(config_etc_kv "fetch_core.txt" "rakudo_version")"
notice "Using $destination as working directory"