summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-04-19 14:35:51 +0200
committerOndřej Surý <ondrej@sury.org>2012-04-19 14:35:51 +0200
commitfb12c54088114bf5b8632175db4d111bae114f08 (patch)
treed93b483ba9cec1082df13fe9b132dee730de3df3
parent4beba472d8504dd7b56b538a29a900153802b6ee (diff)
downloadgolang-fb12c54088114bf5b8632175db4d111bae114f08.tar.gz
Apply godoc patch to display package list correctly (Closes: #669354)
-rw-r--r--debian/patches/godoc-symlinks.diff26
-rw-r--r--debian/patches/series1
2 files changed, 27 insertions, 0 deletions
diff --git a/debian/patches/godoc-symlinks.diff b/debian/patches/godoc-symlinks.diff
new file mode 100644
index 000000000..d8a1150ab
--- /dev/null
+++ b/debian/patches/godoc-symlinks.diff
@@ -0,0 +1,26 @@
+--- a/src/cmd/godoc/filesystem.go
++++ b/src/cmd/godoc/filesystem.go
+@@ -121,7 +121,22 @@ func (root osFS) Stat(path string) (os.F
+ }
+
+ func (root osFS) ReadDir(path string) ([]os.FileInfo, error) {
+- return ioutil.ReadDir(root.resolve(path)) // is sorted
++ fis, err := ioutil.ReadDir(path) // is sorted
++ if err != nil {
++ return nil, err
++ }
++ // Replace symlinks with what they are pointing to
++ dirPrefix := path + "/"
++ for i, fi := range fis {
++ if fi.Mode() & os.ModeSymlink != 0 {
++ fi, err = os.Stat(dirPrefix + fi.Name())
++ if err != nil {
++ return nil, err
++ }
++ }
++ fis[i] = fi
++ }
++ return fis, nil
+ }
+
+ // hasPathPrefix returns true if x == y or x == y + "/" + more
diff --git a/debian/patches/series b/debian/patches/series
index 3fabf736f..dc082f6b4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@
#012-sigfillset_kFreeBSD.patch
#013-kFreeBSD-AI_MASK.patch
014-dont_fail_test_with_missing_homedir.patch
+godoc-symlinks.diff