Skip to content

Commit

Permalink
Use match for mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhuff386 committed Sep 6, 2015
1 parent 1e84114 commit 9ac9895
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions mirror/errors.go
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import (
"github.com/dropbox/godropbox/errors" "github.com/dropbox/godropbox/errors"
) )


type BuildError struct {
errors.DropboxError
}

type UnknownType struct { type UnknownType struct {
errors.DropboxError errors.DropboxError
} }
22 changes: 20 additions & 2 deletions mirror/mirror.go
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@ func (m *Mirror) createDebian() (err error) {
return 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 { if err != nil {
return return
} }
Expand All @@ -112,7 +121,16 @@ func (m *Mirror) createRedhat() (err error) {
return 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 { if err != nil {
return return
} }
Expand Down

0 comments on commit 9ac9895

Please sign in to comment.