build(deps): bump github.com/vbauerster/mpb/v7 from 7.5.2 to 7.5.3

Bumps [github.com/vbauerster/mpb/v7](https://github.com/vbauerster/mpb) from 7.5.2 to 7.5.3.
- [Release notes](https://github.com/vbauerster/mpb/releases)
- [Commits](https://github.com/vbauerster/mpb/compare/v7.5.2...v7.5.3)

---
updated-dependencies:
- dependency-name: github.com/vbauerster/mpb/v7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Also bump the go module to 1.17 to be able to compile the new code.
Given containers/common and others already require go 1.17+ we're
safe to go.

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
dependabot[bot]
2022-09-12 12:13:29 +00:00
committed by Valentin Rothberg
parent 4aeaeafde5
commit 9457549fff
165 changed files with 420 additions and 9582 deletions

View File

@ -2,7 +2,6 @@ package mpb
import (
"io"
"io/ioutil"
"sync"
"time"
)
@ -74,7 +73,7 @@ func WithShutdownNotifier(ch chan struct{}) ContainerOption {
func WithOutput(w io.Writer) ContainerOption {
return func(s *pState) {
if w == nil {
s.output = ioutil.Discard
s.output = io.Discard
s.outputDiscarded = true
return
}

View File

@ -1,10 +0,0 @@
module github.com/vbauerster/mpb/v7
require (
github.com/VividCortex/ewma v1.2.0
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/mattn/go-runewidth v0.0.13
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
)
go 1.14

View File

@ -1,10 +0,0 @@
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

View File

@ -254,19 +254,25 @@ func (s *pState) render(cw *cwriter.Writer) error {
}
func (s *pState) flush(cw *cwriter.Writer, height int) error {
var wg sync.WaitGroup
var popCount int
rows := make([]io.Reader, 0, height)
pool := make([]*Bar, 0, s.bHeap.Len())
for s.bHeap.Len() > 0 {
var frameRowsUsed int
var usedRows int
b := heap.Pop(&s.bHeap).(*Bar)
frame := <-b.frameCh
for i := len(frame.rows) - 1; i >= 0; i-- {
if len(rows) == height {
break
if row := frame.rows[i]; len(rows) < height {
rows = append(rows, row)
usedRows++
} else {
wg.Add(1)
go func() {
_, _ = io.Copy(io.Discard, row)
wg.Done()
}()
}
rows = append(rows, frame.rows[i])
frameRowsUsed++
}
if frame.shutdown != 0 {
b.Wait() // waiting for b.done, so it's safe to read b.bs
@ -278,7 +284,7 @@ func (s *pState) flush(cw *cwriter.Writer, height int) error {
drop = true
} else if s.popCompleted && !b.bs.noPop {
if frame.shutdown > 1 {
popCount += frameRowsUsed
popCount += usedRows
drop = true
} else {
s.popPriority++
@ -300,10 +306,12 @@ func (s *pState) flush(cw *cwriter.Writer, height int) error {
for i := len(rows) - 1; i >= 0; i-- {
_, err := cw.ReadFrom(rows[i])
if err != nil {
wg.Wait()
return err
}
}
wg.Wait()
return cw.Flush(len(rows) - popCount)
}

View File

@ -2,7 +2,6 @@ package mpb
import (
"io"
"io/ioutil"
"time"
)
@ -76,5 +75,5 @@ func toReadCloser(r io.Reader) io.ReadCloser {
if rc, ok := r.(io.ReadCloser); ok {
return rc
}
return ioutil.NopCloser(r)
return io.NopCloser(r)
}