File tree Expand file tree Collapse file tree 3 files changed +52
-5
lines changed Expand file tree Collapse file tree 3 files changed +52
-5
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,8 @@ GIT_ARCHIVE="${DIST_ARCHIVE_BASE}/${DISTNAME}.tar.gz"
196
196
# Create the source tarball if not already there
197
197
if [ ! -e " $GIT_ARCHIVE " ]; then
198
198
mkdir -p " $( dirname " $GIT_ARCHIVE " ) "
199
- git archive --prefix=" ${DISTNAME} /" --output=" $GIT_ARCHIVE " HEAD
199
+ CONFIG_SITE=" ${BASEPREFIX} /${HOST} /share/config.site" \
200
+ contrib/guix/libexec/make_release_tarball.sh " ${GIT_ARCHIVE} " " ${DISTNAME} "
200
201
fi
201
202
202
203
mkdir -p " $OUTDIR "
@@ -239,8 +240,6 @@ mkdir -p "$DISTSRC"
239
240
# Extract the source tarball
240
241
tar --strip-components=1 -xf " ${GIT_ARCHIVE} "
241
242
242
- ./autogen.sh
243
-
244
243
# Configure this DISTSRC for $HOST
245
244
# shellcheck disable=SC2086
246
245
env CONFIG_SITE=" ${BASEPREFIX} /${HOST} /share/config.site" \
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ # Copyright (c) 2020 The Bitcoin Core developers
3
+ # Distributed under the MIT software license, see the accompanying
4
+ # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
+ #
6
+ # A helper script to generate source release tarball
7
+
8
+ export LC_ALL=C
9
+ set -ex
10
+
11
+ [ " $# " -ge 2 ]
12
+
13
+ GIT_ARCHIVE=" $1 "
14
+ DISTNAME=" $2 "
15
+
16
+ git archive --prefix=" ${DISTNAME} /" HEAD | tar -xp
17
+
18
+ # Generate correct build info file from git, before we lose git
19
+ GIT_BUILD_INFO=" $( share/genbuild.sh /dev/stdout) "
20
+ sed ' s/\/\/ No build information available/' " ${GIT_BUILD_INFO} " ' /' -i " ${DISTNAME} /share/genbuild.sh"
21
+
22
+ cd " ${DISTNAME} "
23
+
24
+ ./autogen.sh
25
+ ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking
26
+ make distclean
27
+
28
+ cd ..
29
+ tar \
30
+ --format=ustar \
31
+ --exclude autom4te.cache \
32
+ --exclude .deps \
33
+ --exclude .git \
34
+ --sort=name \
35
+ --mode=' u+rw,go+r-w,a+X' --owner=0 --group=0 \
36
+ --mtime=" ${REFERENCE_DATETIME} " \
37
+ -c " ${DISTNAME} " | \
38
+ gzip -9n \
39
+ > " ${GIT_ARCHIVE} "
40
+
41
+ rm -rf " ${DISTNAME} "
Original file line number Diff line number Diff line change 18
18
exit 1
19
19
fi
20
20
21
+ # This checks that we are actually part of the intended git repository, and not just getting info about some unrelated git repository that the code happens to be in a directory under
22
+ git_check_in_repo () {
23
+ ! { git status --porcelain -uall --ignored " $@ " 2> /dev/null || echo ' ??' ; } | grep -q ' ?'
24
+ }
25
+
21
26
GIT_TAG=" "
22
27
GIT_COMMIT=" "
23
- if [ " ${BITCOIN_GENBUILD_NO_GIT} " != " 1" ] && [ -e " $( command -v git) " ] && [ " $( git rev-parse --is-inside-work-tree 2> /dev/null) " = " true" ]; then
28
+ if [ " ${BITCOIN_GENBUILD_NO_GIT} " != " 1" ] && [ -e " $( command -v git) " ] && [ " $( git rev-parse --is-inside-work-tree 2> /dev/null) " = " true" ] && git_check_in_repo share/genbuild.sh ; then
24
29
# clean 'dirty' status of touched files that haven't been modified
25
30
git diff > /dev/null 2> /dev/null
26
31
@@ -40,7 +45,9 @@ if [ -n "$GIT_TAG" ]; then
40
45
elif [ -n " $GIT_COMMIT " ]; then
41
46
NEWINFO=" #define BUILD_GIT_COMMIT \" $GIT_COMMIT \" "
42
47
else
43
- NEWINFO=" // No build information available"
48
+ # NOTE: The NEWINFO line below this comment gets replaced by a string-match in contrib/guix/libexec/make_release_tarball.sh
49
+ # If changing it, update the script too!
50
+ NEWINFO=' // No build information available'
44
51
fi
45
52
46
53
# only update build.h if necessary
You can’t perform that action at this time.
0 commit comments