Add repository functionality to BPM #4
6
main.go
6
main.go
@ -268,12 +268,6 @@ func resolveCommand() {
|
||||
}
|
||||
}
|
||||
for _, repo := range utils.BPMConfig.Repositories {
|
||||
if repo.Disabled {
|
||||
if verbose {
|
||||
fmt.Printf("Skipping repository (%s) because it is disabled\n", repo.Name)
|
||||
}
|
||||
continue
|
||||
}
|
||||
fmt.Printf("Fetching package database for repository (%s)...\n", repo.Name)
|
||||
err := repo.SyncLocalDatabase()
|
||||
if err != nil {
|
||||
|
@ -33,6 +33,11 @@ func ReadConfig() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
for i := len(BPMConfig.Repositories) - 1; i >= 0; i-- {
|
||||
if BPMConfig.Repositories[i].Disabled != nil && *BPMConfig.Repositories[i].Disabled {
|
||||
BPMConfig.Repositories = append(BPMConfig.Repositories[:i], BPMConfig.Repositories[i+1:]...)
|
||||
}
|
||||
}
|
||||
for _, repo := range BPMConfig.Repositories {
|
||||
repo.Entries = make(map[string]*RepositoryEntry)
|
||||
err := repo.ReadLocalDatabase()
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
type Repository struct {
|
||||
Name string `yaml:"name"`
|
||||
Source string `yaml:"source"`
|
||||
Disabled bool `yaml:"disabled"`
|
||||
Disabled *bool `yaml:"disabled"`
|
||||
Entries map[string]*RepositoryEntry
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user