summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-07-02 17:56:28 +0200
committerThomas Haller <thaller@redhat.com>2021-07-02 17:56:28 +0200
commitac0742c7dff1f1ee5b8f086db5a2cfde40c00daa (patch)
treeffb88c321ec1f4e454a76929e8d6caf8a1d7c3fa
parent8e8e2f5efd13b588d2739d0a466ecc75b7a8db14 (diff)
downloadNetworkManager-ac0742c7dff1f1ee5b8f086db5a2cfde40c00daa.tar.gz
makerepo: detect centpkg for CentOS Stream dist-git
-rwxr-xr-xcontrib/fedora/utils/makerepo.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/fedora/utils/makerepo.sh b/contrib/fedora/utils/makerepo.sh
index 3a772f1941..25fe441fc3 100755
--- a/contrib/fedora/utils/makerepo.sh
+++ b/contrib/fedora/utils/makerepo.sh
@@ -84,11 +84,16 @@ if [[ "x$(ls -1d ./*.spec 2>/dev/null)" == x || ! -f "./sources" ]]; then
fi
if [[ "$FEDPKG" == "" ]]; then
- REMOTES="$(git remote -v 2>/dev/null)" || die "not inside dist-git repository? >>$PWD<<"
- if echo "$REMOTES" | grep -q -F 'pkgs.devel.redhat.com' ; then
+ REMOTE="$(git config --get "branch.$(git branch --show-current).remote" 2>/dev/null)"
+ URL="$(git config --get "remote.$REMOTE.url")"
+ if [[ "$URL" = *'pkgs.devel.redhat.com'* ]]; then
FEDPKG=rhpkg
- else
+ elif [[ "$URL" = *'gitlab.com:redhat/centos-stream'* ]]; then
+ FEDPKG=centpkg
+ elif [[ "$URL" = *'pkgs.fedoraproject.org/'* ]]; then
FEDPKG=fedpkg
+ else
+ die "not inside dist-git repository? Check out a branch that has the dist-git remote tracking branch >>$PWD<<"
fi
fi