[golang/f20] touch cgo.a in a %post
Vincent Batts
vbatts at fedoraproject.org
Wed Aug 13 01:04:49 UTC 2014
commit 3b49f3293c98ef0767e2b75c6d7f8fdb4926739a
Author: Vincent Batts <vbatts at redhat.com>
Date: Wed Aug 13 01:04:25 2014 +0000
touch cgo.a in a %post
Signed-off-by: Vincent Batts <vbatts at redhat.com>
golang.spec | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/golang.spec b/golang.spec
index 439ddda..3473f9a 100644
--- a/golang.spec
+++ b/golang.spec
@@ -42,7 +42,7 @@
Name: golang
Version: 1.2.2
-Release: 18%{?dist}
+Release: 19%{?dist}
Summary: The Go Programming Language
License: BSD
@@ -603,6 +603,13 @@ fi
%ifarch %{ix86}
%post pkg-bin-linux-386
+# since the cgo.a packaged in this rpm will be older than the other archives likely built on the ARM builder,
+# then a multitude of packages will appear Stale. For sanity we'll check whether cgo is Stale, and plum it up to runtime.a
+if go list -json runtime/cgo | grep -q Stale ; then
+ runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/')
+ cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/')
+ touch -r ${runtime_file} ${cgo_file}
+fi
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_386/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_386/gofmt
@@ -615,6 +622,13 @@ fi
%ifarch x86_64
%post pkg-bin-linux-amd64
+# since the cgo.a packaged in this rpm will be older than the other archives likely built on the ARM builder,
+# then a multitude of packages will appear Stale. For sanity we'll check whether cgo is Stale, and plum it up to runtime.a
+if go list -json runtime/cgo | grep -q Stale ; then
+ runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/')
+ cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/')
+ touch -r ${runtime_file} ${cgo_file}
+fi
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_amd64/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_amd64/gofmt
@@ -627,6 +641,13 @@ fi
%ifarch %{arm}
%post pkg-bin-linux-arm
+# since the cgo.a packaged in this rpm will be older than the other archives likely built on the ARM builder,
+# then a multitude of packages will appear Stale. For sanity we'll check whether cgo is Stale, and plum it up to runtime.a
+if go list -json runtime/cgo | grep -q Stale ; then
+ runtime_file=$(go list -json runtime | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/')
+ cgo_file=$(go list -json runtime/cgo | grep -w Target | sed -e 's/.*".*".*"\(.*\)".*/\1/')
+ touch -r ${runtime_file} ${cgo_file}
+fi
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_arm/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_arm/gofmt
@@ -924,6 +945,9 @@ fi
%changelog
+* Tue Aug 12 2014 Vincent Batts <vbatts at fedoraproject.org> - 1.2.2-19
+- finally check for a Stale cgo in a %%post
+
* Tue Aug 12 2014 Vincent Batts <vbatts at fedoraproject.org> - 1.2.2-18
- explicitly list all the files and directories for the packages trees
More information about the scm-commits
mailing list