Ivan Davidov 77f04c6c8a Major structural changes.
- New overlay bundle which provides the MLL sources.
- The build process has been enhanced.
--- Sources are provided as part of the new overlay bundle.
--- The MLL scripts have been refactored to handle the above change.
--- The overlay dependency file has been renamed.
NOTE: at this point some overlay bundles may be broken due to the numerous changes that haven't been fully tested.
2017-11-29 03:55:56 +02:00

41 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
set -e
. ../../common.sh
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i LINKS_SOURCE_URL $MAIN_SRC_DIR/.config | cut -f2 -d'=')
# Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
# Read the 'USE_LOCAL_SOURCE' property from '.config'
USE_LOCAL_SOURCE="$(grep -i USE_LOCAL_SOURCE $MAIN_SRC_DIR/.config | cut -f2 -d'=')"
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
echo "Source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
USE_LOCAL_SOURCE="false"
fi
cd $MAIN_SRC_DIR/source/overlay
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
# Downloading Links source bundle file. The '-c' option allows the download to resume.
echo "Downloading Links source bundle from $DOWNLOAD_URL"
wget -c $DOWNLOAD_URL
else
echo "Using local Links source bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
fi
# Delete folder with previously extracted Links.
echo "Removing Links work area. This may take a while..."
rm -rf $WORK_DIR/overlay/$BUNDLE_NAME
mkdir $WORK_DIR/overlay/$BUNDLE_NAME
# Extract Links to folder 'work/overlay/links'.
# Full path will be something like 'work/overlay/links/links-2.12'.
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/$BUNDLE_NAME
cd $SRC_DIR