mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #3106 from MilhouseVH/le90_buildsystem_fixup
scripts/get_git: fix a couple of errors
This commit is contained in:
commit
cf9a0c97bd
@ -55,7 +55,7 @@ GIT_SUBMODULE_PARAMS=""
|
||||
|
||||
if [ -n "${PKG_GIT_CLONE_DEPTH}" ]; then
|
||||
if [[ "${PKG_GIT_CLONE_DEPTH}" =~ ^[0-9]+$ ]]; then
|
||||
GIT_CLONE_PARAMS="$GIT_CLONE_PARAMS --depth ${PKG_GIT_CLONE_DEPTH}"
|
||||
GIT_CLONE_PARAMS="${GIT_CLONE_PARAMS} --depth ${PKG_GIT_CLONE_DEPTH}"
|
||||
else
|
||||
die "ERROR: PKG_GIT_CLONE_DEPTH is not a number! (${PKG_GIT_CLONE_DEPTH})"
|
||||
fi
|
||||
@ -70,7 +70,7 @@ if [ -n "${PKG_GIT_SUBMODULE_DEPTH}" ]; then
|
||||
fi
|
||||
|
||||
GIT_FOUND="no"
|
||||
opwd=$(pwd)
|
||||
opwd="$(pwd)"
|
||||
for d in "${SOURCES}/${1}/${1}-"* ; do
|
||||
if [ -d "${d}/.git" ]; then
|
||||
if [ "${GIT_FOUND}" = "no" ]; then
|
||||
@ -95,7 +95,7 @@ for d in "${SOURCES}/${1}/${1}-"* ; do
|
||||
cd "${opwd}"
|
||||
rm -rf "${d}"
|
||||
fi
|
||||
if [ "$GIT_FOUND" = "yes" ]; then
|
||||
if [ "${GIT_FOUND}" = "yes" ]; then
|
||||
printf "%${BUILD_INDENT}c $(print_color CLR_GET "GIT PULL") ${1}\n" ' '>&$SILENT_OUT
|
||||
git pull
|
||||
cd "${opwd}"
|
||||
@ -115,7 +115,7 @@ cd "${opwd}"
|
||||
|
||||
if [ "${GIT_FOUND}" = "no" ]; then
|
||||
printf "%${BUILD_INDENT}c $(print_color CLR_GET "GIT CLONE") ${1}\n" ' '>&$SILENT_OUT
|
||||
git clone "${GIT_CLONE_PARAMS}" "${PKG_URL}" "${PACKAGE}"
|
||||
git clone ${GIT_CLONE_PARAMS} "${PKG_URL}" "${PACKAGE}"
|
||||
else
|
||||
if [ ! "${GIT_DIR}" = "${PACKAGE}" ]; then
|
||||
mv "${GIT_DIR}" "${PACKAGE}"
|
||||
@ -126,10 +126,10 @@ fi
|
||||
[ $(git log --oneline --pretty=tformat:"%H" | grep "^${PKG_VERSION}" | wc -l) -eq 1 ] || die "There is no commit '${PKG_VERSION}' on branch '$(git branch | grep ^\* | cut -d ' ' -f2)' of package '${1}'! Aborting!"
|
||||
git reset --hard "${PKG_VERSION}"
|
||||
printf "%${BUILD_INDENT}c $(print_color CLR_GET "GIT SUBMODULE") ${1}\n" ' '>&$SILENT_OUT
|
||||
git submodule update --init --recursive "${GIT_SUBMODULE_PARAMS}"
|
||||
git submodule update --init --recursive ${GIT_SUBMODULE_PARAMS}
|
||||
)
|
||||
|
||||
GIT_SHA=$(git ls-remote "${PACKAGE}" | grep -m1 HEAD | awk '{print $1;}')
|
||||
GIT_SHA="$(git ls-remote "${PACKAGE}" | grep -m1 HEAD | awk '{print $1;}')"
|
||||
|
||||
if [ -n "${PKG_GIT_SHA}" ]; then
|
||||
[ "${PKG_GIT_SHA}" = "${GIT_SHA}" ] || printf "%${BUILD_INDENT}c $(print_color CLR_WARNING "WARNING") Incorrect git hash in respository: got ${GIT_SHA}, wanted ${PKG_GIT_SHA}\n\n" ' '>&$SILENT_OUT
|
||||
|
Loading…
x
Reference in New Issue
Block a user