Make ubuntu repo similar for all plugin versions
Release file began to present in a plugin ubuntu repository only since version 2. This now conflicts with our new repo pinning code which expects Release file to be in place. Related-Bug: #1650551 Change-Id: I09b956555c3a6ab0944216d866739fb7f6dc66a0
This commit is contained in:
parent
13c73e5609
commit
57476f32d3
|
@ -34,6 +34,8 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class BaseBuildPlugin(BaseAction):
|
class BaseBuildPlugin(BaseAction):
|
||||||
|
|
||||||
|
release_tmpl_src_path = 'templates/base/build/Release.mako'
|
||||||
|
|
||||||
@abc.abstractproperty
|
@abc.abstractproperty
|
||||||
def requires(self):
|
def requires(self):
|
||||||
"""Should return a list of commands which
|
"""Should return a list of commands which
|
||||||
|
@ -62,6 +64,13 @@ class BaseBuildPlugin(BaseAction):
|
||||||
self.checksums_path = join_path(self.build_src_dir, 'checksums.sha1')
|
self.checksums_path = join_path(self.build_src_dir, 'checksums.sha1')
|
||||||
self.name = self.meta['name']
|
self.name = self.meta['name']
|
||||||
|
|
||||||
|
self.plugin_version, self.full_version = utils.version_split_name_rpm(
|
||||||
|
self.meta['version'])
|
||||||
|
|
||||||
|
fpb_dir = join_path(os.path.dirname(__file__), '..')
|
||||||
|
self.release_tmpl_src = os.path.abspath(join_path(
|
||||||
|
fpb_dir, self.release_tmpl_src_path))
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
logger.debug('Start plugin building "%s"', self.plugin_path)
|
logger.debug('Start plugin building "%s"', self.plugin_path)
|
||||||
self.clean()
|
self.clean()
|
||||||
|
@ -99,11 +108,17 @@ class BaseBuildPlugin(BaseAction):
|
||||||
self.build_ubuntu_repos(releases_paths.get('ubuntu', []))
|
self.build_ubuntu_repos(releases_paths.get('ubuntu', []))
|
||||||
self.build_centos_repos(releases_paths.get('centos', []))
|
self.build_centos_repos(releases_paths.get('centos', []))
|
||||||
|
|
||||||
def build_ubuntu_repos(cls, releases_paths):
|
def build_ubuntu_repos(self, releases_paths):
|
||||||
for repo_path in releases_paths:
|
for repo_path in releases_paths:
|
||||||
utils.exec_piped_cmds(
|
utils.exec_piped_cmds(
|
||||||
['dpkg-scanpackages -m .', 'gzip -c9 > Packages.gz'],
|
['dpkg-scanpackages -m .', 'gzip -c9 > Packages.gz'],
|
||||||
cwd=repo_path)
|
cwd=repo_path)
|
||||||
|
release_path = join_path(repo_path, 'Release')
|
||||||
|
utils.render_to_file(
|
||||||
|
self.release_tmpl_src,
|
||||||
|
release_path,
|
||||||
|
{'plugin_name': self.meta['name'],
|
||||||
|
'major_version': self.plugin_version})
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def build_centos_repos(cls, releases_paths):
|
def build_centos_repos(cls, releases_paths):
|
||||||
|
@ -156,14 +171,10 @@ class BuildPluginV2(BaseBuildPlugin):
|
||||||
requires = ['rpmbuild', 'rpm', 'createrepo', 'dpkg-scanpackages']
|
requires = ['rpmbuild', 'rpm', 'createrepo', 'dpkg-scanpackages']
|
||||||
|
|
||||||
rpm_spec_src_path = 'templates/v2/build/plugin_rpm.spec.mako'
|
rpm_spec_src_path = 'templates/v2/build/plugin_rpm.spec.mako'
|
||||||
release_tmpl_src_path = 'templates/v2/build/Release.mako'
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(BuildPluginV2, self).__init__(*args, **kwargs)
|
super(BuildPluginV2, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
self.plugin_version, self.full_version = utils.version_split_name_rpm(
|
|
||||||
self.meta['version'])
|
|
||||||
|
|
||||||
self.rpm_path = os.path.abspath(
|
self.rpm_path = os.path.abspath(
|
||||||
join_path(self.plugin_path, '.build', 'rpm'))
|
join_path(self.plugin_path, '.build', 'rpm'))
|
||||||
|
|
||||||
|
@ -179,9 +190,6 @@ class BuildPluginV2(BaseBuildPlugin):
|
||||||
self.spec_src = os.path.abspath(join_path(
|
self.spec_src = os.path.abspath(join_path(
|
||||||
fpb_dir, self.rpm_spec_src_path))
|
fpb_dir, self.rpm_spec_src_path))
|
||||||
|
|
||||||
self.release_tmpl_src = os.path.abspath(join_path(
|
|
||||||
fpb_dir, self.release_tmpl_src_path))
|
|
||||||
|
|
||||||
self.spec_dst = join_path(self.rpm_path, 'plugin_rpm.spec')
|
self.spec_dst = join_path(self.rpm_path, 'plugin_rpm.spec')
|
||||||
|
|
||||||
self.rpm_packages_mask = join_path(
|
self.rpm_packages_mask = join_path(
|
||||||
|
@ -223,18 +231,6 @@ class BuildPluginV2(BaseBuildPlugin):
|
||||||
'vendor': ', '.join(self.meta.get('authors', [])),
|
'vendor': ', '.join(self.meta.get('authors', [])),
|
||||||
'year': utils.get_current_year()}
|
'year': utils.get_current_year()}
|
||||||
|
|
||||||
def build_ubuntu_repos(self, releases_paths):
|
|
||||||
for repo_path in releases_paths:
|
|
||||||
utils.exec_piped_cmds(
|
|
||||||
['dpkg-scanpackages -m .', 'gzip -c9 > Packages.gz'],
|
|
||||||
cwd=repo_path)
|
|
||||||
release_path = join_path(repo_path, 'Release')
|
|
||||||
utils.render_to_file(
|
|
||||||
self.release_tmpl_src,
|
|
||||||
release_path,
|
|
||||||
{'plugin_name': self.meta['name'],
|
|
||||||
'major_version': self.plugin_version})
|
|
||||||
|
|
||||||
|
|
||||||
class BuildPluginV3(BuildPluginV2):
|
class BuildPluginV3(BuildPluginV2):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue