master
shark 5 years ago
parent ab36687c11
commit 4e850b9652

@ -1,44 +1,37 @@
#!/bedrock/libexec/busybox sh #!/bedrock/libexec/busybox sh
. /bedrock/share/common-code . /bedrock/share/common-code
echo "Fetching latest commits from repository..."
if which brl > /dev/null 2>&1; then if [ -d /bedrock/cache/bedrocklinux-userland ]; then
echo "Fetching latest commits from repository..." less_lethal_rm_rf /bedrock/cache/bedrocklinux-userland
if [ -d /bedrock/cache/bedrocklinux-userland ]; then fi
less_lethal_rm_rf /bedrock/cache/bedrocklinux-userland mkdir -p /bedrock/cache
cd /bedrock/cache
git clone https://github.com/bedrocklinux/bedrocklinux-userland
cd bedrocklinux-userland
git checkout 0.7 -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 fi
mkdir -p /bedrock/cache
cd /bedrock/cache
git clone https://github.com/bedrocklinux/bedrocklinux-userland
cd bedrocklinux-userland
git checkout 0.7 -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
if ! grep -q BEDROCK_VERSION Makefile; then # Fix bug with building BusyBox
sed 's/VERSION/BEDROCK_VERSION/g' Makefile > Makefile-new
mv Makefile-new Makefile
fi
make SKIPSIGN=true -j $(nproc) BEDROCK_VERSION="${newest_version}"
/bedrock/libexec/busybox sh "bedrock-linux-${newest_version}-$(uname -m).sh" --force-update
# Maybe clean up here in the future
else else
echo "Bedrock Linux is not installed!" echo "Building Bedrock Linux version ${newest_version}"
return fi
# Start the build process
make clean
if ! grep -q BEDROCK_VERSION Makefile; then # Fix bug with building BusyBox
sed 's/VERSION/BEDROCK_VERSION/g' Makefile > Makefile-new
mv Makefile-new Makefile
fi fi
exit_success make SKIPSIGN=true -j $(nproc) BEDROCK_VERSION="${newest_version}"
/bedrock/libexec/busybox sh "bedrock-linux-${newest_version}-$(uname -m).sh" --force-update
# Maybe clean up here in the future
exit_success
Loading…
Cancel
Save