diff --git a/0001-port-to-number_prefix-0.4.patch b/0001-port-to-number_prefix-0.4.patch new file mode 100644 index 0000000..4744373 --- /dev/null +++ b/0001-port-to-number_prefix-0.4.patch @@ -0,0 +1,58 @@ +From 5d9ef658048057348644bf4ddc85543197f31123 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Tue, 20 Jul 2021 15:44:44 +0200 +Subject: [PATCH] port to number_prefix 0.4 + +--- + src/format.rs | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/format.rs b/src/format.rs +index 99eb0c4..7333248 100644 +--- a/src/format.rs ++++ b/src/format.rs +@@ -1,7 +1,7 @@ + use std::fmt; + use std::time::Duration; + +-use number_prefix::{NumberPrefix, PrefixNames, Prefixed, Standalone}; ++use number_prefix::NumberPrefix; + + /// Wraps an std duration for human basic formatting. + #[derive(Debug)] +@@ -77,8 +77,8 @@ impl fmt::Display for HumanDuration { + impl fmt::Display for HumanBytes { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match NumberPrefix::binary(self.0 as f64) { +- Standalone(number) => write!(f, "{:.0}B", number), +- Prefixed(prefix, number) => write!( ++ NumberPrefix::Standalone(number) => write!(f, "{:.0}B", number), ++ NumberPrefix::Prefixed(prefix, number) => write!( + f, + "{:.2}{}B", + number, +@@ -91,8 +91,8 @@ impl fmt::Display for HumanBytes { + impl fmt::Display for DecimalBytes { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match NumberPrefix::decimal(self.0 as f64) { +- Standalone(number) => write!(f, "{:.0}B", number), +- Prefixed(prefix, number) => write!(f, "{:.2}{}B", number, prefix), ++ NumberPrefix::Standalone(number) => write!(f, "{:.0}B", number), ++ NumberPrefix::Prefixed(prefix, number) => write!(f, "{:.2}{}B", number, prefix), + } + } + } +@@ -100,8 +100,8 @@ impl fmt::Display for DecimalBytes { + impl fmt::Display for BinaryBytes { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match NumberPrefix::binary(self.0 as f64) { +- Standalone(number) => write!(f, "{:.0}B", number), +- Prefixed(prefix, number) => write!(f, "{:.2}{}B", number, prefix), ++ NumberPrefix::Standalone(number) => write!(f, "{:.0}B", number), ++ NumberPrefix::Prefixed(prefix, number) => write!(f, "{:.2}{}B", number, prefix), + } + } + } +-- +2.31.1 + diff --git a/indicatif-fix-metadata.diff b/indicatif-fix-metadata.diff new file mode 100644 index 0000000..abb95cd --- /dev/null +++ b/indicatif-fix-metadata.diff @@ -0,0 +1,11 @@ +--- indicatif-0.15.0/Cargo.toml 2020-06-14T22:23:13+00:00 ++++ indicatif-0.15.0/Cargo.toml 2021-07-20T13:40:06.248644+00:00 +@@ -29,7 +29,7 @@ + version = "1.0" + + [dependencies.number_prefix] +-version = "0.3" ++version = "0.4" + + [dependencies.rayon] + version = "1.0" diff --git a/rust-indicatif.spec b/rust-indicatif.spec index 3d48861..c1b5d78 100644 --- a/rust-indicatif.spec +++ b/rust-indicatif.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 15 +# Generated by rust2rpm 18 %bcond_without check %global debug_package %{nil} @@ -6,13 +6,19 @@ Name: rust-%{crate} Version: 0.15.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Progress bar and cli reporting library for Rust # Upstream license specification: MIT License: MIT URL: https://crates.io/crates/indicatif Source: %{crates_source} +# Initial patched metadata +# * bump number_prefix from 0.3 to 0.4 (already upstream) +Patch0: indicatif-fix-metadata.diff +# * adapt to number_prefix 0.4 API changes: +# https://github.com/mitsuhiko/indicatif/commit/c3403b8 +Patch1: 0001-port-to-number_prefix-0.4.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} @@ -131,6 +137,9 @@ which use "with_rayon" feature of "%{crate}" crate. %endif %changelog +* Tue Jul 20 2021 Fabio Valentini - 0.15.0-4 +- Update number_prefix to 0.4. + * Wed Jan 27 2021 Fedora Release Engineering - 0.15.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild