Update to 0.11.0

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
epel9
Igor Gnatenko 7 years ago
parent f8275495a8
commit 025f6aa078
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

1
.gitignore vendored

@ -1,2 +1,3 @@
/nix-0.9.0.crate
/nix-0.10.0.crate
/nix-0.11.0.crate

@ -1,12 +1,19 @@
From b3ca1a7dd13b1ffbd768a5677b8d12346f6bf07c Mon Sep 17 00:00:00 2001
From 9e1caa42e455e7d21e489a8099f37e690c260080 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Thu, 10 May 2018 11:45:33 +0200
Subject: [PATCH] deps: update tempfile to 3
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
src/unistd.rs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
src/unistd.rs | 12 ++++++------
test/sys/test_socket.rs | 8 ++++----
test/sys/test_uio.rs | 9 ++++-----
test/test.rs | 1 -
test/test_fcntl.rs | 6 ++----
test/test_mount.rs | 19 +++++++------------
test/test_stat.rs | 12 ++++++------
test/test_unistd.rs | 11 ++++-------
8 files changed, 33 insertions(+), 45 deletions(-)
diff --git a/src/unistd.rs b/src/unistd.rs
index 8022aa0..756a4d6 100644
@ -50,6 +57,284 @@ index 8022aa0..756a4d6 100644
/// let fifo_path = tmp_dir.path().join("foo.pipe");
///
/// // create new fifo and give read, write and execute rights to the owner
diff --git a/test/sys/test_socket.rs b/test/sys/test_socket.rs
index 35e3bf9..d2a5268 100644
--- a/test/sys/test_socket.rs
+++ b/test/sys/test_socket.rs
@@ -90,9 +90,9 @@ pub fn test_abstract_uds_addr() {
pub fn test_getsockname() {
use nix::sys::socket::{socket, AddressFamily, SockType, SockFlag};
use nix::sys::socket::{bind, SockAddr};
- use tempdir::TempDir;
+ use tempfile;
- let tempdir = TempDir::new("test_getsockname").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let sockname = tempdir.path().join("sock");
let sock = socket(AddressFamily::Unix, SockType::Stream, SockFlag::empty(), None)
.expect("socket failed");
@@ -254,9 +254,9 @@ pub fn test_unixdomain() {
use nix::sys::socket::{bind, socket, connect, listen, accept, SockAddr};
use nix::unistd::{read, write, close};
use std::thread;
- use tempdir::TempDir;
+ use tempfile;
- let tempdir = TempDir::new("test_unixdomain").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let sockname = tempdir.path().join("sock");
let s1 = socket(AddressFamily::Unix, SockType::Stream,
SockFlag::empty(), None).expect("socket failed");
diff --git a/test/sys/test_uio.rs b/test/sys/test_uio.rs
index 9f56c81..cefc8bb 100644
--- a/test/sys/test_uio.rs
+++ b/test/sys/test_uio.rs
@@ -5,8 +5,7 @@ use std::{cmp, iter};
use std::fs::{OpenOptions};
use std::os::unix::io::AsRawFd;
-use tempdir::TempDir;
-use tempfile::tempfile;
+use tempfile::{self, tempfile};
#[test]
fn test_writev() {
@@ -114,7 +113,7 @@ fn test_pwrite() {
fn test_pread() {
use std::io::Write;
- let tempdir = TempDir::new("nix-test_pread").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let path = tempdir.path().join("pread_test_file");
let mut file = OpenOptions::new().write(true).read(true).create(true)
@@ -142,7 +141,7 @@ fn test_pwritev() {
IoVec::from_slice(&to_write[64..128]),
];
- let tempdir = TempDir::new("nix-test_pwritev").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
// pwritev them into a temporary file
let path = tempdir.path().join("pwritev_test_file");
@@ -166,7 +165,7 @@ fn test_preadv() {
let to_write: Vec<u8> = (0..200).collect();
let expected: Vec<u8> = (100..200).collect();
- let tempdir = TempDir::new("nix-test_preadv").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let path = tempdir.path().join("preadv_test_file");
diff --git a/test/test.rs b/test/test.rs
index 8083b8f..da55235 100644
--- a/test/test.rs
+++ b/test/test.rs
@@ -7,7 +7,6 @@ extern crate nix;
extern crate lazy_static;
extern crate libc;
extern crate rand;
-extern crate tempdir;
extern crate tempfile;
mod sys;
diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs
index 57b3583..bcc523b 100644
--- a/test/test_fcntl.rs
+++ b/test/test_fcntl.rs
@@ -1,8 +1,7 @@
use nix::fcntl::{openat, open, OFlag, readlink, readlinkat};
use nix::sys::stat::Mode;
use nix::unistd::{close, read};
-use tempdir::TempDir;
-use tempfile::NamedTempFile;
+use tempfile::{self, NamedTempFile};
use std::io::prelude::*;
use std::os::unix::fs;
@@ -30,8 +29,7 @@ fn test_openat() {
#[test]
fn test_readlink() {
- let tempdir = TempDir::new("nix-test_readdir")
- .unwrap_or_else(|e| panic!("tempdir failed: {}", e));
+ let tempdir = tempfile::tempdir().unwrap();
let src = tempdir.path().join("a");
let dst = tempdir.path().join("b");
println!("a: {:?}, b: {:?}", &src, &dst);
diff --git a/test/test_mount.rs b/test/test_mount.rs
index 89416a4..2e4f19c 100644
--- a/test/test_mount.rs
+++ b/test/test_mount.rs
@@ -5,7 +5,7 @@
extern crate libc;
extern crate nix;
-extern crate tempdir;
+extern crate tempfile;
#[cfg(target_os = "linux")]
mod test_mount {
@@ -23,7 +23,7 @@ mod test_mount {
use nix::sys::stat::{self, Mode};
use nix::unistd::getuid;
- use tempdir::TempDir;
+ use tempfile;
static SCRIPT_CONTENTS: &'static [u8] = b"#!/bin/sh
exit 23";
@@ -32,8 +32,7 @@ exit 23";
const NONE: Option<&'static [u8]> = None;
pub fn test_mount_tmpfs_without_flags_allows_rwx() {
- let tempdir = TempDir::new("nix-test_mount")
- .unwrap_or_else(|e| panic!("tempdir failed: {}", e));
+ let tempdir = tempfile::tempdir().unwrap();
mount(NONE,
tempdir.path(),
@@ -89,8 +88,7 @@ exit 23";
}
pub fn test_mount_rdonly_disallows_write() {
- let tempdir = TempDir::new("nix-test_mount")
- .unwrap_or_else(|e| panic!("tempdir failed: {}", e));
+ let tempdir = tempfile::tempdir().unwrap();
mount(NONE,
tempdir.path(),
@@ -107,8 +105,7 @@ exit 23";
}
pub fn test_mount_noexec_disallows_exec() {
- let tempdir = TempDir::new("nix-test_mount")
- .unwrap_or_else(|e| panic!("tempdir failed: {}", e));
+ let tempdir = tempfile::tempdir().unwrap();
mount(NONE,
tempdir.path(),
@@ -146,13 +143,11 @@ exit 23";
}
pub fn test_mount_bind() {
- let tempdir = TempDir::new("nix-test_mount")
- .unwrap_or_else(|e| panic!("tempdir failed: {}", e));
+ let tempdir = tempfile::tempdir().unwrap();
let file_name = "test";
{
- let mount_point = TempDir::new("nix-test_mount")
- .unwrap_or_else(|e| panic!("tempdir failed: {}", e));
+ let mount_point = tempfile::tempdir().unwrap();
mount(Some(tempdir.path()),
mount_point.path(),
diff --git a/test/test_stat.rs b/test/test_stat.rs
index c042ce1..4135052 100644
--- a/test/test_stat.rs
+++ b/test/test_stat.rs
@@ -9,7 +9,7 @@ use nix::sys::stat::{self, fchmod, fchmodat, fstat, lstat, stat};
use nix::sys::stat::{FileStat, Mode, FchmodatFlags};
use nix::unistd::chdir;
use nix::Result;
-use tempdir::TempDir;
+use tempfile;
#[allow(unused_comparisons)]
// uid and gid are signed on Windows, but not on other platforms. This function
@@ -56,7 +56,7 @@ fn assert_lstat_results(stat_result: Result<FileStat>) {
#[test]
fn test_stat_and_fstat() {
- let tempdir = TempDir::new("nix-test_stat_and_fstat").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let filename = tempdir.path().join("foo.txt");
let file = File::create(&filename).unwrap();
@@ -69,7 +69,7 @@ fn test_stat_and_fstat() {
#[test]
fn test_fstatat() {
- let tempdir = TempDir::new("nix-test_fstatat").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let filename = tempdir.path().join("foo.txt");
File::create(&filename).unwrap();
let dirfd = fcntl::open(tempdir.path(),
@@ -84,7 +84,7 @@ fn test_fstatat() {
#[test]
fn test_stat_fstat_lstat() {
- let tempdir = TempDir::new("nix-test_stat_fstat_lstat").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let filename = tempdir.path().join("bar.txt");
let linkname = tempdir.path().join("barlink");
@@ -106,7 +106,7 @@ fn test_stat_fstat_lstat() {
#[test]
fn test_fchmod() {
- let tempdir = TempDir::new("nix-test_fchmod").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let filename = tempdir.path().join("foo.txt");
let file = File::create(&filename).unwrap();
@@ -128,7 +128,7 @@ fn test_fchmod() {
#[test]
fn test_fchmodat() {
- let tempdir = TempDir::new("nix-test_fchmodat").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let filename = "foo.txt";
let fullpath = tempdir.path().join(filename);
File::create(&fullpath).unwrap();
diff --git a/test/test_unistd.rs b/test/test_unistd.rs
index fe33b1d..d36a3d3 100644
--- a/test/test_unistd.rs
+++ b/test/test_unistd.rs
@@ -1,5 +1,3 @@
-extern crate tempdir;
-
use nix::fcntl::{fcntl, FcntlArg, FdFlag, OFlag};
use nix::unistd::*;
use nix::unistd::ForkResult::*;
@@ -11,8 +9,7 @@ use std::ffi::CString;
use std::fs::File;
use std::io::Write;
use std::os::unix::prelude::*;
-use tempfile::tempfile;
-use tempdir::TempDir;
+use tempfile::{self, tempfile};
use libc::{self, _exit, off_t};
#[test]
@@ -84,7 +81,7 @@ fn test_mkstemp_directory() {
#[test]
fn test_mkfifo() {
- let tempdir = TempDir::new("nix-test_mkfifo").unwrap();
+ let tempdir = tempfile::tempdir().unwrap();
let mkfifo_fifo = tempdir.path().join("mkfifo_fifo");
mkfifo(&mkfifo_fifo, Mode::S_IRUSR).unwrap();
@@ -286,7 +283,7 @@ fn test_fchdir() {
#[allow(unused_variables)]
let m = ::CWD_MTX.lock().expect("Mutex got poisoned by another test");
- let tmpdir = TempDir::new("test_fchdir").unwrap();
+ let tmpdir = tempfile::tempdir().unwrap();
let tmpdir_path = tmpdir.path().canonicalize().unwrap();
let tmpdir_fd = File::open(&tmpdir_path).unwrap().into_raw_fd();
@@ -302,7 +299,7 @@ fn test_getcwd() {
#[allow(unused_variables)]
let m = ::CWD_MTX.lock().expect("Mutex got poisoned by another test");
- let tmpdir = TempDir::new("test_getcwd").unwrap();
+ let tmpdir = tempfile::tempdir().unwrap();
let tmpdir_path = tmpdir.path().canonicalize().unwrap();
assert!(chdir(&tmpdir_path).is_ok());
assert_eq!(getcwd().unwrap(), tmpdir_path);
--
2.17.0
2.18.0

@ -1,66 +0,0 @@
From 340c5742ce33fe633e74d0273f341d1653ebeff4 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Mon, 8 Jan 2018 00:13:59 +0100
Subject: [PATCH] make statfs/statvfs to be available wherever they are
available
libc reads sys/statvfs.h on all OS except Windows which nix doesn't care
about.
Closes: https://github.com/nix-rust/nix/issues/831
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
(cherry picked from commit 08624d0a5c3649fea6463836690ae9b7f01093ac)
---
src/sys/mod.rs | 13 +------------
src/sys/statvfs.rs | 6 +++---
2 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/src/sys/mod.rs b/src/sys/mod.rs
index a94b8a0..395f04e 100644
--- a/src/sys/mod.rs
+++ b/src/sys/mod.rs
@@ -63,19 +63,8 @@ pub mod select;
pub mod quota;
-#[cfg(all(target_os = "linux",
- any(target_arch = "x86",
- target_arch = "x86_64",
- target_arch = "arm")),
- )]
+#[cfg(any(target_os = "android", target_os = "linux", target_os = "macos"))]
pub mod statfs;
-
-#[cfg(all(any(target_os = "linux",
- target_os = "macos"),
- any(target_arch = "x86",
- target_arch = "x86_64",
- target_arch = "arm")),
- )]
pub mod statvfs;
pub mod pthread;
diff --git a/src/sys/statvfs.rs b/src/sys/statvfs.rs
index fbd0570..c1c66de 100644
--- a/src/sys/statvfs.rs
+++ b/src/sys/statvfs.rs
@@ -32,13 +32,13 @@ libc_bitflags!(
#[cfg(any(target_os = "android", target_os = "linux"))]
ST_MANDLOCK;
/// Write on file/directory/symlink
- #[cfg(any(target_os = "android", target_os = "linux"))]
+ #[cfg(target_os = "linux")]
ST_WRITE;
/// Append-only file
- #[cfg(any(target_os = "android", target_os = "linux"))]
+ #[cfg(target_os = "linux")]
ST_APPEND;
/// Immutable file
- #[cfg(any(target_os = "android", target_os = "linux"))]
+ #[cfg(target_os = "linux")]
ST_IMMUTABLE;
/// Do not update access times on files
#[cfg(any(target_os = "android", target_os = "linux"))]
--
2.16.2

@ -1,14 +0,0 @@
--- nix-0.10.0/Cargo.toml 1970-01-01T01:00:00+01:00
+++ nix-0.10.0/Cargo.toml 2018-05-11T08:54:48.559521+02:00
@@ -57,10 +57,5 @@
[dev-dependencies.rand]
version = "0.4"
-[dev-dependencies.tempdir]
-version = "0.3"
-
[dev-dependencies.tempfile]
-version = "2"
-[target."cfg(target_os = \"dragonfly\")".build-dependencies.gcc]
-version = "0.3"
+version = "3"

@ -0,0 +1,16 @@
--- nix-0.11.0/Cargo.toml 1970-01-01T01:00:00+01:00
+++ nix-0.11.0/Cargo.toml 2018-07-17T09:47:44.316000+02:00
@@ -60,12 +60,5 @@
[dev-dependencies.rand]
version = "0.4"
-[dev-dependencies.tempdir]
-version = "0.3"
-
[dev-dependencies.tempfile]
-version = "2"
-[target."cfg(target_os = \"dragonfly\")".build-dependencies.cc]
-version = "1"
-[target."cfg(target_os = \"freebsd\")".dev-dependencies.sysctl]
-version = "0.1"
+version = "3"

@ -5,33 +5,31 @@
%global crate nix
Name: rust-%{crate}
Version: 0.10.0
Release: 5%{?dist}
Version: 0.11.0
Release: 1%{?dist}
Summary: Rust friendly bindings to *nix APIs
License: MIT
URL: https://crates.io/crates/nix
Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
# Initial patched metadata
# * No dragonfly
# * No dragonfly/freebsd
# * Bump tempfile to 3, https://github.com/nix-rust/nix/pull/900
Patch0: nix-0.10.0-fix-metadata.diff
# https://github.com/nix-rust/nix/commit/08624d0a5c3649fea6463836690ae9b7f01093ac
Patch1: 0001-make-statfs-statvfs-to-be-available-wherever-they-ar.patch
Patch0: nix-0.11.0-fix-metadata.diff
# Make it work with new tempdir
Patch2: 0001-deps-update-tempfile-to-3.patch
Patch0001: 0001-deps-update-tempfile-to-3.patch
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging
# [dependencies]
BuildRequires: (crate(bitflags) >= 1.0.0 with crate(bitflags) < 2.0.0)
BuildRequires: (crate(bytes) >= 0.4.5 with crate(bytes) < 0.5.0)
BuildRequires: (crate(cfg-if) >= 0.1.0 with crate(cfg-if) < 0.2.0)
BuildRequires: (crate(libc) >= 0.2.36 with crate(libc) < 0.3.0)
BuildRequires: (crate(libc) >= 0.2.42 with crate(libc) < 0.3.0)
BuildRequires: (crate(void) >= 1.0.2 with crate(void) < 2.0.0)
%if %{with check}
# [dev-dependencies]
BuildRequires: (crate(bytes) >= 0.4.8 with crate(bytes) < 0.5.0)
BuildRequires: (crate(lazy_static) >= 1.0.0 with crate(lazy_static) < 2.0.0)
BuildRequires: (crate(rand) >= 0.4.0 with crate(rand) < 0.5.0)
BuildRequires: (crate(tempfile) >= 3.0.0 with crate(tempfile) < 4.0.0)
@ -73,6 +71,9 @@ which use %{crate} from crates.io.
%exclude %{cargo_registry}/%{crate}-%{version}/{Cross.toml,RELEASE_PROCEDURE.md,bors.toml,ci}
%changelog
* Tue Jul 17 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.11.0-1
- Update to 0.11.0
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

@ -1 +1 @@
SHA512 (nix-0.10.0.crate) = 335bb939af0132511798e6c8cd259e82b6c5570a51b2dffab8c7c1c1ef13f473ead04bb5d99ad2aa383ea3529d6ec526a1c5dd0adf501d37406cbf3113b453df
SHA512 (nix-0.11.0.crate) = bb3ffc5ae6a8de37a96e9951e182c2916016678265a3c4efdee2ca4d26bc5f4192f4facabeac2978788143d2707094dc0517c13b08833cc1ddcdb6fc1125c874

Loading…
Cancel
Save