]> Cypherpunks repositories - gostls13.git/commitdiff
goinstall: allow packages from launchpad.net/~user branches.
authorJani Monoses <jani.monoses@ubuntu.com>
Fri, 4 Nov 2011 19:07:34 +0000 (15:07 -0400)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Fri, 4 Nov 2011 19:07:34 +0000 (15:07 -0400)
The permitted filename characters should include ~ to allow
the names of user-owned branches in Launchpad.

R=golang-dev, rsc, n13m3y3r, gustavo
CC=golang-dev, gustavo.niemeyer
https://golang.org/cl/5280052

src/cmd/goinstall/make.go

index c724cda47beb6da477d0498531f2badaccf513c7..7445c9c207352703c1bb3b8662388cd5a87bf734 100644 (file)
@@ -109,7 +109,7 @@ func makeMakefile(dir, pkg string, tree *build.Tree, isCmd bool) ([]byte, error)
        return buf.Bytes(), nil
 }
 
-var safeBytes = []byte("+-./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
+var safeBytes = []byte("+-~./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
 
 func safeName(s string) bool {
        if s == "" {
@@ -118,6 +118,9 @@ func safeName(s string) bool {
        if strings.Contains(s, "..") {
                return false
        }
+       if s[0] == '~' {
+               return false
+       }
        for i := 0; i < len(s); i++ {
                if c := s[i]; c < 0x80 && bytes.IndexByte(safeBytes, c) < 0 {
                        return false