From 6638e649ab67811569b0b53c811dea0a3ea5152a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Thu, 25 Apr 2019 19:06:14 +0200 Subject: [PATCH] Rebuilt for rust-users 0.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Robert-André Mauchin --- 0001-Bump-users-crate-version.patch | 46 +++++++++++++++++++++++++++++ exa-fix-metadata.diff | 2 +- rust-exa.spec | 11 +++++-- 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 0001-Bump-users-crate-version.patch diff --git a/0001-Bump-users-crate-version.patch b/0001-Bump-users-crate-version.patch new file mode 100644 index 0000000..74afdb6 --- /dev/null +++ b/0001-Bump-users-crate-version.patch @@ -0,0 +1,46 @@ +From 058b4a57bdb1e25cbdacc0fbd1eefc09bc5f1e95 Mon Sep 17 00:00:00 2001 +From: Benjamin Sago +Date: Fri, 7 Dec 2018 00:59:05 +0000 +Subject: [PATCH] Bump users crate version +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +And remove an unnecessary allocation while we’re at it. Fixes #442 +--- + src/output/render/groups.rs | 4 ++-- + src/output/render/users.rs | 2 +- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/output/render/groups.rs b/src/output/render/groups.rs +index 6504e889..a3a25e70 100644 +--- a/src/output/render/groups.rs ++++ b/src/output/render/groups.rs +@@ -19,12 +19,12 @@ impl f::Group { + let current_uid = users.get_current_uid(); + if let Some(current_user) = users.get_user_by_uid(current_uid) { + if current_user.primary_group_id() == group.gid() +- || group.members().contains(¤t_user.name().to_owned()) { ++ || group.members().iter().any(|u| u == current_user.name()) { + style = colours.yours(); + } + } + +- TextCell::paint(style, group.name().to_owned()) ++ TextCell::paint(style, group.name().to_string_lossy().into()) + } + } + +diff --git a/src/output/render/users.rs b/src/output/render/users.rs +index 75ff4c6f..d7edefac 100644 +--- a/src/output/render/users.rs ++++ b/src/output/render/users.rs +@@ -9,7 +9,7 @@ use output::cell::TextCell; + impl f::User { + pub fn render(&self, colours: &C, users: &U) -> TextCell { + let user_name = match users.get_user_by_uid(self.0) { +- Some(user) => user.name().to_owned(), ++ Some(user) => user.name().to_string_lossy().into(), + None => self.0.to_string(), + }; + diff --git a/exa-fix-metadata.diff b/exa-fix-metadata.diff index 29c9e46..651f9f5 100644 --- a/exa-fix-metadata.diff +++ b/exa-fix-metadata.diff @@ -28,7 +28,7 @@ [dependencies.users] -version = "0.5.2" -+version = "0.7" ++version = "0.9" [dependencies.term_size] version = "0.3.0" diff --git a/rust-exa.spec b/rust-exa.spec index f9a217c..9c07886 100644 --- a/rust-exa.spec +++ b/rust-exa.spec @@ -7,7 +7,7 @@ Name: rust-%{crate} Version: 0.8.0 -Release: 13%{?dist} +Release: 14%{?dist} Summary: Modern replacement for ls License: MIT @@ -17,7 +17,7 @@ Source: %{crates_source} # * Bump ansi_term to 0.11, remove getopts, https://github.com/ogham/exa/commit/4c3fd5483d2eff2ea1e623878ede54eaa396e09e # * Bump env_logger to 0.6, https://github.com/ogham/exa/pull/315 # https://github.com/ogham/exa/pull/469 -# * Bump users to 0.6, https://github.com/ogham/exa/pull/395 +# * Bump users to 0.9, https://github.com/ogham/exa/pull/495 # * Bump lazy_static, https://github.com/ogham/exa/pull/322 # * Bump git2 to 0.8, https://github.com/ogham/exa/commit/f757300718b1861852d4a33459385eaf921d69e7 # https://github.com/ogham/exa/pull/461 @@ -26,6 +26,8 @@ Patch0: exa-fix-metadata.diff Patch1: 0001-Upgrade-libgit2.patch # Make it work with new env_logger Patch2: 0001-Update-log-to-0.4-and-env_logger-to-0.5.patch +# Make it work with new users +Patch3: 0001-Bump-users-crate-version.patch ExclusiveArch: %{rust_arches} @@ -46,7 +48,7 @@ BuildRequires: (crate(scoped_threadpool/default) >= 0.1.0 with crate(scoped_thr BuildRequires: (crate(term_grid/default) >= 0.1.6 with crate(term_grid/default) < 0.2.0) BuildRequires: (crate(term_size/default) >= 0.3.0 with crate(term_size/default) < 0.4.0) BuildRequires: (crate(unicode-width/default) >= 0.1.4 with crate(unicode-width/default) < 0.2.0) -BuildRequires: (crate(users/default) >= 0.7.0 with crate(users/default) < 0.8.0) +BuildRequires: (crate(users/default) >= 0.9.0 with crate(users/default) < 0.10.0) BuildRequires: (crate(zoneinfo_compiled/default) >= 0.4.5 with crate(zoneinfo_compiled/default) < 0.5.0) %global _description \ @@ -99,6 +101,9 @@ Summary: %{summary} %endif %changelog +* Thu Apr 25 17:20:22 CET 2019 Robert-André Mauchin - 0.8.0-214 +- Rebuilt for rust-users 0.9.1 + * Sun Feb 10 2019 Igor Gnatenko - 0.8.0-13 - Update git2 and env_logger deps