From 5bffcc56c2fb42c7773d30ff82f140b47aa6f257 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 15 Jan 2018 09:29:02 +0100 Subject: [PATCH] Update to 3.1.0 Signed-off-by: Igor Gnatenko --- .gitignore | 1 + 0001-deps-update-nix-to-0.9.patch | 64 ------------------------------- ctrlc-3.0.3-fix-metadata.diff | 17 -------- ctrlc-3.1.0-fix-metadata.diff | 11 ++++++ rust-ctrlc.spec | 15 ++++---- sources | 2 +- 6 files changed, 20 insertions(+), 90 deletions(-) delete mode 100644 0001-deps-update-nix-to-0.9.patch delete mode 100644 ctrlc-3.0.3-fix-metadata.diff create mode 100644 ctrlc-3.1.0-fix-metadata.diff diff --git a/.gitignore b/.gitignore index 8f96e09..f8c8b0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /ctrlc-3.0.3.crate +/ctrlc-3.1.0.crate diff --git a/0001-deps-update-nix-to-0.9.patch b/0001-deps-update-nix-to-0.9.patch deleted file mode 100644 index cfb1331..0000000 --- a/0001-deps-update-nix-to-0.9.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 6f9feb2f34ce539cd67850d708768352485946c6 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko -Date: Thu, 4 Jan 2018 23:52:45 +0100 -Subject: [PATCH] deps: update nix to 0.9 - -Signed-off-by: Igor Gnatenko ---- - src/lib.rs | 16 ++++++++++++---- - 1 file changed, 12 insertions(+), 4 deletions(-) - -diff --git a/src/lib.rs b/src/lib.rs -index db6b72e..91e8afb 100644 ---- a/src/lib.rs -+++ b/src/lib.rs -@@ -95,13 +95,21 @@ mod platform { - - static mut PIPE: (RawFd, RawFd) = (-1, -1); - -- extern fn os_handler(_: nix::c_int) { -+ extern fn os_handler(_: nix::libc::c_int) { - // Assuming this always succeeds. Can't really handle errors in any meaningful way. - unsafe { - unistd::write(PIPE.1, &[0u8]).is_ok(); - } - } - -+ fn nix_err_to_io_err(err: nix::Error) -> io::Error { -+ if let nix::Error::Sys(err_no) = err { -+ io::Error::from(err_no) -+ } else { -+ panic!("unexpected nix error type: {:?}", err) -+ } -+ } -+ - /// Register os signal handler. - /// - /// Must be called before calling [`block_ctrl_c()`](fn.block_ctrl_c.html) -@@ -115,12 +123,12 @@ mod platform { - use self::nix::fcntl; - use self::nix::sys::signal; - -- PIPE = unistd::pipe2(fcntl::O_CLOEXEC).map_err(|e| Error::System(e.into()))?; -+ PIPE = unistd::pipe2(fcntl::O_CLOEXEC).map_err(|e| Error::System(nix_err_to_io_err(e)))?; - - let close_pipe = |e: nix::Error| -> Error { - unistd::close(PIPE.1).is_ok(); - unistd::close(PIPE.0).is_ok(); -- Error::System(e.into()) -+ Error::System(nix_err_to_io_err(e)) - }; - - // Make sure we never block on write in the os handler. -@@ -172,7 +180,7 @@ mod platform { - Ok(1) => break, - Ok(_) => return Err(Error::System(io::ErrorKind::UnexpectedEof.into()).into()), - Err(nix::Error::Sys(nix::Errno::EINTR)) => {}, -- Err(e) => return Err(Error::System(e.into())), -+ Err(e) => return Err(Error::System(nix_err_to_io_err(e))), - } - } - --- -2.15.1 - diff --git a/ctrlc-3.0.3-fix-metadata.diff b/ctrlc-3.0.3-fix-metadata.diff deleted file mode 100644 index bec7c44..0000000 --- a/ctrlc-3.0.3-fix-metadata.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- ctrlc-3.0.3/Cargo.toml 1970-01-01T01:00:00+01:00 -+++ ctrlc-3.0.3/Cargo.toml 2018-01-04T23:55:57.200531+01:00 -@@ -26,13 +26,7 @@ - path = "src/tests.rs" - harness = false - [dependencies.nix] --version = "0.8" -- --[dependencies.winapi] --version = "0.2" -- --[dependencies.kernel32-sys] --version = "0.2" -+version = "0.9" - - [features] - termination = [] diff --git a/ctrlc-3.1.0-fix-metadata.diff b/ctrlc-3.1.0-fix-metadata.diff new file mode 100644 index 0000000..b4f005f --- /dev/null +++ b/ctrlc-3.1.0-fix-metadata.diff @@ -0,0 +1,11 @@ +--- ctrlc-3.1.0/Cargo.toml 1970-01-01T01:00:00+01:00 ++++ ctrlc-3.1.0/Cargo.toml 2018-01-15T09:29:12.866855+01:00 +@@ -30,8 +30,3 @@ + termination = [] + [target."cfg(unix)".dependencies.nix] + version = "0.9" +-[target."cfg(windows)".dependencies.kernel32-sys] +-version = "0.2" +- +-[target."cfg(windows)".dependencies.winapi] +-version = "0.2" diff --git a/rust-ctrlc.spec b/rust-ctrlc.spec index 6a56184..b89c916 100644 --- a/rust-ctrlc.spec +++ b/rust-ctrlc.spec @@ -5,21 +5,16 @@ %global crate ctrlc Name: rust-%{crate} -Version: 3.0.3 -Release: 2%{?dist} +Version: 3.1.0 +Release: 1%{?dist} Summary: Easy Ctrl-C handler for Rust projects -# License files are in upstream, but not yet in release -# https://github.com/Detegr/rust-ctrlc/commit/587c77eb89b6e0a312ef066445ad8253ca08c785 License: MIT or ASL 2.0 URL: https://crates.io/crates/ctrlc Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate # Initial patched metadata # * No windows -# * Bump nix to 0.9, https://github.com/Detegr/rust-ctrlc/pull/35 -Patch0: ctrlc-3.0.3-fix-metadata.diff -# Make it work with nix v0.9 -Patch1: 0001-deps-update-nix-to-0.9.patch +Patch0: ctrlc-3.1.0-fix-metadata.diff ExclusiveArch: %{rust_arches} @@ -56,11 +51,15 @@ which use %{crate} from crates.io. %endif %files devel +%license LICENSE-MIT LICENSE-APACHE %doc README.md %{cargo_registry}/%{crate}-%{version}/ %exclude %{cargo_registry}/%{crate}-%{version}/appveyor.yml %changelog +* Mon Jan 15 2018 Igor Gnatenko - 3.1.0-1 +- Update to 3.1.0 + * Mon Jan 08 2018 Igor Gnatenko - 3.0.3-2 - Rebuild for rust-packaging v5 diff --git a/sources b/sources index 7d3f2da..6444c35 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ctrlc-3.0.3.crate) = 4ea771c4ee780ef3dc45377a4abd6afb705faff7e50bd789ffa7c178da180354eb8889832d6bef09a7bbb23da540b40affb28e1cc601dc4b0c440795c4708623 +SHA512 (ctrlc-3.1.0.crate) = f06cc8120873289cd2c34d4209ee33dfbaada9c57bfb8d126a6cabaca9c9dbb705a0582df76488771a418eb078dc2074fce6a6b1ffbde4c32e38069af418cd1c