diff --git a/dep.go b/dep.go index 11788694..e155b2d3 100644 --- a/dep.go +++ b/dep.go @@ -54,6 +54,29 @@ func (b Base) URLPath() string { return b[0].URLPath } +func baseAppend(bases []Base, pkg *rpc.Pkg) []Base { + for i, base := range bases { + if base.Pkgbase() == pkg.PackageBase { + bases[i] = append(bases[i], pkg) + return bases + } + } + + return append(bases, Base{pkg}) +} + +func baseFind(bases []Base, name string) *rpc.Pkg { + for _, base := range bases { + for _, pkg := range base { + if pkg.Name == name { + return pkg + } + } + } + + return nil +} + type target struct { Db string Name string