mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 21:56:42 +00:00
scripts/extract: convert to die, PKG_BUILD comment
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
This commit is contained in:
parent
c7c25abb6a
commit
eeb3f94648
@ -2,16 +2,17 @@
|
|||||||
|
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
||||||
|
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
. config/options $1
|
. config/options $1
|
||||||
|
|
||||||
if [ -z "$2" ]; then
|
if [ -z "$2" ]; then
|
||||||
echo "usage: $0 package_name target_dir"
|
die "usage: $0 package_name target_dir"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$PKG_URL" -o -z "$PKG_SOURCE_NAME" ] && exit 1
|
[ -z "$PKG_URL" -o -z "$PKG_SOURCE_NAME" ] && die "$PKG_NAME: PKG_URL or PKG_SOURCE_NAME undefined"
|
||||||
[ ! -d "$SOURCES/$1" -o ! -d "$2" ] && exit 1
|
[ ! -d "$SOURCES/$1" ] && die "$PKG_NAME: $SOURCES/$1 not found"
|
||||||
|
[ ! -d "$2" ] && die "$PKG_NAME: target $2 not found"
|
||||||
|
|
||||||
if [[ ${PKG_URL} =~ ^file:// ]]; then
|
if [[ ${PKG_URL} =~ ^file:// ]]; then
|
||||||
FULL_SOURCE_PATH="$PKG_SOURCE_NAME"
|
FULL_SOURCE_PATH="$PKG_SOURCE_NAME"
|
||||||
@ -22,11 +23,11 @@ fi
|
|||||||
if [ ! -f "$FULL_SOURCE_PATH" -a ! -d "$FULL_SOURCE_PATH" ]; then
|
if [ ! -f "$FULL_SOURCE_PATH" -a ! -d "$FULL_SOURCE_PATH" ]; then
|
||||||
echo "error: File $PKG_SOURCE_NAME doesn't exist for package $1"
|
echo "error: File $PKG_SOURCE_NAME doesn't exist for package $1"
|
||||||
echo "Have you called scripts/extract before scripts/get ?"
|
echo "Have you called scripts/extract before scripts/get ?"
|
||||||
exit 1
|
die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The build system expects packages to be extracted to
|
# The build system expects packages to be extracted to
|
||||||
# $BUILD/$PKG_NAME-$PKG_VERSION.
|
# $PKG_BUILD.
|
||||||
# Try to strip the top level dir from the archive and extract to
|
# Try to strip the top level dir from the archive and extract to
|
||||||
# the correct directory if possible so packages don't need to
|
# the correct directory if possible so packages don't need to
|
||||||
# set PKG_SOURCE_DIR and scripts/unpack doesn't need to rename
|
# set PKG_SOURCE_DIR and scripts/unpack doesn't need to rename
|
||||||
|
Loading…
x
Reference in New Issue
Block a user