Update to 0.15.4

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Raits 2020-06-21 10:44:23 +02:00
parent b6d6958042
commit ddcc7444a0
No known key found for this signature in database
GPG Key ID: 115D5AB89C5C1E1E
5 changed files with 91 additions and 13 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@
/bat-0.15.0.crate
/bat-0.15.1.crate
/bat-0.15.2.crate
/bat-0.15.4.crate

View File

@ -0,0 +1,58 @@
From 19996e8fdf180260ff618479ff163cbc4ecfc23c Mon Sep 17 00:00:00 2001
From: Igor Raits <i.gnatenko.brain@gmail.com>
Date: Sun, 21 Jun 2020 10:16:03 +0200
Subject: [PATCH] Siwtch to path-absolutize
This reverts commit bd17fd571f99d52b4d76a24aee719dcd89a0244d.
Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
---
Cargo.toml | 2 +-
src/assets.rs | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 949375b..53804d2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -51,7 +51,7 @@ globset = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
semver = "0.10"
-path_abs = { version = "0.5", default-features = false }
+path-absolutize = { version = "3", features = ["lazy_static_cache"] }
[dependencies.git2]
version = "0.13"
diff --git a/src/assets.rs b/src/assets.rs
index 86c3fe0..3899d7c 100644
--- a/src/assets.rs
+++ b/src/assets.rs
@@ -1,3 +1,4 @@
+use std::borrow::Cow;
use std::collections::BTreeMap;
use std::ffi::OsStr;
use std::fs::{self, File};
@@ -8,7 +9,7 @@ use syntect::dumps::{dump_to_file, from_binary, from_reader};
use syntect::highlighting::{Theme, ThemeSet};
use syntect::parsing::{SyntaxReference, SyntaxSet, SyntaxSetBuilder};
-use path_abs::PathAbs;
+use path_absolutize::Absolutize;
use crate::assets_metadata::AssetsMetadata;
use crate::error::*;
@@ -216,10 +217,7 @@ impl HighlightingAssets {
if let Some(path_str) = path_str {
// If a path was provided, we try and detect the syntax based on extension mappings.
let path = Path::new(path_str);
- let absolute_path = PathAbs::new(path)
- .ok()
- .map(|p| p.as_path().to_path_buf())
- .unwrap_or_else(|| path.to_owned());
+ let absolute_path = path.absolutize().unwrap_or(Cow::Borrowed(path));
match mapping.get_syntax_for(absolute_path) {
Some(MappingTarget::MapToUnknown) => line_syntax.ok_or_else(|| {
--
2.27.0

14
bat-fix-metadata.diff Normal file
View File

@ -0,0 +1,14 @@
--- bat-0.15.4/Cargo.toml 2020-05-27T10:03:57+00:00
+++ bat-0.15.4/Cargo.toml 2020-06-21T08:43:31.589254+00:00
@@ -71,9 +71,8 @@
version = "1.4"
optional = true
-[dependencies.path_abs]
-version = "0.5"
-default-features = false
+[dependencies.path-absolutize]
+version = "3"
[dependencies.semver]
version = "0.9"

View File

@ -4,7 +4,7 @@
%global crate bat
Name: rust-%{crate}
Version: 0.15.2
Version: 0.15.4
Release: 1%{?dist}
Summary: cat(1) clone with wings
@ -12,6 +12,9 @@ Summary: cat(1) clone with wings
License: MIT or ASL 2.0
URL: https://crates.io/crates/bat
Source: %{crates_source}
# Initial patched metadata
# * Switch to path-absolutize, https://github.com/sharkdp/bat/pull/1025
Patch0: bat-fix-metadata.diff
ExclusiveArch: %{rust_arches}
%if %{__cargo_skip_build}
@ -28,17 +31,16 @@ Cat(1) clone with wings.}
%if ! %{__cargo_skip_build}
%package -n %{crate}
Summary: %{summary}
# * ASL 2.0
# * ASL 2.0 or Boost
# * ASL 2.0 or MIT
# * BSD
# * CC0
# * ISC
# * LGPLv3+
# * MIT
# * MIT or ASL 2.0
# * Unlicense or MIT
# * zlib
# ASL 2.0
# ASL 2.0 or Boost
# BSD
# CC0
# ISC
# LGPLv3+
# MIT
# MIT or ASL 2.0
# Unlicense or MIT
# zlib
License: ASL 2.0 and BSD and CC0 and ISC and LGPLv3+ and MIT and zlib
%description -n %{crate} %{_description}
@ -258,6 +260,9 @@ install -Dpm0644 -t %{buildroot}%{_datadir}/fish/vendor_completions.d \
%endif
%changelog
* Sun Jun 21 10:43:31 CEST 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.15.4-1
- Update to 0.15.4
* Mon May 25 18:52:24 CEST 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.15.2-1
- Update to 0.15.2

View File

@ -1 +1 @@
SHA512 (bat-0.15.2.crate) = 2769aa135bbae30ee4b0d93eaa28f36e99f1b2ab39a1cb365cb295aec75e1b7ff61b82a8c2a0ed9585d22bec5824518fedb1dd301e846577ad8d8a0ce2138c34
SHA512 (bat-0.15.4.crate) = 159fc9483c5fbc20df1451abb748e09c8953434ace907127388f4c22ab9fb545cbe8390d25005d00685074efd097111afab91ca87ada043720bfcdf83cfa526d