mirror of
https://github.com/containers/skopeo.git
synced 2025-09-25 20:29:24 +00:00
Update c/image after https://github.com/containers/image/pull/1816
... to work around some of the "unexpected EOF" failures. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
19
vendor/github.com/vbauerster/mpb/v8/internal/percentage.go
generated
vendored
Normal file
19
vendor/github.com/vbauerster/mpb/v8/internal/percentage.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package internal
|
||||
|
||||
import "math"
|
||||
|
||||
// Percentage is a helper function, to calculate percentage.
|
||||
func Percentage(total, current int64, width uint) float64 {
|
||||
if total <= 0 {
|
||||
return 0
|
||||
}
|
||||
if current >= total {
|
||||
return float64(width)
|
||||
}
|
||||
return float64(int64(width)*current) / float64(total)
|
||||
}
|
||||
|
||||
// PercentageRound same as Percentage but with math.Round.
|
||||
func PercentageRound(total, current int64, width uint) float64 {
|
||||
return math.Round(Percentage(total, current, width))
|
||||
}
|
10
vendor/github.com/vbauerster/mpb/v8/internal/width.go
generated
vendored
Normal file
10
vendor/github.com/vbauerster/mpb/v8/internal/width.go
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
package internal
|
||||
|
||||
// CheckRequestedWidth checks that requested width doesn't overflow
|
||||
// available width
|
||||
func CheckRequestedWidth(requested, available int) int {
|
||||
if requested < 1 || requested >= available {
|
||||
return available
|
||||
}
|
||||
return requested
|
||||
}
|
Reference in New Issue
Block a user