From 1a3c36278c39a275455a0a524f8a494d90f77324 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sun, 29 Mar 2020 17:37:01 +0200 Subject: Consolidate fetch data in fetch_core.txt --- README.md | 9 ++++----- etc/dist_moarvm.txt | 2 -- etc/dist_nqp.txt | 2 -- etc/dist_rakudo.txt | 2 -- etc/fetch_core.txt | 12 ++++++++++++ lib/actions/clean.bash | 1 + lib/actions/dist.bash | 3 +++ lib/actions/fetch.bash | 4 ++-- lib/actions/install.bash | 20 +++++++++++--------- lib/actions/test.bash | 2 +- 10 files changed, 34 insertions(+), 23 deletions(-) delete mode 100644 etc/dist_moarvm.txt delete mode 100644 etc/dist_nqp.txt delete mode 100644 etc/dist_rakudo.txt create mode 100644 etc/fetch_core.txt 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" -- cgit v1.1