#633 sources_filename incorrectly set when using SRPMLayout
Closed: Fixed 2 years ago by onosek. Opened 2 years ago by tdawson.

centpkg-sig uses the SRPMLayout and cannot download it's sources.
The problem ends up being that self.sources_filename is literally set to .{0.repo_name}.metadata
It's supposed to be set to something like .foo.metadata

It starts in SRPMLayout in layout/layouts.py where we have
sources_file_template='.{0.repo_name}.metadata'
But then in init.py when we convert that to sources_filename we don't convert the template, we just use it
return os.path.join(self.path, self.layout.sources_file_template)


I don't know if this is what you had in mind when you wrote the original code, but the following fixes the problem.

--- __init__.py.orig    2022-09-15 11:49:57.667310051 -0700
+++ __init__.py 2022-09-15 11:51:55.386069029 -0700
@@ -1153,7 +1153,7 @@
     def sources_filename(self):
         if self.layout is None:
             return os.path.join(self.path, 'sources')
-        return os.path.join(self.path, self.layout.sources_file_template)
+        return os.path.join(self.path, self.layout.sources_file_template.replace("{0.repo_name}",self.repo_name))

     @property
     def osbs_config_filename(self):

Metadata Update from @onosek:
- Issue set to the milestone: 1.66

a year ago

Login to comment on this ticket.

Metadata