mirror of
https://git.centos.org/centos/centpkg.git
synced 2025-02-23 16:22:55 +00:00
add the target property, and change the initializer to handle the cases where common is specified in the git branch
This commit is contained in:
parent
86b0d36840
commit
9af8c49a62
1 changed files with 23 additions and 2 deletions
|
@ -34,9 +34,30 @@ class DistGitDirectory(object):
|
|||
sigtobranchre = r'sig-(?P<signame>\w+)(?P<centosversion>\d)-?(?P<projectname>\w+)?-?(?P<releasename>\w+)?'
|
||||
match = re.match(sigtobranchre, branchtext)
|
||||
if match:
|
||||
self.__dict__.update(match.groupdict())
|
||||
gd = match.groupdict()
|
||||
self.signame = gd['signame']
|
||||
self.centosversion = gd['centosversion']
|
||||
|
||||
class Commands(pyrpkg.Commands):
|
||||
if gd['projectname'] != 'common':
|
||||
self.projectname = gd['projectname']
|
||||
if gd['releasename'] != 'common':
|
||||
self.releasename = gd['releasename']
|
||||
|
||||
@property
|
||||
def target(self):
|
||||
projectorcommon = self.projectname
|
||||
releaseorcommon = self.releasename
|
||||
|
||||
if not releaseorcommon:
|
||||
if not projectorcommon or projectorcommon == 'common':
|
||||
projectorcommon = 'common'
|
||||
else:
|
||||
releaseorcommon = 'common'
|
||||
|
||||
return '-'.join(filter(None, [self.signame+self.centosversion,
|
||||
projectorcommon, releaseorcommon])) + '-el{0}'.format(self.centosversion)
|
||||
|
||||
class Commands(Commands):
|
||||
'''
|
||||
For the pyrpkg commands with centpkg behavior
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue