Update to new PublishedRepo with multiple components. #36

Multiple component publishing doesn't work yet, but old features are working.
This commit is contained in:
Andrey Smirnov
2014-06-03 17:09:00 +04:00
parent ee71b93669
commit 7192049c16
26 changed files with 58 additions and 42 deletions
+7 -3
View File
@@ -303,23 +303,27 @@ func (p *PublishedRepo) Components() []string {
// UpdateLocalRepo updates content from local repo in component
func (p *PublishedRepo) UpdateLocalRepo(component string) {
item := p.sourceItems[component]
if p.SourceKind != "local" {
panic("not local repo publish")
}
item := p.sourceItems[component]
item.packageRefs = item.localRepo.RefList()
p.sourceItems[component] = item
p.rePublishing = true
}
// UpdateSnapshot switches snapshot for component
func (p *PublishedRepo) UpdateSnapshot(component string, snapshot *Snapshot) {
item := p.sourceItems[component]
if p.SourceKind != "snapshot" {
panic("not snapshot publish")
}
item := p.sourceItems[component]
item.snapshot = snapshot
p.sourceItems[component] = item
p.Sources[component] = snapshot.UUID
p.rePublishing = true
}
@@ -846,7 +850,7 @@ func (collection *PublishedRepoCollection) CleanupPrefixComponentFiles(prefix st
referencedFiles := map[string][]string{}
if progress != nil {
progress.Printf("Cleaning up prefix %#v components %#v...\n", prefix, components)
progress.Printf("Cleaning up prefix %#v components %s...\n", prefix, strings.Join(components, ", "))
}
for _, r := range collection.list {