scripts/get_file: add file:// support - exists only for logging

This commit is contained in:
MilhouseVH 2018-02-25 21:48:40 +00:00
parent afcecf7b0d
commit d246e986d2
3 changed files with 24 additions and 0 deletions

View File

@ -100,6 +100,8 @@ if [ -n "$PKG_URL" -a -z "$PKG_SOURCE_NAME" ]; then
fi
if [[ ${PKG_URL} =~ .git$ || ${PKG_URL} =~ ^git:// ]]; then
PKG_SOURCE_NAME=${PKG_NAME}-${PKG_VERSION}.tar.gz
elif [[ ${PKG_URL} =~ ^file:// ]]; then
PKG_SOURCE_NAME=${PKG_URL#file://}
else
PKG_SOURCE_NAME="${PKG_URL##*/}"
case $PKG_SOURCE_NAME in

View File

@ -49,6 +49,8 @@ if [ -n "$PKG_URL" -a -n "$PKG_SOURCE_NAME" ]; then
case "${PKG_URL}" in
git://*|*.git)
get_handler="git";;
file://*)
get_handler="file";;
*)
get_handler="archive";;
esac

20
scripts/get_file Executable file
View File

@ -0,0 +1,20 @@
################################################################################
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2018-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
printf "%${BUILD_INDENT}c $(print_color CLR_GET "GET") $1 (file)\n" ' '>&$SILENT_OUT
export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE))