]> Cypherpunks.ru repositories - gocheese.git/blobdiff - main.go
Drop PGP signatures support
[gocheese.git] / main.go
diff --git a/main.go b/main.go
index b2d3250a3fbf57365a5161eb1be888466836c09d..89aa5a62b6e59aa4e6a6174d5315a406ba24383a 100644 (file)
--- a/main.go
+++ b/main.go
@@ -44,7 +44,7 @@ import (
 )
 
 const (
-       Version   = "3.7.1"
+       Version   = "4.0.0"
        UserAgent = "GoCheese/" + Version
 )
 
@@ -59,7 +59,6 @@ var (
 
        NoRefreshURLPath = flag.String("norefresh", DefaultNoRefreshURLPath, "")
        RefreshURLPath   = flag.String("refresh", DefaultRefreshURLPath, "")
-       GPGUpdateURLPath = flag.String("gpgupdate", DefaultGPGUpdateURLPath, "")
        JSONURLPath      = flag.String("json", DefaultJSONURLPath, "")
 
        PyPIURL      = flag.String("pypi", DefaultPyPIURL, "")
@@ -82,7 +81,7 @@ func servePkg(w http.ResponseWriter, r *http.Request, pkgName, filename string)
        log.Println(r.RemoteAddr, "get", filename)
        path := filepath.Join(Root, pkgName, filename)
        if _, err := os.Stat(path); os.IsNotExist(err) {
-               if !refreshDir(w, r, pkgName, filename, false) {
+               if !refreshDir(w, r, pkgName, filename) {
                        return
                }
        }
@@ -95,16 +94,11 @@ func handler(w http.ResponseWriter, r *http.Request) {
        case "GET":
                var path string
                var autorefresh bool
-               var gpgUpdate bool
                if strings.HasPrefix(r.URL.Path, *NoRefreshURLPath) {
                        path = strings.TrimPrefix(r.URL.Path, *NoRefreshURLPath)
                } else if strings.HasPrefix(r.URL.Path, *RefreshURLPath) {
                        path = strings.TrimPrefix(r.URL.Path, *RefreshURLPath)
                        autorefresh = true
-               } else if strings.HasPrefix(r.URL.Path, *GPGUpdateURLPath) {
-                       path = strings.TrimPrefix(r.URL.Path, *GPGUpdateURLPath)
-                       autorefresh = true
-                       gpgUpdate = true
                } else {
                        http.Error(w, "unknown action", http.StatusBadRequest)
                        return
@@ -118,7 +112,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
                        if parts[0] == "" {
                                listRoot(w, r)
                        } else {
-                               serveListDir(w, r, parts[0], autorefresh, gpgUpdate)
+                               serveListDir(w, r, parts[0], autorefresh)
                        }
                } else {
                        servePkg(w, r, parts[0], parts[1])
@@ -252,9 +246,6 @@ func main() {
        http.HandleFunc(*JSONURLPath, serveJSON)
        http.HandleFunc(*NoRefreshURLPath, handler)
        http.HandleFunc(*RefreshURLPath, handler)
-       if *GPGUpdateURLPath != "" {
-               http.HandleFunc(*GPGUpdateURLPath, handler)
-       }
 
        if *DoUCSPI {
                server.SetKeepAlivesEnabled(false)