Skip to content

Commit

Permalink
release-source: Don't build dist tarball out of tree
Browse files Browse the repository at this point in the history
Recent cockpit fails with that (that's not how we test it in CI), and
it's making the build unnecessarily non-standard. Do exactly what we do
in CI instead.

Simplify the code to only care about autogen.sh (cockpit) or plain
Makefile (starter-kit-like projects).

Now it is easy and straightforward to see what this code is actually
doing.
  • Loading branch information
martinpitt committed Feb 17, 2021
1 parent 96f47d4 commit 2ef0e26
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions release/release-source
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@ message()
echo "release-source: $@" >&2
}

# Runs autogen.sh or configure in the source directory
# with a $(builddir) subdirectory of '_build'
# $1: The source directory
autogen_or_configure()
{
mkdir -p $1/_build
if [ -x $1/autogen.sh ]; then
( cd $1 && NOCONFIGURE=1 ./autogen.sh && cd _build && ../configure )
else
( cd $1/_build && ../configure )
fi
}

# Copies all tarballs from build into source directory, clears
# all previously existing tarballs, and prints name of first tarball
# $1: The make build directory
Expand Down Expand Up @@ -105,19 +92,12 @@ prepare()
git clone -q . $repodir
git -C $repodir checkout -q --detach $TAG

if [ -x ./autogen.sh ] || [ -x ./configure ]; then
is_autotools=1
else
is_autotools=
fi

trace "Creating tarball"

if [ -n "$is_autotools" ]; then
if [ -x ./autogen.sh ]; then
# autotools based projects
autogen_or_configure $repodir
$MAKE -C $repodir/_build dist
output_tarballs $repodir/_build $SOURCE
(cd $repodir; ./autogen.sh && $MAKE dist)
output_tarballs $repodir $SOURCE
else
# plain Makefile projects
$MAKE -C $repodir dist || $MAKE -C $repodir dist-gzip
Expand Down

0 comments on commit 2ef0e26

Please sign in to comment.