mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
scripts/get_git: additional cleanup
This commit is contained in:
parent
33e1b1b1c0
commit
8eb628e4f7
@ -55,7 +55,7 @@ GIT_SUBMODULE_PARAMS=""
|
|||||||
|
|
||||||
if [ -n "${PKG_GIT_CLONE_DEPTH}" ]; then
|
if [ -n "${PKG_GIT_CLONE_DEPTH}" ]; then
|
||||||
if [[ "${PKG_GIT_CLONE_DEPTH}" =~ ^[0-9]+$ ]]; 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
|
else
|
||||||
die "ERROR: PKG_GIT_CLONE_DEPTH is not a number! (${PKG_GIT_CLONE_DEPTH})"
|
die "ERROR: PKG_GIT_CLONE_DEPTH is not a number! (${PKG_GIT_CLONE_DEPTH})"
|
||||||
fi
|
fi
|
||||||
@ -70,7 +70,7 @@ if [ -n "${PKG_GIT_SUBMODULE_DEPTH}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
GIT_FOUND="no"
|
GIT_FOUND="no"
|
||||||
opwd=$(pwd)
|
opwd="$(pwd)"
|
||||||
for d in "${SOURCES}/${1}/${1}-"* ; do
|
for d in "${SOURCES}/${1}/${1}-"* ; do
|
||||||
if [ -d "${d}/.git" ]; then
|
if [ -d "${d}/.git" ]; then
|
||||||
if [ "${GIT_FOUND}" = "no" ]; then
|
if [ "${GIT_FOUND}" = "no" ]; then
|
||||||
@ -95,7 +95,7 @@ for d in "${SOURCES}/${1}/${1}-"* ; do
|
|||||||
cd "${opwd}"
|
cd "${opwd}"
|
||||||
rm -rf "${d}"
|
rm -rf "${d}"
|
||||||
fi
|
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
|
printf "%${BUILD_INDENT}c $(print_color CLR_GET "GIT PULL") ${1}\n" ' '>&$SILENT_OUT
|
||||||
git pull
|
git pull
|
||||||
cd "${opwd}"
|
cd "${opwd}"
|
||||||
@ -129,7 +129,7 @@ fi
|
|||||||
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
|
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
|
[ "${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