Skip to content

Commit

Permalink
Merge pull request #11196 from tdawson/2016-10-tito-libs
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Oct 6, 2016
2 parents 43d24b2 + 606d580 commit f243060
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
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

0 comments on commit f243060

Please sign in to comment.