Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup tito tagger and builder libs #11196

Merged
merged 1 commit into from
Oct 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .tito/lib/origin/builder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def _setup_test_specfile(self):
os_git_commit = run_command("bash -c '{0}'".format(cmd))
cmd = '. ./hack/common.sh ; OS_ROOT=$(pwd) ; os::build::os_version_vars ; echo ${OS_GIT_VERSION}'
os_git_version = run_command("bash -c '{0}'".format(cmd))
os_git_version = os_git_version.replace('-dirty', '')
cmd = '. ./hack/common.sh ; OS_ROOT=$(pwd) ; os::build::os_version_vars ; echo ${OS_GIT_MAJOR}'
os_git_major = run_command("bash -c '{0}'".format(cmd))
cmd = '. ./hack/common.sh ; OS_ROOT=$(pwd) ; os::build::os_version_vars ; echo ${OS_GIT_MINOR}'
Expand All @@ -79,17 +80,6 @@ def _setup_test_specfile(self):
)
output = run_command(update_os_git_vars)

## Fixup ldflags
cmd = '. ./hack/common.sh ; OS_ROOT=$(pwd) ; echo $(os::build::ldflags)'
ldflags = run_command("bash -c '{0}'".format(cmd))
print("LDFLAGS::{0}".format(ldflags))
update_ldflags = \
"sed -i 's|^%global ldflags .*$|%global ldflags {0}|' {1}".format(
' '.join([ldflag.strip() for ldflag in ldflags.split()]),
self.spec_file
)
output = run_command(update_ldflags)

# Add bundled deps for Fedora Guidelines as per:
# https://fedoraproject.org/wiki/Packaging:Guidelines#Bundling_and_Duplication_of_system_libraries
provides_list = []
Expand Down
32 changes: 21 additions & 11 deletions .tito/lib/origin/tagger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,29 @@ def _tag_release(self):
)
output = run_command(update_commit)

cmd = '. ./hack/common.sh ; OS_ROOT=$(pwd) ; echo $(os::build::ldflags)'
ldflags = run_command('bash -c \'{0}\''.format(cmd))
# hack/common.sh will tell us that the tree is dirty because tito has
# already mucked with things, but lets not consider the tree to be
# dirty
ldflags = ldflags.replace('-dirty', '')
update_ldflags = \
"sed -i 's|^%global ldflags .*$|%global ldflags {0}|' {1}".format(
ldflags,
## Fixup os_git_vars
cmd = '. ./hack/common.sh ; OS_ROOT=$(pwd) ; os::build::os_version_vars ; echo ${OS_GIT_COMMIT}'
os_git_commit = run_command("bash -c '{0}'".format(cmd))
cmd = '. ./hack/common.sh ; OS_ROOT=$(pwd) ; os::build::os_version_vars ; echo ${OS_GIT_VERSION}'
os_git_version = run_command("bash -c '{0}'".format(cmd))
os_git_version = os_git_version.replace('-dirty', '')
cmd = '. ./hack/common.sh ; OS_ROOT=$(pwd) ; os::build::os_version_vars ; echo ${OS_GIT_MAJOR}'
os_git_major = run_command("bash -c '{0}'".format(cmd))
cmd = '. ./hack/common.sh ; OS_ROOT=$(pwd) ; os::build::os_version_vars ; echo ${OS_GIT_MINOR}'
os_git_minor = run_command("bash -c '{0}'".format(cmd))
print("OS_GIT_COMMIT::{0}".format(os_git_commit))
print("OS_GIT_VERSION::{0}".format(os_git_version))
print("OS_GIT_MAJOR::{0}".format(os_git_major))
print("OS_GIT_MINOR::{0}".format(os_git_minor))
update_os_git_vars = \
"sed -i 's|^%global os_git_vars .*$|%global os_git_vars OS_GIT_TREE_STATE='clean' OS_GIT_VERSION={0} OS_GIT_COMMIT={1} OS_GIT_MAJOR={2} OS_GIT_MINOR={3}|' {4}".format(
os_git_version,
os_git_commit,
os_git_major,
os_git_minor,
self.spec_file
)
# FIXME - this output is never used
output = run_command(update_ldflags)
output = run_command(update_os_git_vars)

self._check_tag_does_not_exist(self._get_new_tag(new_version))
self._update_changelog(new_version)
Expand Down