From 64ec20886b1cb81a9ec2f76307218e8059a3574a Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sat, 28 Jul 2018 21:19:34 -0500 Subject: [PATCH 1/4] uucore: Add globbing for Windows machines --- Cargo.toml | 1 + lib.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 3a5a09a..c4fda8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ failure_derive = { version = "0.1.1", optional = true } time = { version = "0.1.40", optional = true } data-encoding = { version = "^2.1", optional = true } libc = { version = "0.2.42", optional = true } +wild = "1.0.1" [target.'cfg(target_os = "redox")'.dependencies] termion = "1.5" diff --git a/lib.rs b/lib.rs index bfa1115..8cc7494 100644 --- a/lib.rs +++ b/lib.rs @@ -1,3 +1,13 @@ +extern crate wild; + +pub fn args() -> Box> { + Box::new( wild::args().map(|s| s.into_string().unwrap()) ) +} + +pub fn args_os() -> Box> { + Box::new( wild::args() ) +} + #[cfg(feature = "libc")] pub extern crate libc; #[cfg(feature = "winapi")] From f43441cca0b710c4a04d9f0537202ef7fe60a611 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 5 Aug 2018 21:54:59 -0500 Subject: [PATCH 2/4] uucore: fix: use forked 'wild' crate with case-sensitivity + API fixes --- Cargo.toml | 2 +- lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c4fda8c..0f49aa1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ failure_derive = { version = "0.1.1", optional = true } time = { version = "0.1.40", optional = true } data-encoding = { version = "^2.1", optional = true } libc = { version = "0.2.42", optional = true } -wild = "1.0.1" +wild = { git = "https://gitlab.com/rivy/wild.git" } [target.'cfg(target_os = "redox")'.dependencies] termion = "1.5" diff --git a/lib.rs b/lib.rs index 8cc7494..f3d24d6 100644 --- a/lib.rs +++ b/lib.rs @@ -1,11 +1,11 @@ extern crate wild; pub fn args() -> Box> { - Box::new( wild::args().map(|s| s.into_string().unwrap()) ) + wild::args() } pub fn args_os() -> Box> { - Box::new( wild::args() ) + wild::args_os() } #[cfg(feature = "libc")] From fcfe0722406b9f93784066435456e653cb21c159 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 3 Sep 2018 11:30:34 -0500 Subject: [PATCH 3/4] uucore: fix: use updated 'wild' crate for globbing --- Cargo.toml | 2 +- lib.rs | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0f49aa1..578c9eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ failure_derive = { version = "0.1.1", optional = true } time = { version = "0.1.40", optional = true } data-encoding = { version = "^2.1", optional = true } libc = { version = "0.2.42", optional = true } -wild = { git = "https://gitlab.com/rivy/wild.git" } +wild = "2.0.1" [target.'cfg(target_os = "redox")'.dependencies] termion = "1.5" diff --git a/lib.rs b/lib.rs index f3d24d6..cc77e9f 100644 --- a/lib.rs +++ b/lib.rs @@ -1,13 +1,9 @@ extern crate wild; -pub fn args() -> Box> { +pub fn args() -> impl Iterator { wild::args() } -pub fn args_os() -> Box> { - wild::args_os() -} - #[cfg(feature = "libc")] pub extern crate libc; #[cfg(feature = "winapi")] From 6c6ea2736873ae70a7a4cbaa69d8471f79207a69 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Mon, 3 Sep 2018 17:45:58 -0500 Subject: [PATCH 4/4] fix: gate unix-only macros (silences "unused" warnings) --- fs.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/fs.rs b/fs.rs index 78ccfbe..fdb82ab 100644 --- a/fs.rs +++ b/fs.rs @@ -25,6 +25,7 @@ use std::io::Result as IOResult; use std::path::{Component, Path, PathBuf}; use std::borrow::Cow; +#[cfg(unix)] macro_rules! has { ($mode:expr, $perm:expr) => ( $mode & ($perm as u32) != 0