From 96a7f52d238e502e859c86862b2f82ca5c64ecde Mon Sep 17 00:00:00 2001 From: "Ivan A. Melnikov" Date: Wed, 26 Jun 2013 21:37:27 +0300 Subject: [PATCH] Support custom release in all components This commit adds support for setting release (what goes to RELEASE rpm tag) to components that are build with py2rpm (not from custom specfiles). Change-Id: I80edd646e0b7d5b34dda4bcc94777fbfc38f99f2 Refs: bug 1190432 --- anvil/packaging/yum.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/anvil/packaging/yum.py b/anvil/packaging/yum.py index bc379ca6..3a54df6f 100644 --- a/anvil/packaging/yum.py +++ b/anvil/packaging/yum.py @@ -501,10 +501,13 @@ class YumDependencyHandler(base.DependencyHandler): template_name = "%s.spec" % rpm_name return (rpm_name, template_name) - def _build_from_app_dir(self, instance): + def _build_from_app_dir(self, instance, params): app_dir = instance.get_option('app_dir') cmdline = self.py2rpm_start_cmdline() - cmdline.extend(["--source-only", "--", app_dir]) + cmdline.extend(["--source-only"]) + if 'release' in params: + cmdline.extend(["--release", params["release"]]) + cmdline.extend(["--", app_dir]) out_filename = sh.joinpths(self.log_dir, "py2rpm-build-%s.log" % (instance.name)) sh.execute_save_output(cmdline, cwd=app_dir, out_filename=out_filename, quiet=True) @@ -540,7 +543,7 @@ class YumDependencyHandler(base.DependencyHandler): template_name, params) self._build_from_spec(instance, spec_filename, patches) else: - self._build_from_app_dir(instance) + self._build_from_app_dir(instance, params) def _convert_names_python2rpm(self, python_names): if not python_names: