You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bedrock-git/bedrock-linux-99.99.99-x86_...

41 lines
1.4 KiB
Bash

#!/usr/bin/env bash
. /bedrock/share/common-code
if which brl > /dev/null 2>&1; then
echo "Fetching latest commits from repository..."
if [ -d /bedrock/cache/bedrocklinux-userland ]; then
cd /bedrock/cache/bedrocklinux-userland
git pull -q
else
mkdir -p /bedrock/cache
cd /bedrock/cache
git clone https://github.com/bedrocklinux/bedrocklinux-userland
cd bedrocklinux-userland
git checkout 0.7beta -q
fi
current_version="$(awk '{print$3}' </bedrock/etc/bedrock-release)"
newest_version=$(awk -F= '/^VERSION=/{print$2}' Makefile | sed 's/[a-z].*$//')-git-$(git log | grep -c "^commit")
echo "Current Version: ${current_version}"
echo "Newest Version: ${newest_version}"
if ver_cmp_first_newer ${current_version} ${newest_version}; then
if [ ${#current_version} -le ${#newest_version} ]; then
echo "Building for the first time. Building Bedrock Linux version ${newest_version}"
else
echo "Up to date with the latest commit, nothing to do."
exit
fi
else
echo "Building Bedrock Linux version ${newest_version}"
fi
# Start the build process
make clean
make SKIPSIGN=true -j $(nproc) VERSION="${newest_version}"
./bedrock-linux-${newest_version}-$(uname -m).sh --force-update
# Maybe clean up here in the future
else
echo "Bedrock Linux is not installed!"
return
fi