avoid rebuilds during updates

This commit is contained in:
Lephenixnoir 2021-01-08 10:00:34 +01:00
parent 959402208f
commit 4e3a4abc9b
Signed by untrusted user: 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/gcc/gcc-$VERSION/gcc-$VERSION.tar.xz"
ARCHIVE=$(basename "$URL")
# Avoid rebuilds of the same version
existing_gcc="$PREFIX/bin/sh-elf-gcc"
if [[ -f "$existing_gcc" ]]; then
existing_version=$(sh-elf-gcc --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
# Download archive
if [[ -f "$ARCHIVE" ]]; then

View File

@ -9,7 +9,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"