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:
parent
858eeea586
commit
39ed939f73
19
go-install-dont-reinstall-stdlibs.patch
Normal file
19
go-install-dont-reinstall-stdlibs.patch
Normal 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)
|
13
go.changes
13
go.changes
@ -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
|
Thu Aug 16 11:15:13 UTC 2012 - graham@andtech.eu
|
||||||
|
|
||||||
|
7
go.spec
7
go.spec
@ -41,6 +41,8 @@ Patch4: allow-binary-only-packages.patch
|
|||||||
Patch5: verbose-build.patch
|
Patch5: verbose-build.patch
|
||||||
# PATCH-FIX-OPENSUSE fix vim Godoc and Import helpers/autocomplete
|
# PATCH-FIX-OPENSUSE fix vim Godoc and Import helpers/autocomplete
|
||||||
Patch6: opensuse-vim.patch
|
Patch6: opensuse-vim.patch
|
||||||
|
# PATCH-FIX-OPENSUSE BNC#776058
|
||||||
|
Patch7: go-install-dont-reinstall-stdlibs.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
#BuildRequires: bison
|
#BuildRequires: bison
|
||||||
#BuildRequires: ed
|
#BuildRequires: ed
|
||||||
@ -112,6 +114,7 @@ echo %{requiretest}
|
|||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
%patch6 -p1
|
%patch6 -p1
|
||||||
|
%patch7 -p1
|
||||||
cp %{SOURCE4} .
|
cp %{SOURCE4} .
|
||||||
cp %{SOURCE5} .
|
cp %{SOURCE5} .
|
||||||
|
|
||||||
@ -217,10 +220,6 @@ ln -s %{_datadir}/go/src/pkg/runtime/{cgocall,runtime}.h %{buildroot}%{_libdir}/
|
|||||||
%if 0%{?suse_version} >= 1210
|
%if 0%{?suse_version} >= 1210
|
||||||
%service_add_post godoc.service
|
%service_add_post godoc.service
|
||||||
%endif
|
%endif
|
||||||
find %{_libdir}/go/pkg -type f -exec touch {} +
|
|
||||||
|
|
||||||
%post -n go-doc
|
|
||||||
find %{_libdir}/go/pkg -type f -exec touch {} +
|
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
%if 0%{?suse_version} >= 1210
|
%if 0%{?suse_version} >= 1210
|
||||||
|
Loading…
Reference in New Issue
Block a user