|
Brian Stinson |
6e343c |
# pylint: disable=line-too-long,abstract-class-not-used
|
|
Brian Stinson |
6e343c |
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
'''
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
Top level function library for centpkg
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
'''
|
|
Brian Stinson |
6e343c |
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
# Author(s):
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
# Jesse Keating <jkeating@redhat.com>
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
# Pat Riehecky <riehecky@fnal.gov>
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
# Brian Stinson <bstinson@ksu.edu>
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
#
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
# This program is free software; you can redistribute it and/or modify it
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
# under the terms of the GNU General Public License as published by the
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
# Free Software Foundation; either version 2 of the License, or (at your
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
# option) any later version. See http://www.gnu.org/copyleft/gpl.html for
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
# the full text of the license.
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
|
|
Brian Stinson |
ca61eb |
import re
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
e7fd56 |
import warnings
|
|
Brian Stinson |
2fb8a5 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
ebeaf1 |
from pyrpkg import Commands, rpkgError
|
|
Brian Stinson |
6e343c |
from .lookaside import StreamLookasideCache, SIGLookasideCache
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
from pyrpkg.utils import cached_property
|
|
Brian Stinson |
2fb8a5 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
05c687 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
7ae64c |
class DistGitDirectory(object):
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
7ae64c |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
86b0d3 |
signame = None
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
86b0d3 |
centosversion = None
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
86b0d3 |
projectname = None
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
86b0d3 |
releasename = None
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
distrobranch = False
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
86b0d3 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
7ae64c |
def __init__(self, branchtext):
|
|
Brian Stinson |
3edf28 |
sigtobranchre = r'c(?P<centosversion>\d+[s]?)-sig-(?P<signame>\w+)-?(?P<projectname>\w+)?-?(?P<releasename>\w+)?'
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
distrobranchre = r'c(?P<centosversion>\d+)-?(?P<projectname>\w+)?'
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
e7fd56 |
oldbranchre = r'(?P<signame>\w+)(?P<centosversion>\d)'
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
sigmatch = re.match(sigtobranchre, branchtext)
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
distromatch = re.match(distrobranchre, branchtext)
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
e7fd56 |
oldbranchmatch = re.match(oldbranchre, branchtext)
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
if sigmatch:
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
gd = sigmatch.groupdict()
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
self.signame = gd['signame']
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
self.centosversion = gd['centosversion']
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
7ae64c |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
35f2c1 |
# Users have the option to specify (or not specify) common in their
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
35f2c1 |
# git repos. Ww need to handle these cases because common is not a
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
35f2c1 |
# project nor is it a release.
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
if gd['projectname'] != 'common':
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
self.projectname = gd['projectname']
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
if gd['releasename'] != 'common':
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
self.releasename = gd['releasename']
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
elif distromatch:
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
gd = distromatch.groupdict()
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
self.distrobranch = True
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
self.signame = 'centos'
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
self.centosversion = gd['centosversion']
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
if gd['projectname'] != 'common':
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
self.projectname = gd['projectname']
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
e7fd56 |
elif oldbranchmatch:
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
e7fd56 |
warnings.warn("This branch is deprecated and will be removed soon",
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
e7fd56 |
DeprecationWarning)
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
else:
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
raise ValueError("Branchname: {0} is not valid".format(branchtext))
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
@property
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
def target(self):
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
projectorcommon = self.projectname
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
releaseorcommon = self.releasename
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
if self.distrobranch:
|
|
Brian Stinson |
6e343c |
if self.centosversion not in ('6', '7'):
|
|
Brian Stinson |
3edf28 |
return 'c{}s-candidate'.format(self.centosversion)
|
|
Brian Stinson |
3edf28 |
else:
|
|
Brian Stinson |
3edf28 |
return '-'.join(filter(None, ['c'+self.centosversion,
|
|
Brian Stinson |
3edf28 |
projectorcommon]))
|
|
Brian Stinson |
3edf28 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
if not releaseorcommon:
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
if not projectorcommon or projectorcommon == 'common':
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
projectorcommon = 'common'
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
else:
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
releaseorcommon = 'common'
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
return '-'.join(filter(None, [self.signame+self.centosversion,
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
projectorcommon, releaseorcommon])) + '-el{0}'.format(self.centosversion)
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
9af8c4 |
class Commands(Commands):
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
'''
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
For the pyrpkg commands with centpkg behavior
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
'''
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
def __init__(self, *args, **kwargs):
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
'''
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
Init the object and some configuration details.
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
'''
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
super(Commands, self).__init__(*args, **kwargs)
|
|
James Antill |
ed1405 |
# For MD5 we want to use the old format of source files, the BSD format
|
|
James Antill |
ed1405 |
# should only be used when configured for SHA512
|
|
James Antill |
ed1405 |
self.source_entry_type = 'bsd' if self.lookasidehash != 'md5' else 'old'
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
@property
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
def distgitdir(self):
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
return DistGitDirectory(self.branch_merge)
|
|
Brian Stinson |
2fb8a5 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
@cached_property
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
def lookasidecache(self):
|
|
Brian Stinson |
3edf28 |
if self.distgitdir.distrobranch:
|
|
Brian Stinson |
3edf28 |
return StreamLookasideCache(self.lookasidehash,
|
|
Brian Stinson |
3edf28 |
self.lookaside,
|
|
Brian Stinson |
3edf28 |
self.lookaside_cgi,
|
|
Brian Stinson |
3edf28 |
)
|
|
Brian Stinson |
3edf28 |
else:
|
|
Brian Stinson |
3edf28 |
return SIGLookasideCache(self.lookasidehash,
|
|
Brian Stinson |
6e343c |
self.lookaside,
|
|
Brian Stinson |
6e343c |
self.lookaside_cgi,
|
|
Brian Stinson |
6e343c |
self.repo_name,
|
|
Brian Stinson |
6e343c |
self.branch_merge)
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
639034 |
|
|
Brian Stinson |
ca61eb |
# redefined loaders
|
|
Brian Stinson |
ca61eb |
def load_rpmdefines(self):
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
'''
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
Populate rpmdefines based on branch data
|
|
![](https://seccdn.libravatar.org/avatar/25b391aad4604da4d060ebac56a74378660d08a933299c566ebc59941f52c806?s=16&d=retro) |
85a850 |
'''
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a1a2e2 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a1a2e2 |
if not self.distgitdir.centosversion:
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a1a2e2 |
raise rpkgError('Could not get the OS version from the branch:{0}'.format(self.branch_merge))
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a1a2e2 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
self._distvar = self.distgitdir.centosversion
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
self._distval = self._distvar.replace('.', '_')
|
|
Brian Stinson |
f12d46 |
|
|
Brian Stinson |
d6d6d7 |
self._disttag = 'el%s' % self._distval
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
self._rpmdefines = ["--define '_sourcedir %s'" % self.layout.sourcedir,
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
"--define '_specdir %s'" % self.layout.specdir,
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
"--define '_builddir %s'" % self.layout.builddir,
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
"--define '_srcrpmdir %s'" % self.layout.srcrpmdir,
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
"--define '_rpmdir %s'" % self.layout.rpmdir,
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
"--define 'dist .%s'" % self._disttag,
|
|
Brian Stinson |
ca61eb |
# int and float this to remove the decimal
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
"--define '%s 1'" % self._disttag]
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
a394b1 |
self.log.debug("RPMDefines: %s" % self._rpmdefines)
|
|
Brian Stinson |
ca61eb |
|
|
James Antill |
dda40d |
def construct_build_url(self, *args, **kwargs):
|
|
James Antill |
dda40d |
"""Override build URL for CentOS/Fedora Koji build
|
|
James Antill |
dda40d |
|
|
James Antill |
dda40d |
In CentOS/Fedora Koji, anonymous URL should have prefix "git+https://"
|
|
James Antill |
dda40d |
"""
|
|
James Antill |
dda40d |
url = super(Commands, self).construct_build_url(*args, **kwargs)
|
|
James Antill |
dda40d |
return 'git+{0}'.format(url)
|
|
James Antill |
dda40d |
|
|
Brian Stinson |
6ba768 |
def load_target(self):
|
|
Brian Stinson |
6ba768 |
""" This sets the target attribute (used for mock and koji) """
|
|
Brian Stinson |
3f76b3 |
|
|
![](https://seccdn.libravatar.org/avatar/d635613ede4b3412560d42b110505d92a6fa9398ec643dab6a3ce5ee8932bacb?s=16&d=retro) |
8b3983 |
self._target = self.distgitdir.target
|