mirror of
https://git.centos.org/centos/centpkg.git
synced 2025-02-23 08:12:55 +00:00
Use correct namespace for SIGs during validation
When validating the spelling of the package during cloning, decide based on the program name whether to use the default namespace of CentOS RPMs, or the namespace dedicated to CentOS SIGs. Note that there is no reasonable way to deduce the specific SIG, so it is required to give absolute path, e.g.,`‹SIG›/rpms/‹package›` when cloning. Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
875769d8e2
commit
8e123d3908
1 changed files with 8 additions and 2 deletions
|
@ -31,6 +31,10 @@ import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
_DEFAULT_API_BASE_URL = 'https://gitlab.com'
|
_DEFAULT_API_BASE_URL = 'https://gitlab.com'
|
||||||
|
_DEFAULT_PARENT_NAMESPACE = {
|
||||||
|
'centpkg': 'redhat/centos-stream',
|
||||||
|
'centpkg-sig': 'CentOS',
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class centpkgClient(cliClient):
|
class centpkgClient(cliClient):
|
||||||
|
@ -355,11 +359,13 @@ class centpkgClient(cliClient):
|
||||||
# Since gitlab allows git repos to be checked out with incorrect capitilization
|
# Since gitlab allows git repos to be checked out with incorrect capitilization
|
||||||
# we need to check the spelling when cloning
|
# we need to check the spelling when cloning
|
||||||
gl = gitlab.Gitlab(_DEFAULT_API_BASE_URL)
|
gl = gitlab.Gitlab(_DEFAULT_API_BASE_URL)
|
||||||
|
parent_namespace = _DEFAULT_PARENT_NAMESPACE[self.DEFAULT_CLI_NAME]
|
||||||
|
|
||||||
if "/" in self.args.repo[0]:
|
if "/" in self.args.repo[0]:
|
||||||
project_name_with_namespace = "redhat/centos-stream/"+self.args.repo[0]
|
project_name_with_namespace = parent_namespace+"/"+self.args.repo[0]
|
||||||
short_name=self.args.repo[0].split("/")[-1]
|
short_name=self.args.repo[0].split("/")[-1]
|
||||||
else:
|
else:
|
||||||
project_name_with_namespace = "redhat/centos-stream/rpms/"+self.args.repo[0]
|
project_name_with_namespace = parent_namespace+"/rpms/"+self.args.repo[0]
|
||||||
short_name=self.args.repo[0]
|
short_name=self.args.repo[0]
|
||||||
try:
|
try:
|
||||||
project = gl.projects.get(project_name_with_namespace)
|
project = gl.projects.get(project_name_with_namespace)
|
||||||
|
|
Loading…
Add table
Reference in a new issue