import rust-clircle-0.4.0-5.el10

i10ce changed/i10ce/rust-clircle-0.4.0-5.el10
MSVSphere Packaging Team 2 months ago
commit 4e807bd0e0
Signed by: sys_gitsync
GPG Key ID: B2B0B9F29E528FE8

1
.gitignore vendored

@ -0,0 +1 @@
SOURCES/clircle-0.4.0.crate

@ -0,0 +1 @@
9d6de87e6ac24cf2ddd161aec807ef0ba5857f56 SOURCES/clircle-0.4.0.crate

@ -0,0 +1,17 @@
--- clircle-0.4.0/Cargo.toml 1970-01-01T00:00:01+00:00
+++ clircle-0.4.0/Cargo.toml 2024-10-23T20:12:14.073424+00:00
@@ -55,14 +55,3 @@
features = ["term"]
default-features = false
-[target."cfg(windows)".dependencies.winapi]
-version = "0.3.9"
-features = [
- "winnt",
- "winbase",
- "processenv",
- "handleapi",
- "ntdef",
- "fileapi",
- "std",
-]

@ -0,0 +1,11 @@
--- clircle-0.4.0/Cargo.toml 1970-01-01T00:00:01+00:00
+++ clircle-0.4.0/Cargo.toml 2024-10-23T20:12:19.939974+00:00
@@ -51,7 +51,7 @@
version = "0.2"
[target."cfg(not(windows))".dev-dependencies.nix]
-version = "0.24.1"
+version = "0.29"
features = ["term"]
default-features = false

@ -0,0 +1,66 @@
diff --git a/src/clircle_unix.rs b/src/clircle_unix.rs
index 101f208..56448b9 100644
--- a/src/clircle_unix.rs
+++ b/src/clircle_unix.rs
@@ -4,7 +4,7 @@ use std::convert::TryFrom;
use std::fs::File;
use std::io::{self, Seek};
use std::os::unix::fs::MetadataExt;
-use std::os::unix::io::{FromRawFd, IntoRawFd, RawFd};
+use std::os::unix::io::{FromRawFd, IntoRawFd, OwnedFd, RawFd};
use std::{cmp, hash, ops};
/// Re-export of libc
@@ -53,6 +53,13 @@ impl UnixIdentifier {
ident
})
}
+
+ fn try_from_owned_fd(fd: OwnedFd) -> io::Result<Self> {
+ Self::try_from(File::from(fd)).map(|mut ident| {
+ ident.owns_fd = true;
+ ident
+ })
+ }
}
impl Clircle for UnixIdentifier {
@@ -135,6 +142,7 @@ mod tests {
use std::error::Error;
use std::io::Write;
+ use std::os::unix::io::AsRawFd;
use nix::pty::{openpty, OpenptyResult};
use nix::unistd::close;
@@ -186,7 +194,7 @@ mod tests {
#[test]
fn test_pty_equal_but_not_conflicting() -> Result<(), &'static str> {
let OpenptyResult { master, slave } = openpty(None, None).expect("Could not open pty.");
- let res = unsafe { UnixIdentifier::try_from_raw_fd(slave, false) }
+ let res = unsafe { UnixIdentifier::try_from_raw_fd(slave.as_raw_fd(), false) }
.map_err(|_| "Error creating UnixIdentifier from pty fd")
.and_then(|ident| {
if !ident.eq(&ident) {
@@ -196,7 +204,7 @@ mod tests {
return Err("pty fd does not conflict with itself, but conflict detected");
}
- let second_ident = unsafe { UnixIdentifier::try_from_raw_fd(slave, false) }
+ let second_ident = UnixIdentifier::try_from_owned_fd(slave)
.map_err(|_| "Error creating second Identifier to pty")?;
if !ident.eq(&second_ident) {
return Err("ident != second_ident");
@@ -209,12 +217,6 @@ mod tests {
Ok(())
});
- let r1 = close(master);
- let r2 = close(slave);
-
- r1.expect("Error closing master end of pty");
- r2.expect("Error closing slave end of pty");
-
res
}
}

@ -0,0 +1,134 @@
## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 5;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
# Generated by rust2rpm 26
%bcond_without check
%global debug_package %{nil}
%global crate clircle
Name: rust-clircle
Version: 0.4.0
Release: %autorelease
Summary: Detect IO circles in your CLI apps arguments
License: MIT OR Apache-2.0
URL: https://crates.io/crates/clircle
Source: %{crates_source}
# Automatically generated patch to strip dependencies and normalize metadata
Patch: clircle-fix-metadata-auto.diff
# Manually created patch for downstream crate metadata changes
# * bump nix from 0.24.1 to 0.29
Patch: clircle-fix-metadata.diff
# Handle nix now returning OwnedFd since 0.27
Patch: clircle-handle_ownedfd_for_nix_ge_0_27.diff
BuildRequires: cargo-rpm-macros >= 24
%global _description %{expand:
Detect IO circles in your CLI apps arguments.}
%description %{_description}
%package devel
Summary: %{summary}
BuildArch: noarch
%description devel %{_description}
This package contains library source intended for building other packages which
use the "%{crate}" crate.
%files devel
%license %{crate_instdir}/LICENSE-APACHE
%license %{crate_instdir}/LICENSE-MIT
%doc %{crate_instdir}/README.md
%{crate_instdir}/
%package -n %{name}+default-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+default-devel %{_description}
This package contains library source intended for building other packages which
use the "default" feature of the "%{crate}" crate.
%files -n %{name}+default-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+serde-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+serde-devel %{_description}
This package contains library source intended for building other packages which
use the "serde" feature of the "%{crate}" crate.
%files -n %{name}+serde-devel
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%build
%cargo_build
%install
%cargo_install
%if %{with check}
%check
%cargo_test
%endif
%changelog
* Fri Dec 20 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 0.4.0-5
- Rebuilt for MSVSphere 10
## START: Generated by rpmautospec
* Wed Oct 23 2024 Fabio Valentini <decathorpe@gmail.com> - 0.4.0-5
- Fix port of test code to nix 0.29 to avoid flaky failures
* Wed Oct 23 2024 Michel Lind <salimma@fedoraproject.org> - 0.4.0-4
- Bump nix from 0.24.1 to 0.29
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Oct 29 2023 Michel Lind <salimma@fedoraproject.org> - 0.4.0-1
- Update to 0.4.0
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Fabio Valentini <decathorpe@gmail.com> - 0.3.0-5
- Regenerate with rust2rpm v24
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sun Nov 14 2021 Robert-André Mauchin <zebob.m@gmail.com> - 0.3.0-1
- Initial import
## END: Generated by rpmautospec
Loading…
Cancel
Save