Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a workaround to ignore bad indices #27

Open
ymmt2005 opened this issue Oct 11, 2017 · 0 comments
Open

Provide a workaround to ignore bad indices #27

ymmt2005 opened this issue Oct 11, 2017 · 0 comments

Comments

@ymmt2005
Copy link
Member

Some repositories are badly configured to return wrong contents for uncompressed indices.

For instance, pkg.jenkins.io returned wrong Packages as pointed by @takumin:
#25 (comment)

Zabbix also returned wrong Sources for which go-apt-mirror implements a workaround already:

aptutil/mirror/mirror.go

Lines 243 to 257 in 66c646f

// WORKAROUND: some (zabbix) repositories returns wrong contents
// for non-existent files such as Sources (looks like the body of
// Sources.gz is returned).
if !m.mc.Source {
tmpMap := make(map[string][]*apt.FileInfo)
for p, fil := range indexMap {
base := path.Base(p)
base = base[0 : len(base)-len(path.Ext(base))]
if base == "Sources" {
continue
}
tmpMap[p] = fil
}
indexMap = tmpMap
}

Although these indices are bad, apt or apt-get will work nicely as they look compressed indices
such as Packages.bz2 or Sources.gz first.

To help users of go-apt-mirror, we should provide a general workaround for this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant