- change cf version string with patch instead of script in specfile

OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cf-cli?expand=0&rev=2
This commit is contained in:
Sebastian Vollath 2016-12-05 13:48:04 +00:00 committed by Git OBS Bridge
parent 8e8d4caba9
commit 02abdd5e07
3 changed files with 17 additions and 12 deletions

View File

@ -0,0 +1,10 @@
--- a/cf/commands/version.go 2016-12-05 14:21:12.245009000 +0100
+++ b/cf/commands/version.go 2016-12-05 14:21:43.708615000 +0100
@@ -45,6 +45,6 @@
}
func (cmd *Version) Execute(context flags.FlagContext) error {
- cmd.ui.Say(fmt.Sprintf("%s version %s-%s", cf.Name, cf.Version, cf.BuiltOnDate))
+ cmd.ui.Say(fmt.Sprintf("%s version 6.22.2", cf.Name))
return nil
}

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Dec 5 14:44:09 CET 2016 - svollath@suse.de
- change cf version string with patch instead of script in specfile
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 28 13:30:48 CEST 2016 - svollath@suse.de Fri Oct 28 13:30:48 CEST 2016 - svollath@suse.de

View File

@ -16,8 +16,6 @@
# #
%define import_path code.cloudfoundry.org/cli %define import_path code.cloudfoundry.org/cli
%define _git_revision 61ce394
%define _date_string %(date -u +"%Y-%m-%d")
Name: cf-cli Name: cf-cli
Version: 6.22.2 Version: 6.22.2
@ -28,6 +26,7 @@ Url: https://github.com/cloudfoundry/cli
Group: System/Management Group: System/Management
Source0: cli-%{version}.tar.gz Source0: cli-%{version}.tar.gz
Source1: README Source1: README
Patch1: 0001-Use-plain-version-string.patch
BuildRequires: go >= 1.6.0 BuildRequires: go >= 1.6.0
BuildRequires: golang-packaging BuildRequires: golang-packaging
BuildRequires: xz BuildRequires: xz
@ -41,16 +40,7 @@ This is the official command line client for Cloud Foundry.
%prep %prep
%setup -q -n cli-%{version} %setup -q -n cli-%{version}
%patch1 -p1
# set version for "build from source" (like bin/replace_sha)
pushd %{_builddir}/cli-%{version}
%define _version_string %{version}+%{_git_revision}
if [ -e cf/app_constants.go ]; then
sed -i -e 's/BUILT_FROM_SOURCE/%{_version_string}/g' -e 's/BUILT_AT_UNKNOWN_TIME/%{_date_string}/g' cf/app_constants.go
else
echo "Failed to adjust app_constants (Version)"
fi
popd
%build %build
cd %{_builddir}/cli-%{version} cd %{_builddir}/cli-%{version}