Skip to content

Commit 6b87db8

Browse files
committed
Bump cheggaaa/pb library to newer version
Signed-off-by: João Pereira <[email protected]>
1 parent 8bcd84d commit 6b87db8

File tree

8 files changed

+52
-44
lines changed

8 files changed

+52
-44
lines changed

.github/license/LICENSE-WITH-3RD-PARTY-LICENSES

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -840,34 +840,35 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
840840
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
841841
THE SOFTWARE.
842842

843-
For vendor/gopkg.in/cheggaaa/pb.v1:
844-
845-
Copyright (c) 2012-2015, Sergey Cherepanov All rights reserved.
843+
For vendor/github.com/cheggaaa/pb:
844+
Copyright (c) 2012-2024, Sergey Cherepanov
845+
All rights reserved.
846846

847847
Redistribution and use in source and binary forms, with or without
848848
modification, are permitted provided that the following conditions are met:
849849

850-
* Redistributions of source code must retain the above copyright notice, this
851-
* list of conditions and the following disclaimer.
850+
* Redistributions of source code must retain the above copyright notice,
851+
this list of conditions and the following disclaimer.
852852

853853
* Redistributions in binary form must reproduce the above copyright notice,
854-
* this list of conditions and the following disclaimer in the documentation
855-
* and/or other materials provided with the distribution.
854+
this list of conditions and the following disclaimer in the documentation
855+
and/or other materials provided with the distribution.
856856

857-
* Neither the name of the author nor the names of its contributors may be used
858-
* to endorse or promote products derived from this software without specific
859-
* prior written permission.
857+
* Neither the name of the author nor the names of its contributors may be
858+
used to endorse or promote products derived from this software without
859+
specific prior written permission.
860860

861-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
862-
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
863-
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
864-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
865-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
866-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
867-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
868-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
869-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
870-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
861+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
862+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
863+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
864+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
865+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
866+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
867+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
868+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
869+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
870+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
871+
THE POSSIBILITY OF SUCH DAMAGE.
871872

872873
For vendor/github.com/sabhiram/go-gitignore:
873874

actor/v7action/progress_bar.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"os"
66
"time"
77

8-
"gopkg.in/cheggaaa/pb.v1"
8+
"github.com/cheggaaa/pb/v3"
99
)
1010

1111
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . SimpleProgressBar
@@ -34,8 +34,7 @@ func (p *ProgressBar) Initialize(path string) (io.Reader, int64, error) {
3434
return nil, 0, err
3535
}
3636

37-
p.bar = pb.New(int(fileInfo.Size())).SetUnits(pb.U_BYTES)
38-
p.bar.ShowTimeLeft = false
37+
p.bar = pb.New(int(fileInfo.Size())).Set(pb.Bytes, true)
3938
p.bar.Start()
4039
return p.bar.NewProxyReader(file), fileInfo.Size(), nil
4140

command/plugin/shared/progress_bar_proxy_reader.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package shared
33
import (
44
"io"
55

6-
pb "gopkg.in/cheggaaa/pb.v1"
6+
"github.com/cheggaaa/pb/v3"
77
)
88

99
// ProgressBarProxyReader wraps a progress bar in a ProxyReader interface.
@@ -17,8 +17,9 @@ func (p ProgressBarProxyReader) Wrap(reader io.Reader) io.ReadCloser {
1717
}
1818

1919
func (p *ProgressBarProxyReader) Start(size int64) {
20-
p.bar = pb.New(int(size)).SetUnits(pb.U_BYTES)
21-
p.bar.Output = p.writer
20+
p.bar = pb.New(int(size))
21+
p.bar.Set(pb.Bytes, true)
22+
p.bar.SetWriter(p.writer)
2223
p.bar.Start()
2324
}
2425

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ require (
1818
code.cloudfoundry.org/ykk v0.0.0-20170424192843-e4df4ce2fd4d
1919
github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2
2020
github.com/blang/semver/v4 v4.0.0
21+
github.com/cheggaaa/pb/v3 v3.1.6-0.20241030110445-d0803d4621f5
2122
github.com/cloudfoundry/bosh-cli v6.4.1+incompatible
2223
github.com/creack/pty v1.1.24
2324
github.com/cyphar/filepath-securejoin v0.3.4
@@ -43,7 +44,6 @@ require (
4344
golang.org/x/net v0.31.0
4445
golang.org/x/term v0.26.0
4546
golang.org/x/text v0.20.0
46-
gopkg.in/cheggaaa/pb.v1 v1.0.28
4747
gopkg.in/yaml.v2 v2.4.0
4848
k8s.io/apimachinery v0.31.2
4949
k8s.io/client-go v0.31.2
@@ -52,6 +52,7 @@ require (
5252
require (
5353
code.cloudfoundry.org/inigo v0.0.0-20230612153013-b300679e6ed6 // indirect
5454
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
55+
github.com/VividCortex/ewma v1.2.0 // indirect
5556
github.com/bmatcuk/doublestar v1.3.4 // indirect
5657
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 // indirect
5758
github.com/charlievieth/fs v0.0.3 // indirect

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
3535
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
3636
github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2 h1:koK7z0nSsRiRiBWwa+E714Puh+DO+ZRdIyAXiXzL+lg=
3737
github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA=
38+
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
39+
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
3840
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
3941
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
4042
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
@@ -45,6 +47,8 @@ github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 h1:y4B3+GPxKlrigF1ha
4547
github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c=
4648
github.com/charlievieth/fs v0.0.3 h1:3lZQXTj4PbE81CVPwALSn+JoyCNXkZgORHN6h2XHGlg=
4749
github.com/charlievieth/fs v0.0.3/go.mod h1:hD4sRzto1Hw8zCua76tNVKZxaeZZr1RiKftjAJQRLLo=
50+
github.com/cheggaaa/pb/v3 v3.1.6-0.20241030110445-d0803d4621f5 h1:0WNR2UJeJpJs1EmPSa7nxmCeCyXrf8wjegGddFcgeCM=
51+
github.com/cheggaaa/pb/v3 v3.1.6-0.20241030110445-d0803d4621f5/go.mod h1:zg5MTEnDmw0iIbV8UYIwRA7NiCpf4FBVCXGZUtlDlJQ=
4852
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
4953
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
5054
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
@@ -376,8 +380,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
376380
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
377381
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
378382
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
379-
gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk=
380-
gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
381383
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
382384
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
383385
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=

util/download/downloadfakes/fake_progress_bar.go

Lines changed: 15 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

util/download/progress_bar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package download
33
import (
44
"io"
55

6-
pb "gopkg.in/cheggaaa/pb.v1"
6+
"github.com/cheggaaa/pb/v3"
77
)
88

99
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . ProgressBar

util/progressbar/progress_bar.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"io"
55
"time"
66

7+
"github.com/cheggaaa/pb/v3"
78
log "github.com/sirupsen/logrus"
8-
pb "gopkg.in/cheggaaa/pb.v1"
99
)
1010

1111
type ProgressBar struct {
@@ -34,8 +34,8 @@ func (p *ProgressBar) NewProgressBarWrapper(reader io.Reader, sizeOfFile int64)
3434
}
3535

3636
log.Debug("progress bar ready")
37-
p.bar = pb.New(int(sizeOfFile)).SetUnits(pb.U_BYTES)
38-
p.bar.ShowTimeLeft = false
37+
p.bar = pb.New(int(sizeOfFile))
38+
p.bar.Set(pb.Bytes, true)
3939
p.bar.Start()
4040
return p.bar.NewProxyReader(reader)
4141
}

0 commit comments

Comments
 (0)