avoid rebuilds during updates

This commit is contained in:
Lephenixnoir 2021-01-07 18:31:52 +01:00
parent c07032e949
commit 3f985b1557
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
4 changed files with 20 additions and 1 deletions

View File

@ -1,5 +1,8 @@
#! /usr/bin/env bash
# Avoid rebuilds of the same version
[[ ! -d build ]] && exit 0
source util.sh
cd build

View File

@ -3,9 +3,22 @@
source util.sh
VERSION=$1
PREFIX="$2"
URL="https://ftp.gnu.org/gnu/binutils/binutils-$VERSION.tar.xz"
ARCHIVE=$(basename "$URL")
# Avoid rebuilds of the same version
existing_as="$PREFIX/bin/sh-elf-as"
if [[ -f "$existing_as" ]]; then
existing_version=$($existing_as --version | head -n 1 | grep -Eo '[0-9.]+$')
if [[ $existing_version == $VERSION ]]; then
echo "$TAG Version $VERSION already installed, skipping rebuild"
exit 0
fi
fi
# Check dependencies for binutils and GCC
if command -v apt >/dev/null 2>&1; then

View File

@ -8,7 +8,7 @@ include giteapc-config-$(GITEAPC_CONFIG).make
endif
configure:
@ ./configure.sh $(VERSION)
@ ./configure.sh $(VERSION) "$(PREFIX)"
build:
@ ./build.sh

View File

@ -1,5 +1,8 @@
#! /usr/bin/env bash
# Avoid rebuilds of the same version
[[ ! -d build ]] && exit 0
source util.sh
PREFIX="$1"