fix #1083 : do not update/overwrite 'not installed' collections sub-items on 'cscli XX upgrade' (#1089)

* fix #1083 : do not update/overwrite 'not installed' collections sub-items on 'cscli XX upgrade'
This commit is contained in:
Thibault "bui" Koechlin 2021-12-13 19:31:16 +01:00 committed by GitHub
parent c7fb6a1428
commit e5204bc1b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 8 deletions

View file

@ -149,7 +149,7 @@ func InstallItem(name string, obtype string, force bool) {
return
}
}
item, err := cwhub.DownloadLatest(csConfig.Hub, item, force)
item, err := cwhub.DownloadLatest(csConfig.Hub, item, force, false)
if err != nil {
log.Fatalf("error while downloading %s : %v", item.Name, err)
}
@ -230,7 +230,7 @@ func UpgradeConfig(itemType string, name string, force bool) {
continue
}
}
v, err = cwhub.DownloadLatest(csConfig.Hub, v, force)
v, err = cwhub.DownloadLatest(csConfig.Hub, v, force, true)
if err != nil {
log.Fatalf("%s : download failed : %v", v.Name, err)
}
@ -515,7 +515,7 @@ func silenceInstallItem(name string, obtype string) (string, error) {
if downloadOnly && it.Downloaded && it.UpToDate {
return fmt.Sprintf("%s is already downloaded and up-to-date", it.Name), nil
}
it, err := cwhub.DownloadLatest(csConfig.Hub, it, forceAction)
it, err := cwhub.DownloadLatest(csConfig.Hub, it, forceAction, false)
if err != nil {
return "", fmt.Errorf("error while downloading %s : %v", it.Name, err)
}