mirror of
https://git.centos.org/centos/centpkg.git
synced 2025-02-23 16:22:55 +00:00
Check package spelling (CS-767)
Signed-off-by: Troy Dawson <tdawson@redhat.com>
This commit is contained in:
parent
87795b6ebf
commit
5fd982bf00
1 changed files with 24 additions and 0 deletions
|
@ -25,6 +25,7 @@ from pyrpkg import rpkgError
|
|||
from six.moves.urllib_parse import urlparse
|
||||
import six.moves.configparser as ConfigParser
|
||||
|
||||
import gitlab
|
||||
import json
|
||||
import koji
|
||||
import os
|
||||
|
@ -276,3 +277,26 @@ class centpkgClient(cliClient):
|
|||
def request_gated_side_tag(self):
|
||||
self.args.suffix = "stack-gate"
|
||||
super(centpkgClient, self).request_side_tag()
|
||||
|
||||
def clone(self):
|
||||
# Since gitlab allows git repos to be checked out with incorrect capitilization
|
||||
# we need to check the spelling when cloning
|
||||
gl = gitlab.Gitlab(_DEFAULT_API_BASE_URL)
|
||||
if "modules/" in self.args.repo[0]:
|
||||
project_name_with_namespace = "redhat/centos-stream/"+self.args.repo[0]
|
||||
short_name=self.args.repo[0].split("/")[1]
|
||||
else:
|
||||
project_name_with_namespace = "redhat/centos-stream/rpms/"+self.args.repo[0]
|
||||
short_name=self.args.repo[0]
|
||||
try:
|
||||
project = gl.projects.get(project_name_with_namespace)
|
||||
except gitlab.exceptions.GitlabGetError as e:
|
||||
self.log.info("There is no repository with the given name. Did you spell it correctly?")
|
||||
self.log.info("Fatal: ")
|
||||
self.log.info(e)
|
||||
raise SystemExit
|
||||
if not project.name == short_name:
|
||||
self.log.info("Fatal: ")
|
||||
self.log.info("Project name is wrong: " + short_name + " it should be: " + project.name)
|
||||
raise SystemExit
|
||||
super(centpkgClient, self).clone()
|
||||
|
|
Loading…
Add table
Reference in a new issue