2013-07-19 02:35:52 +02:00
|
|
|
#!/bin/bash
|
2011-01-09 23:32:01 +01:00
|
|
|
|
2018-07-16 20:45:36 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 22:01:08 +01:00
|
|
|
|
2018-11-08 09:40:43 +00:00
|
|
|
. config/options "${1}"
|
2009-03-18 13:02:53 +01:00
|
|
|
|
2018-11-08 09:40:43 +00:00
|
|
|
if [ -z "${1}" ]; then
|
|
|
|
|
for i in $(find "${PACKAGES}/" -type f -name "package.mk"); do
|
|
|
|
|
GET_PKG=$(grep "^PKG_NAME=" "${i}" | sed -e "s,\",,g" -e "s,PKG_NAME=,,")
|
|
|
|
|
"${SCRIPTS}"/get "${GET_PKG}"
|
2013-07-17 06:12:14 +02:00
|
|
|
done
|
2010-11-19 00:18:50 +01:00
|
|
|
fi
|
|
|
|
|
|
2018-02-25 11:10:45 +00:00
|
|
|
# Avoid concurrent processing of the same package
|
2018-11-08 09:40:43 +00:00
|
|
|
lock_source_dir() {
|
|
|
|
|
exec 99<"${SOURCES}/${1}"
|
2018-11-13 01:31:20 +00:00
|
|
|
if ! flock --nonblock --exclusive 99; then
|
|
|
|
|
echo "Project/Device ${DEVICE:-${PROJECT}} waiting, to avoid concurrent processing of ${1}..."
|
|
|
|
|
flock --exclusive 99
|
|
|
|
|
fi
|
2018-02-25 11:10:45 +00:00
|
|
|
}
|
2017-05-05 11:36:22 +01:00
|
|
|
|
2018-11-08 09:40:43 +00:00
|
|
|
if [ -n "${PKG_URL}" -a -n "${PKG_SOURCE_NAME}" ]; then
|
|
|
|
|
mkdir -p "${SOURCES}/${1}"
|
2018-02-25 11:10:45 +00:00
|
|
|
|
2018-11-08 09:40:43 +00:00
|
|
|
PACKAGE="${SOURCES}/${1}/${PKG_SOURCE_NAME}"
|
2018-02-25 11:10:45 +00:00
|
|
|
|
2018-11-08 09:40:43 +00:00
|
|
|
STAMP_URL="${PACKAGE}.url"
|
|
|
|
|
STAMP_SHA="${PACKAGE}.sha256"
|
2018-02-25 11:10:45 +00:00
|
|
|
|
|
|
|
|
# determine get handler based on protocol and/or filename
|
|
|
|
|
case "${PKG_URL}" in
|
2024-07-06 11:17:12 +02:00
|
|
|
git://* | *.git)
|
|
|
|
|
get_handler="git"
|
|
|
|
|
;;
|
2018-02-25 21:48:40 +00:00
|
|
|
file://*)
|
2024-07-06 11:17:12 +02:00
|
|
|
get_handler="file"
|
|
|
|
|
;;
|
2018-02-25 11:10:45 +00:00
|
|
|
*)
|
2024-07-06 11:17:12 +02:00
|
|
|
get_handler="archive"
|
|
|
|
|
;;
|
2018-02-25 11:10:45 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
if ! listcontains "${GET_HANDLER_SUPPORT}" "${get_handler}"; then
|
2018-11-08 09:40:43 +00:00
|
|
|
die "ERROR: get handler \"${get_handler}\" is not supported, unable to get package ${1} - aborting!"
|
2018-02-25 11:10:45 +00:00
|
|
|
else
|
|
|
|
|
get_handler="${SCRIPTS}/get_${get_handler}"
|
2018-11-08 09:40:43 +00:00
|
|
|
if [ ! -f "${get_handler}" ]; then
|
|
|
|
|
die "ERROR: get handler \"${get_handler}\" does not exist, unable to get package ${1} - aborting!"
|
2018-02-25 11:10:45 +00:00
|
|
|
fi
|
2018-11-08 09:40:43 +00:00
|
|
|
|
|
|
|
|
. "${get_handler}"
|
2018-02-25 11:10:45 +00:00
|
|
|
fi
|
2009-03-18 13:02:53 +01:00
|
|
|
fi
|
2016-01-07 07:45:31 +00:00
|
|
|
|
|
|
|
|
exit 0
|