diff --git a/mrepo.py b/mrepo.py index e69a6d8..afb8a5c 100755 --- a/mrepo.py +++ b/mrepo.py @@ -243,6 +243,8 @@ def __init__(self): self.hooks['post-update'] = self.getoption('main', 'hook-post-update', None) self.hooks['pre-generate'] = self.getoption('main', 'hook-pre-generate', None) self.hooks['post-generate'] = self.getoption('main', 'hook-post-generate', None) + self.hooks['pre-createmd'] = self.getoption('main', 'hook-pre-createmd', None) + self.hooks['post-createmd'] = self.getoption('main', 'hook-post-createmd', None) self.hooks['pre-new-repo'] = self.getoption('main', 'hook-pre-new-repo', None) self.hooks['lock'] = self.getoption('main', 'hook-lock', None) self.hooks['unlock'] = self.getoption('main', 'hook-unlock', None) @@ -373,7 +375,7 @@ def _call_hook(self, hook_name): run(' '.join([ CONFIG.hooks[hook_name], hook_name, - self.name, + self.nick, self.srcdir, self.dir, ])) @@ -655,6 +657,8 @@ def createmd(self): if not self.changed and not OPTIONS.force: return + self._call_hook('pre-createmd') + try: ### Generate repository metadata for metadata in self.dist.metadata: @@ -665,6 +669,8 @@ def createmd(self): error(0, 'Generating repo failed for %s with message:\n %s' % (self.name, instance.value)) EXITCODE = 2 + self._call_hook('post-createmd') + def repomd(self): "Create a repomd repository" if not CONFIG.cmd['createrepo']: