log = logging.getLogger("pakfire.buildservice.config")
class PakfireConfig(base.Object):
- def init(self, distro=None, repos=None):
+ def init(self, distro=None, repos=None, vendor=None, contact=None):
self.distro = distro
self.repos = set()
+ # Overwritten for user repositories
+ self.vendor = vendor
+ self.contact = contact
+
# Add all repositories belonging to the distribution
if self.distro:
for repo in self.distro.repos:
# Add the distro configuration
if self.distro:
- config = self.distro._make_config(local=local)
+ config = self.distro._make_config(local=local,
+ vendor=self.vendor, contact=self.contact)
parts.append(config)
# Add the repository configurations
def __str__(self):
return self.name
- def _make_config(self, local=False):
+ def _make_config(self, local=False, vendor=None, contact=None):
try:
name, release = self.name.split()
except:
"release = %s" % release,
"slogan = %s" % self.slogan,
"",
- "vendor = %s" % self.vendor,
- "contact = %s" % self.contact,
+ "vendor = %s" % (vendor or self.vendor),
+ "contact = %s" % (contact or self.contact),
]
# Add any custom configuration
"""
Returns a Pakfire configuration for this repository
"""
- # XXX add any custom vendor/contact
+ # Overwrite the distro's vendor/contact for user repositories
+ if self.owner:
+ kwargs |= {
+ "vendor" : "%s" % self.owner,
+ "contact" : self.owner.email,
+ }
+
return self.backend.pakfire(distro=self.distro, repos=[self], **kwargs)
# Write repository