diff --git a/cmd/mirror_edit.go b/cmd/mirror_edit.go index 6e07d066..7c738114 100644 --- a/cmd/mirror_edit.go +++ b/cmd/mirror_edit.go @@ -55,6 +55,10 @@ func aptlyMirrorEdit(cmd *commander.Command, args []string) error { return fmt.Errorf("unable to edit: flat mirrors don't support udebs") } + if repo.IsFlat() && repo.DownloadAppStream { + return fmt.Errorf("unable to edit: flat mirrors don't support AppStream (DEP-11) metadata") + } + if repo.Filter != "" { _, err = query.Parse(repo.Filter) if err != nil { diff --git a/deb/remote.go b/deb/remote.go index aa4f1151..a1a79d68 100644 --- a/deb/remote.go +++ b/deb/remote.go @@ -116,6 +116,9 @@ func NewRemoteRepo(name string, archiveRoot string, distribution string, compone if result.DownloadUdebs { return nil, fmt.Errorf("debian-installer udebs aren't supported for flat repos") } + if result.DownloadAppStream { + return nil, fmt.Errorf("AppStream (DEP-11) metadata isn't supported for flat repos") + } result.Components = nil } diff --git a/deb/remote_test.go b/deb/remote_test.go index 95b5d181..d4558c5d 100644 --- a/deb/remote_test.go +++ b/deb/remote_test.go @@ -123,6 +123,9 @@ func (s *RemoteRepoSuite) TestFlatCreation(c *C) { _, err := NewRemoteRepo("fl", "http://some.repo/", "./", []string{"main"}, []string{}, false, false, false, false) c.Check(err, ErrorMatches, "components aren't supported for flat repos") + + _, err = NewRemoteRepo("fl", "http://some.repo/", "./", []string{}, []string{}, false, false, false, true) + c.Check(err, ErrorMatches, "AppStream \\(DEP-11\\) metadata isn't supported for flat repos") } func (s *RemoteRepoSuite) TestString(c *C) { @@ -139,8 +142,7 @@ func (s *RemoteRepoSuite) TestString(c *C) { s.repo.DownloadAppStream = true c.Check(s.repo.String(), Equals, "[yandex]: http://mirror.yandex.ru/debian/ squeeze [src] [udeb] [installer] [appstream]") - s.flat.DownloadAppStream = true - c.Check(s.flat.String(), Equals, "[exp42]: http://repos.express42.com/virool/precise/ ./ [src] [appstream]") + // AppStream is not supported for flat repos, so no flat test here } func (s *RemoteRepoSuite) TestAppStreamPaths(c *C) {