BNC#776058 patch go installer to not return stale std libraries for non root users installing third party packages

OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/go?expand=0&rev=155
This commit is contained in:
Graham Anderson 2012-09-05 04:10:28 +00:00 committed by Git OBS Bridge
parent 858eeea586
commit 39ed939f73
3 changed files with 35 additions and 4 deletions

View File

@ -0,0 +1,19 @@
diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go
index 54d65f9..0138028 100644
--- a/src/cmd/go/pkg.go
+++ b/src/cmd/go/pkg.go
@@ -476,6 +476,14 @@ func isStale(p *Package, topRoot map[string]bool) bool {
return true
}
+ // openSUSE bnc#776058
+ // Only root user can reinstall a std library from a dependancy, all other
+ // users should *never* have to do this.
+ if os.Getuid() != 0 && p.Standard {
+ fmt.Println("openSUSE")
+ return false
+ }
+
olderThan := func(file string) bool {
fi, err := os.Stat(file)
return err != nil || fi.ModTime().After(built)

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Wed Sep 5 03:46:15 UTC 2012 - graham@andtech.eu
- BNC#776058
- Add new patch to prevent the go install tool trying to reinstall
std library packages that are dependencies of third party packages.
- Using touch on the precompiled archives introdoces additional
problems with the go install tool. Instead, we simply don't mark
std library files as stale when a third party package is evaluated
for installation. The behaviour remains unchanged for the root
user and while it is inadvisable to manually reinstall standard
libraries using the openSUSE packages, we do not disallow it.
-------------------------------------------------------------------
Thu Aug 16 11:15:13 UTC 2012 - graham@andtech.eu

View File

@ -41,6 +41,8 @@ Patch4: allow-binary-only-packages.patch
Patch5: verbose-build.patch
# PATCH-FIX-OPENSUSE fix vim Godoc and Import helpers/autocomplete
Patch6: opensuse-vim.patch
# PATCH-FIX-OPENSUSE BNC#776058
Patch7: go-install-dont-reinstall-stdlibs.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#BuildRequires: bison
#BuildRequires: ed
@ -112,6 +114,7 @@ echo %{requiretest}
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
cp %{SOURCE4} .
cp %{SOURCE5} .
@ -217,10 +220,6 @@ ln -s %{_datadir}/go/src/pkg/runtime/{cgocall,runtime}.h %{buildroot}%{_libdir}/
%if 0%{?suse_version} >= 1210
%service_add_post godoc.service
%endif
find %{_libdir}/go/pkg -type f -exec touch {} +
%post -n go-doc
find %{_libdir}/go/pkg -type f -exec touch {} +
%preun
%if 0%{?suse_version} >= 1210