get_git: check only folder, not files

this prevents removal of potential archive files in the same sources
subfolder for a package
This commit is contained in:
Tomáš Kelemen (vudiq) 2021-03-22 22:30:45 +01:00
parent 5a67b4194d
commit 64f9f95998

View File

@ -72,8 +72,8 @@ fi
GIT_FOUND="no"
opwd="$(pwd)"
for d in "${SOURCES}/${1}/${1}-"* ; do
if [ -d "${d}/.git" ]; then
for d in "${SOURCES}/${1}/${1}-"*/ ; do
if [ -d "${d}.git" ]; then
if [ "${GIT_FOUND}" = "no" ]; then
cd "${d}"
if [ "${PKG_URL}" = "$(git remote get-url origin)" ]; then
@ -117,7 +117,7 @@ cd "${opwd}"
if [ "${GIT_FOUND}" = "no" ]; then
build_msg "CLR_GET" "GIT CLONE" "${1}"
git clone ${GIT_CLONE_PARAMS} "${PKG_URL}" "${PACKAGE}"
elif [ ! "${GIT_DIR}" = "${PACKAGE}" ]; then
elif [ ! "${GIT_DIR}" = "${PACKAGE}/" ]; then
mv "${GIT_DIR}" "${PACKAGE}"
fi