Skip to content

Commit

Permalink
[cpackget] added: total number of files found in index.pidx (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstendb-ARM authored Jun 29, 2023
1 parent 9589a41 commit 316a369
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/installer/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,14 @@ func DownloadPDSCFiles(skipInstalledPdscFiles bool, concurrency int, timeout int
}

pdscTags := Installation.PublicIndexXML.ListPdscTags()
if len(pdscTags) == 0 {
numPdsc := len(pdscTags)
if numPdsc == 0 {
log.Info("(no packs in public index)")
return nil
}

log.Infof("[J%d:F\"%s\"]", numPdsc, Installation.PublicIndex)

queue := concurrency
for _, pdscTag := range pdscTags {
if concurrency == 0 || len(pdscTags) <= concurrency {
Expand Down
1 change: 1 addition & 0 deletions cmd/utils/encodedProgress.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (p *EncodedProgress) Write(bs []byte) (int, error) {
* T: Total bytes of file or numbers of files
* P: Currently processed percentage
* C: Currently processed bytes or numbers of files
* J: Total number of files beeing processed
*/
func (p *EncodedProgress) Print() {
newPercent := int(float64(p.current) / float64(p.total) * 100)
Expand Down

0 comments on commit 316a369

Please sign in to comment.