Do not expect the package name to be second

Do not assume that the package name is second when validating the
spelling of the package name with a specified namespace.

This holds for CentOS itself as there is only one namespace in front of
the package, e.g., `rpms` or `modules`. However when using the
`centpkg-sig`, the packages reside under the SIGs' namespace adding
an additional layer which yields the `rpms` for second part of the path
instead of the package name.

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2024-06-10 09:45:56 +02:00
parent 9106242667
commit 875769d8e2
No known key found for this signature in database
GPG key ID: 7C47D46246790496

View file

@ -357,7 +357,7 @@ class centpkgClient(cliClient):
gl = gitlab.Gitlab(_DEFAULT_API_BASE_URL)
if "/" in self.args.repo[0]:
project_name_with_namespace = "redhat/centos-stream/"+self.args.repo[0]
short_name=self.args.repo[0].split("/")[1]
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]