mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
gitian: Limit sourced script to just assignments
Previously, the sourced script would create the source tarball. Now, it only assigns variables and the source-ing script has more flexibility in determining what to do with these variables. See later commit showing how this flexibility is useful in our Guix builds.
This commit is contained in:
parent
6e3fc7492a
commit
395c1137f6
5 changed files with 39 additions and 29 deletions
12
contrib/gitian-descriptors/assign_DISTNAME
Executable file
12
contrib/gitian-descriptors/assign_DISTNAME
Executable file
|
@ -0,0 +1,12 @@
|
|||
# Copyright (c) 2020 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#
|
||||
# A helper script to be sourced into the gitian descriptors
|
||||
|
||||
if RECENT_TAG="$(git describe --exact-match HEAD)"; then
|
||||
VERSION="${RECENT_TAG#v}"
|
||||
else
|
||||
VERSION="$(git rev-parse --short HEAD)"
|
||||
fi
|
||||
DISTNAME="bitcoin-${VERSION}"
|
|
@ -140,9 +140,15 @@ script: |
|
|||
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
|
||||
export PATH=${WRAP_DIR}:${PATH}
|
||||
|
||||
# Create the git archive, and define DISTNAME and GIT_ARCHIVE variables.
|
||||
# shellcheck source=contrib/gitian-descriptors/make_git_archive
|
||||
source contrib/gitian-descriptors/make_git_archive
|
||||
# Define DISTNAME variable.
|
||||
# shellcheck source=contrib/gitian-descriptors/assign_DISTNAME
|
||||
source contrib/gitian-descriptors/assign_DISTNAME
|
||||
|
||||
GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
|
||||
|
||||
# Create the source tarball
|
||||
mkdir -p "$(dirname "$GIT_ARCHIVE")"
|
||||
git archive --output="$GIT_ARCHIVE" HEAD
|
||||
|
||||
ORIGPATH="$PATH"
|
||||
# Extract the git archive into a dir for each host and build
|
||||
|
|
|
@ -103,9 +103,15 @@ script: |
|
|||
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
|
||||
export PATH=${WRAP_DIR}:${PATH}
|
||||
|
||||
# Create the git archive, and define DISTNAME and GIT_ARCHIVE variables.
|
||||
# shellcheck source=contrib/gitian-descriptors/make_git_archive
|
||||
source contrib/gitian-descriptors/make_git_archive
|
||||
# Define DISTNAME variable.
|
||||
# shellcheck source=contrib/gitian-descriptors/assign_DISTNAME
|
||||
source contrib/gitian-descriptors/assign_DISTNAME
|
||||
|
||||
GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
|
||||
|
||||
# Create the source tarball
|
||||
mkdir -p "$(dirname "$GIT_ARCHIVE")"
|
||||
git archive --output="$GIT_ARCHIVE" HEAD
|
||||
|
||||
ORIGPATH="$PATH"
|
||||
# Extract the git archive into a dir for each host and build
|
||||
|
|
|
@ -108,9 +108,15 @@ script: |
|
|||
create_per-host_compiler_wrapper "${REFERENCE_DATETIME}"
|
||||
export PATH=${WRAP_DIR}:${PATH}
|
||||
|
||||
# Create the git archive, and define DISTNAME and GIT_ARCHIVE variables.
|
||||
# shellcheck source=contrib/gitian-descriptors/make_git_archive
|
||||
source contrib/gitian-descriptors/make_git_archive
|
||||
# Define DISTNAME variable.
|
||||
# shellcheck source=contrib/gitian-descriptors/assign_DISTNAME
|
||||
source contrib/gitian-descriptors/assign_DISTNAME
|
||||
|
||||
GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
|
||||
|
||||
# Create the source tarball
|
||||
mkdir -p "$(dirname "$GIT_ARCHIVE")"
|
||||
git archive --output="$GIT_ARCHIVE" HEAD
|
||||
|
||||
ORIGPATH="$PATH"
|
||||
# Extract the git archive into a dir for each host and build
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
# Copyright (c) 2020 The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#
|
||||
# A helper script to be sourced into the gitian descriptors
|
||||
|
||||
mkdir -p ${OUTDIR}/src
|
||||
RECENT_TAG=$(git describe --abbrev=0 HEAD)
|
||||
if [ $RECENT_TAG = $(git describe HEAD) ]; then
|
||||
if [[ $RECENT_TAG == v* ]]; then
|
||||
VERSION=${RECENT_TAG:1}
|
||||
else
|
||||
VERSION=$RECENT_TAG
|
||||
fi
|
||||
else
|
||||
VERSION=$(git rev-parse --short HEAD)
|
||||
fi
|
||||
DISTNAME=bitcoin-${VERSION}
|
||||
GIT_ARCHIVE="${OUTDIR}/src/${DISTNAME}.tar.gz"
|
||||
git archive --output=$GIT_ARCHIVE HEAD
|
Loading…
Reference in a new issue