Browse Source

Export Apk.RepoURL to make it show up in the cache

Also useful to have it exported.

Bump the cache version since current caches don't have the repo url at
all.

Fixes #19 (again).
pull/20/head
Daniel Martí 10 years ago
parent
commit
d37f81b5fb
  1. 2
      cmd/fdroidcl/update.go
  2. 10
      index.go

2
cmd/fdroidcl/update.go

@ -143,7 +143,7 @@ func indexPath(name string) string {
return filepath.Join(mustData(), name+".jar")
}
const cacheVersion = 1
const cacheVersion = 2
type cache struct {
Version int

10
index.go

@ -86,7 +86,7 @@ func (a *App) IconURLForDensity(density IconDensity) string {
if len(a.Apks) == 0 {
return ""
}
return fmt.Sprintf("%s/%s/%s", a.Apks[0].repoURL,
return fmt.Sprintf("%s/%s/%s", a.Apks[0].RepoURL,
getIconsDir(density), a.Icon)
}
@ -196,15 +196,15 @@ type Apk struct {
Hash HexHash `xml:"hash"`
AppID string `xml:"-"`
repoURL string `xml:"-"`
RepoURL string `xml:"-"`
}
func (a *Apk) URL() string {
return fmt.Sprintf("%s/%s", a.repoURL, a.ApkName)
return fmt.Sprintf("%s/%s", a.RepoURL, a.ApkName)
}
func (a *Apk) SrcURL() string {
return fmt.Sprintf("%s/%s", a.repoURL, a.SrcName)
return fmt.Sprintf("%s/%s", a.RepoURL, a.SrcName)
}
func (a *Apk) IsCompatibleABI(ABIs []string) bool {
@ -260,7 +260,7 @@ func LoadIndexXML(r io.Reader) (*Index, error) {
for j := range app.Apks {
apk := &app.Apks[j]
apk.AppID = app.ID
apk.repoURL = index.Repo.URL
apk.RepoURL = index.Repo.URL
}
}
return &index, nil

Loading…
Cancel
Save