Permalink
Browse files

Use match for mirror

  • Loading branch information...
zachhuff386 committed Sep 6, 2015
1 parent 1e84114 commit 9ac9895f2e3e438000150df778627d5eaa677e55
Showing with 24 additions and 2 deletions.
  1. +4 −0 mirror/errors.go
  2. +20 −2 mirror/mirror.go
View
@@ -4,6 +4,10 @@ import (
"github.com/dropbox/godropbox/errors"
)
type BuildError struct {
errors.DropboxError
}
type UnknownType struct {
errors.DropboxError
}
View
@@ -88,7 +88,16 @@ func (m *Mirror) createDebian() (err error) {
return
}
debs, err := utils.FindExt(m.Root, ".deb")
match, ok := constants.ReleasesMatch[m.Distro + "-" + m.Release]
if !ok {
err = &BuildError{
errors.Newf("mirror: Failed to find match for '%s'",
m.Distro + "-" + m.Release),
}
return
}
debs, err := utils.FindMatch(m.Root, match)
if err != nil {
return
}
@@ -112,7 +121,16 @@ func (m *Mirror) createRedhat() (err error) {
return
}
err = utils.RsyncExt(m.Root, outDir, ".rpm")
match, ok := constants.ReleasesMatch[m.Distro + "-" + m.Release]
if !ok {
err = &BuildError{
errors.Newf("mirror: Failed to find match for '%s'",
m.Distro + "-" + m.Release),
}
return
}
err = utils.RsyncMatch(m.Root, outDir, match)
if err != nil {
return
}

0 comments on commit 9ac9895

Please sign in to comment.