mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-20 19:38:39 +00:00
Add final / to archive URL if missing.
This commit is contained in:
6
debian/remote.go
vendored
6
debian/remote.go
vendored
@@ -80,6 +80,12 @@ func NewRemoteRepo(name string, archiveRoot string, distribution string, compone
|
||||
|
||||
func (repo *RemoteRepo) prepare() error {
|
||||
var err error
|
||||
|
||||
// Add final / to URL
|
||||
if !strings.HasSuffix(repo.ArchiveRoot, "/") {
|
||||
repo.ArchiveRoot = repo.ArchiveRoot + "/"
|
||||
}
|
||||
|
||||
repo.archiveRootURL, err = url.Parse(repo.ArchiveRoot)
|
||||
return err
|
||||
}
|
||||
|
||||
2
debian/remote_test.go
vendored
2
debian/remote_test.go
vendored
@@ -79,7 +79,7 @@ type RemoteRepoSuite struct {
|
||||
var _ = Suite(&RemoteRepoSuite{})
|
||||
|
||||
func (s *RemoteRepoSuite) SetUpTest(c *C) {
|
||||
s.repo, _ = NewRemoteRepo("yandex", "http://mirror.yandex.ru/debian/", "squeeze", []string{"main"}, []string{}, false)
|
||||
s.repo, _ = NewRemoteRepo("yandex", "http://mirror.yandex.ru/debian", "squeeze", []string{"main"}, []string{}, false)
|
||||
s.flat, _ = NewRemoteRepo("exp42", "http://repos.express42.com/virool/precise/", "./", []string{}, []string{}, false)
|
||||
s.downloader = http.NewFakeDownloader().ExpectResponse("http://mirror.yandex.ru/debian/dists/squeeze/Release", exampleReleaseFile)
|
||||
s.progress = console.NewProgress()
|
||||
|
||||
Reference in New Issue
Block a user