Update to 7.0.0

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-01-17 10:29:50 +01:00
parent 09d3fb80df
commit bb5500dded
7 changed files with 22 additions and 190 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/tokei-6.1.2.crate
/tokei-7.0.0.crate

View File

@ -1,49 +0,0 @@
From 46ee5ff92f94e7cf7c855aa1629325a8eb28d990 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Mon, 1 Jan 2018 23:53:59 +0100
Subject: [PATCH] Bump serde_cbor to 0.8 (#167)
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
src/input.rs | 2 +-
src/language/languages.rs | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/input.rs b/src/input.rs
index 3ce6092..63ff3ed 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -65,7 +65,7 @@ mod io {
}
#[cfg(feature = "cbor")]
- pub fn from_cbor(contents: &String) -> serde_cbor::Result<LanguageMap> {
+ pub fn from_cbor(contents: &String) -> serde_cbor::error::Result<LanguageMap> {
use self::hex::FromHex;
use std::error::Error;
use std::process;
diff --git a/src/language/languages.rs b/src/language/languages.rs
index ba996db..d590140 100644
--- a/src/language/languages.rs
+++ b/src/language/languages.rs
@@ -191,7 +191,7 @@ impl Languages {
/// # }
/// ```
#[cfg(feature = "cbor")]
- pub fn from_cbor(cbor: &[u8]) -> serde_cbor::Result<Self> {
+ pub fn from_cbor(cbor: &[u8]) -> serde_cbor::error::Result<Self> {
Ok(Self::from_previous(serde_cbor::from_slice(cbor.into())?))
}
@@ -353,7 +353,7 @@ impl Languages {
/// # }
/// ```
#[cfg(feature = "cbor")]
- pub fn to_cbor(self) -> Result<Vec<u8>, serde_cbor::Error> {
+ pub fn to_cbor(self) -> Result<Vec<u8>, serde_cbor::error::Error> {
serde_cbor::to_vec(&self.remove_empty())
}
--
2.15.1

View File

@ -1,67 +0,0 @@
From c3b6fd7b774f6eb54127d4b71677ac907bf77aa5 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <ignatenko@redhat.com>
Date: Sat, 2 Dec 2017 15:59:44 +0100
Subject: [PATCH] bump ignore to 0.3, rayon to 0.9, handlebars to 0.29, hex to
0.3 (#158)
* bump ignore to 0.3
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* bump rayon to 0.9
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* bump handlebars to 0.29
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* bump hex to 0.3
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* bump lazy_static to 1
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
src/language/language_type.hbs.rs | 2 +-
src/language/languages.rs | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/language/language_type.hbs.rs b/src/language/language_type.hbs.rs
index e97b137..da42e4e 100644
--- a/src/language/language_type.hbs.rs
+++ b/src/language/language_type.hbs.rs
@@ -247,7 +247,7 @@ pub fn get_filetype_from_shebang<P>(file: P) -> Option<&'static str>
|
{{~/unless}}
{{~/each}}
- => Some("{{this.extensions[0]}}"),
+ => Some("{{this.extensions.[0]}}"),
{{~/if}}
{{~/each}}
env => {
diff --git a/src/language/languages.rs b/src/language/languages.rs
index effabeb..ba996db 100644
--- a/src/language/languages.rs
+++ b/src/language/languages.rs
@@ -339,7 +339,6 @@ impl Languages {
/// extern crate tokei;
/// # use tokei::*;
/// extern crate hex;
- /// use hex::ToHex;
///
/// # fn main () {
/// let cbor = "a16452757374a666626c616e6b730564636f64650c68636f6d6d656e747\
@@ -350,7 +349,7 @@ impl Languages {
/// let mut languages = Languages::new();
/// languages.get_statistics(vec!["build.rs"], vec![]);
///
- /// assert_eq!(cbor, &languages.to_cbor().unwrap().to_hex());
+ /// assert_eq!(cbor, hex::encode(&languages.to_cbor().unwrap()));
/// # }
/// ```
#[cfg(feature = "cbor")]
--
2.15.1

View File

@ -6,25 +6,16 @@
%global crate tokei
Name: rust-%{crate}
Version: 6.1.2
Release: 8%{?dist}
Version: 7.0.0
Release: 1%{?dist}
Summary: Utility that allows you to count code, quickly
License: MIT or ASL 2.0
URL: https://crates.io/crates/tokei
Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
# Initial patched metadata
# * Bump ignore to 0.3
# * Bump rayon to 0.9
# * Bump handlebars to 0.29
# * Bump hex to 0.3
# * Bump lazy_static to 1
# * Bump serde_cbor to 0.8
Patch0: tokei-6.1.2-fix-metadata.diff
# https://github.com/Aaronepower/tokei/commit/c3b6fd7b774f6eb54127d4b71677ac907bf77aa5
Patch1: 0001-bump-ignore-to-0.3-rayon-to-0.9-handlebars-to-0.29-h.patch
# https://github.com/Aaronepower/tokei/commit/46ee5ff92f94e7cf7c855aa1629325a8eb28d990
Patch2: 0001-Bump-serde_cbor-to-0.8-167.patch
# * Bump env_logger to 0.5.0, https://github.com/Aaronepower/tokei/pull/176
Patch0: tokei-7.0.0-fix-metadata.diff
ExclusiveArch: %{rust_arches}
@ -32,11 +23,10 @@ BuildRequires: rust-packaging
# [dependencies]
BuildRequires: (crate(clap) >= 2.24.0 with crate(clap) < 3.0.0)
BuildRequires: (crate(encoding) >= 0.2.0 with crate(encoding) < 0.3.0)
BuildRequires: (crate(env_logger) >= 0.4.0 with crate(env_logger) < 0.5.0)
BuildRequires: (crate(errln) >= 0.1.0 with crate(errln) < 0.2.0)
BuildRequires: (crate(env_logger) >= 0.5.0 with crate(env_logger) < 0.6.0)
BuildRequires: (crate(hex) >= 0.3.0 with crate(hex) < 0.4.0)
BuildRequires: (crate(ignore) >= 0.3.0 with crate(ignore) < 0.4.0)
BuildRequires: (crate(log) >= 0.3.0 with crate(log) < 0.4.0)
BuildRequires: (crate(log) >= 0.4.0 with crate(log) < 0.5.0)
BuildRequires: (crate(rayon) >= 0.9.0 with crate(rayon) < 0.10.0)
BuildRequires: (crate(regex) >= 0.2.0 with crate(regex) < 0.3.0)
BuildRequires: (crate(serde) >= 1.0.0 with crate(serde) < 2.0.0)
@ -99,6 +89,9 @@ which use %{crate} from crates.io.
%{cargo_registry}/%{crate}-%{version}/
%changelog
* Wed Jan 17 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 7.0.0-1
- Update to 7.0.0
* Mon Jan 08 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 6.1.2-8
- Rebuild for rust-packaging v5

View File

@ -1 +1 @@
SHA512 (tokei-6.1.2.crate) = fcab141eea6204a097e474575a9c2982f2fb6417834c7af9aa54bb714d7fe81a4685647da099e3e5e812555f601172896d4ae61734d9afec404391c221db8e9f
SHA512 (tokei-7.0.0.crate) = bb6553e3738661bd11415ad72fddc1da321b7742b2f17c883f3970acbd4382048bd127e1f95892148ae09d81fbba368bc027c2a91ace642c9e6a99df1fe918df

View File

@ -1,57 +0,0 @@
--- tokei-6.1.2/Cargo.toml 1970-01-01T01:00:00+01:00
+++ tokei-6.1.2/Cargo.toml 2018-01-02T11:59:31.633108+01:00
@@ -27,11 +27,11 @@
lto = true
panic = "abort"
[dependencies.serde_cbor]
-version = "0.6"
+version = "0.8"
optional = true
[dependencies.hex]
-version = "0.2"
+version = "0.3"
optional = true
[dependencies.encoding]
@@ -60,7 +60,7 @@
features = []
[dependencies.ignore]
-version = "0.2"
+version = "0.3"
[dependencies.errln]
version = "0.1"
@@ -74,7 +74,7 @@
optional = true
[dependencies.rayon]
-version = "0.7"
+version = "0.9"
[dependencies.clap]
version = "2.24"
@@ -82,18 +82,18 @@
version = "0.3"
[dev-dependencies.lazy_static]
-version = "0.2"
+version = "1"
[build-dependencies.ignore]
-version = "0.2"
+version = "0.3"
[build-dependencies.handlebars]
-version = "0.27"
+version = "0.29"
[build-dependencies.serde_json]
version = "1"
[build-dependencies.lazy_static]
-version = "0.2"
+version = "1"
[features]
default = []

View File

@ -0,0 +1,11 @@
--- tokei-7.0.0/Cargo.toml 1970-01-01T01:00:00+01:00
+++ tokei-7.0.0/Cargo.toml 2018-01-17T10:30:26.064945+01:00
@@ -33,7 +33,7 @@
version = "0.2"
[dependencies.env_logger]
-version = "0.5.0-rc.2"
+version = "0.5.0"
features = []
[dependencies.hex]