|
|
|
|
@ -15,7 +15,6 @@ import (
|
|
|
|
|
"os" |
|
|
|
|
"path/filepath" |
|
|
|
|
|
|
|
|
|
"github.com/mvdan/basedir" |
|
|
|
|
"github.com/mvdan/fdroidcl" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
@ -102,20 +101,7 @@ func downloadEtag(url, path string, sum []byte) error {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func indexPath(name string) string { |
|
|
|
|
cache, err := basedir.Cache() |
|
|
|
|
if err != nil { |
|
|
|
|
log.Fatalf("Could not determine cache dir: %v", err) |
|
|
|
|
} |
|
|
|
|
return filepath.Join(appSubdir(cache), repoName+".jar") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func appSubdir(dir string, subdir ...string) string { |
|
|
|
|
elems := append([]string{dir, "fdroidcl"}, subdir...) |
|
|
|
|
p := filepath.Join(elems...) |
|
|
|
|
if err := os.MkdirAll(p, 0755); err != nil { |
|
|
|
|
log.Fatalf("Could not create app dir: %v", err) |
|
|
|
|
} |
|
|
|
|
return p |
|
|
|
|
return filepath.Join(mustConfig(), repoName+".jar") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func mustLoadIndex() *fdroidcl.Index { |
|
|
|
|
|