update godoc patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/go?expand=0&rev=167
This commit is contained in:
Graham Anderson 2013-07-10 12:34:19 +00:00 committed by Git OBS Bridge
parent 42c61f2795
commit 44d8d43499
3 changed files with 15 additions and 26 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Jul 10 12:33:34 UTC 2013 - graham@andtech.eu
- Fix godoc path locations patch
-------------------------------------------------------------------
Thu Jun 13 08:37:25 UTC 2013 - graham@andtech.eu

View File

@ -31,7 +31,7 @@ Source4: godoc.service
Source6: go-wiki-gadget.xml
Source5: README-openSUSE
# PATCH-FIX-OPENSUSE adjust documentation paths for API/doc server
#Patch1: godoc-path-locations.patch
Patch1: godoc-path-locations.patch
# PATCH-FIX-OPENSUSE add -s flag to 'go install' (don't rebuild/install std libs)
Patch3: go-build-dont-reinstall-stdlibs.patch
# PATCH-FIX-OPENSUSE re-enable build binary only packages (we are binary distro)
@ -93,7 +93,7 @@ Emacs syntax highlighting scheme for the Go programming language.
%prep
%setup -q -n %{name}
#%patch1 -p1
%patch1 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1

View File

@ -1,9 +1,9 @@
diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go
index f6dc678..0fa85bc 100644
index 26b0b97..580d8f7 100644
--- a/src/cmd/godoc/godoc.go
+++ b/src/cmd/godoc/godoc.go
@@ -82,7 +82,35 @@ var (
pkgHandler docServer
@@ -89,8 +89,19 @@ var (
notes = flag.String("notes", "BUG", "regular expression matching note markers to show")
)
+const (
@ -13,28 +13,12 @@ index f6dc678..0fa85bc 100644
+)
+
func initHandlers() {
fileServer = http.FileServer(&httpFS{fs})
+
+ // OPENSUSE: Bind godoc & source location
+ fs.Bind("/doc", OS(SUSE_DOC_DIR), "/doc", bindReplace)
+ fs.Bind("/src", OS(SUSE_SRC_DIR), "/src", bindBefore)
+
+ d, err := os.Open(SUSE_CONTRIB_SRC_DIR)
+ if err != nil {
+ log.Fatalf("cannot read Go contrib source dir:", err)
+ }
+ if files, err := d.Readdir(0); err == nil {
+ for _, file := range files {
+ if file.IsDir() {
+ path := SUSE_CONTRIB_SRC_DIR + file.Name()
+ if *pkgPath != "" {
+ *pkgPath += ":"
+ }
+ *pkgPath += path
+ }
+ }
+ } else {
+ log.Fatal(err)
+ }
+
// Add named directories in -path argument as
// subdirectories of src/pkg.
for _, p := range filepath.SplitList(*pkgPath) {
cmdHandler = docServer{"/cmd/", "/src/cmd"}
pkgHandler = docServer{"/pkg/", "/src/pkg"}
}