Skip to content

Commit 7955539

Browse files
committed
Do not make any output in case of skipped/already-up-to-date
1 parent 2a634d7 commit 7955539

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: commands/instances.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -486,15 +486,14 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rp
486486
logrus.WithField("url", URL).Print("Updating index")
487487

488488
if URL.Scheme == "file" {
489-
downloadCB.Start(u, tr("Downloading index: %s", filepath.Base(URL.Path)))
490489
path := paths.New(URL.Path)
491490
if _, err := packageindex.LoadIndexNoSign(path); err != nil {
492491
msg := fmt.Sprintf("%s: %v", tr("Invalid package index in %s", path), err)
492+
downloadCB.Start(u, tr("Downloading index: %s", filepath.Base(URL.Path)))
493493
downloadCB.End(false, msg)
494494
failed = true
495495
result.UpdatedIndexes = append(result.UpdatedIndexes, report(URL, rpc.IndexUpdateReport_STATUS_FAILED))
496496
} else {
497-
downloadCB.End(true, "")
498497
result.UpdatedIndexes = append(result.UpdatedIndexes, report(URL, rpc.IndexUpdateReport_STATUS_SKIPPED))
499498
}
500499
continue
@@ -514,8 +513,6 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rp
514513
if info, err := indexFile.Stat(); err == nil {
515514
ageSecs := int64(time.Since(info.ModTime()).Seconds())
516515
if ageSecs < req.GetUpdateIfOlderThanSecs() {
517-
downloadCB.Start(u, tr("Downloading index: %s", filepath.Base(URL.Path)))
518-
downloadCB.End(true, tr("Index is already up-to-date"))
519516
result.UpdatedIndexes = append(result.UpdatedIndexes, report(URL, rpc.IndexUpdateReport_STATUS_ALREADY_UP_TO_DATE))
520517
continue
521518
}

0 commit comments

Comments
 (0)