SourceNames returns sorted list of published repo source names
()
| 651 | |
| 652 | // SourceNames returns sorted list of published repo source names |
| 653 | func (p *PublishedRepo) SourceNames() []string { |
| 654 | var sources = []string{} |
| 655 | |
| 656 | for _, component := range p.Components() { |
| 657 | var source string |
| 658 | |
| 659 | item := p.sourceItems[component] |
| 660 | if item.snapshot != nil { |
| 661 | source = item.snapshot.Name |
| 662 | } else if item.localRepo != nil { |
| 663 | source = item.localRepo.Name |
| 664 | } else { |
| 665 | panic("no snapshot/localRepo") |
| 666 | } |
| 667 | |
| 668 | sources = append(sources, fmt.Sprintf("%s:%s", source, component)) |
| 669 | } |
| 670 | |
| 671 | sort.Strings(sources) |
| 672 | return sources |
| 673 | } |
| 674 | |
| 675 | // UpdateLocalRepo inserts/updates local repository source for component |
| 676 | func (p *PublishedRepo) UpdateLocalRepo(component string, localRepo *LocalRepo) { |