@@ -486,15 +486,14 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rp
486
486
logrus .WithField ("url" , URL ).Print ("Updating index" )
487
487
488
488
if URL .Scheme == "file" {
489
- downloadCB .Start (u , tr ("Downloading index: %s" , filepath .Base (URL .Path )))
490
489
path := paths .New (URL .Path )
491
490
if _ , err := packageindex .LoadIndexNoSign (path ); err != nil {
492
491
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 )))
493
493
downloadCB .End (false , msg )
494
494
failed = true
495
495
result .UpdatedIndexes = append (result .UpdatedIndexes , report (URL , rpc .IndexUpdateReport_STATUS_FAILED ))
496
496
} else {
497
- downloadCB .End (true , "" )
498
497
result .UpdatedIndexes = append (result .UpdatedIndexes , report (URL , rpc .IndexUpdateReport_STATUS_SKIPPED ))
499
498
}
500
499
continue
@@ -514,8 +513,6 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rp
514
513
if info , err := indexFile .Stat (); err == nil {
515
514
ageSecs := int64 (time .Since (info .ModTime ()).Seconds ())
516
515
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" ))
519
516
result .UpdatedIndexes = append (result .UpdatedIndexes , report (URL , rpc .IndexUpdateReport_STATUS_ALREADY_UP_TO_DATE ))
520
517
continue
521
518
}
0 commit comments