diff --git a/contrib/fedora/utils/makerepo.sh b/contrib/fedora/utils/makerepo.sh index 48199077c8..47778b405b 100755 --- a/contrib/fedora/utils/makerepo.sh +++ b/contrib/fedora/utils/makerepo.sh @@ -319,16 +319,25 @@ MAKEREPO_GIT_IGNORE_LAST="makerepo.gitignore.last-$CURRENT_BRANCH" get_local_mirror() { local URL="$1" + local DIRNAME + local FULLNAME if [[ -z "$URL" ]]; then return fi - local DIRNAME="$(echo $URL.git | sed -e 's#^.*/\([^/]\+\)$#\1#' -e 's/\(.*\)\.git$/\1/')" - local FULLNAME="$srcdir/.git/.makerepo-${DIRNAME}.git" - [[ -n "$NO_REMOTE" ]] && return + DIRNAME="${URL##*/}" + DIRNAME="${DIRNAME%.git}" + FULLNAME="$srcdir/.git/.makerepo-${DIRNAME}.git" + + if [ ! -d "$FULLNAME" ] && [ -d "$FULLNAME.git" ]; then + # due to a bug, old versions of the script might have created "*.git.git/" directories. + # rename. + mv "$FULLNAME.git" "$FULLNAME" + fi + if [[ ! -d "$FULLNAME" ]]; then if [[ -f "$FULLNAME" ]]; then # create a file with name $FULLNAME, to suppress local mirroring