touch cgo.a in %post, regardless

This commit is contained in:
Vincent Batts 2014-08-13 14:32:02 +00:00
parent 31e8a62d23
commit 33152ba710
1 changed files with 16 additions and 19 deletions

View File

@ -42,7 +42,7 @@
Name: golang
Version: 1.2.2
Release: 20%{?dist}
Release: 21%{?dist}
Summary: The Go Programming Language
License: BSD
@ -607,12 +607,10 @@ 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
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}
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_386/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_386/gofmt
@ -626,12 +624,10 @@ 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
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}
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_amd64/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_amd64/gofmt
@ -645,12 +641,10 @@ 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
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}
%{_sbindir}/update-alternatives --install %{_bindir}/go \
go %{goroot}/bin/linux_arm/go 90 \
--slave %{_bindir}/gofmt gofmt %{goroot}/bin/linux_arm/gofmt
@ -948,6 +942,9 @@ fi
%changelog
* Wed Aug 13 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-21
- touch cgo.a regardless
* Wed Aug 13 2014 Vincent Batts <vbatts@fedoraproject.org> - 1.2.2-20
- rpm dependency ordering for %%post