From 02abdd5e0759a0671c2d668595dabeb44281bc1b3a6ead3fe94e86daa9f37bc0 Mon Sep 17 00:00:00 2001 From: Sebastian Vollath Date: Mon, 5 Dec 2016 13:48:04 +0000 Subject: [PATCH] - 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 --- 0001-Use-plain-version-string.patch | 10 ++++++++++ cf-cli.changes | 5 +++++ cf-cli.spec | 14 ++------------ 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 0001-Use-plain-version-string.patch diff --git a/0001-Use-plain-version-string.patch b/0001-Use-plain-version-string.patch new file mode 100644 index 0000000..d961ada --- /dev/null +++ b/0001-Use-plain-version-string.patch @@ -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 + } diff --git a/cf-cli.changes b/cf-cli.changes index cfd49b4..7f8c23f 100644 --- a/cf-cli.changes +++ b/cf-cli.changes @@ -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 diff --git a/cf-cli.spec b/cf-cli.spec index cefe995..edf2d53 100644 --- a/cf-cli.spec +++ b/cf-cli.spec @@ -16,8 +16,6 @@ # %define import_path code.cloudfoundry.org/cli -%define _git_revision 61ce394 -%define _date_string %(date -u +"%Y-%m-%d") Name: cf-cli Version: 6.22.2 @@ -28,6 +26,7 @@ Url: https://github.com/cloudfoundry/cli Group: System/Management Source0: cli-%{version}.tar.gz Source1: README +Patch1: 0001-Use-plain-version-string.patch BuildRequires: go >= 1.6.0 BuildRequires: golang-packaging BuildRequires: xz @@ -41,16 +40,7 @@ This is the official command line client for Cloud Foundry. %prep %setup -q -n cli-%{version} - -# 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 +%patch1 -p1 %build cd %{_builddir}/cli-%{version}