Skip to content

Commit 95d9ce5

Browse files
phsautermicprog
authored andcommitted
vendor: fix warning ** not found
1 parent adda431 commit 95d9ce5

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/cmd/vendor.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ pub fn init(
323323

324324
// Check if includes exist
325325
for path in vendor_package.include_from_upstream.clone() {
326-
if !PathBuf::from(extend_paths(&[path.clone()], dep_path)?[0].clone()).exists() {
326+
if !PathBuf::from(extend_paths(&[path.clone()], dep_path, true)?[0].clone()).exists() {
327327
warnln!("{} not found in upstream, continuing.", path);
328328
}
329329
}
@@ -333,7 +333,7 @@ pub fn init(
333333
true => copy_recursively(
334334
&link_from,
335335
&link_to,
336-
&extend_paths(&vendor_package.include_from_upstream, dep_path)?,
336+
&extend_paths(&vendor_package.include_from_upstream, dep_path, false)?,
337337
&vendor_package
338338
.exclude_from_upstream
339339
.clone()
@@ -474,6 +474,7 @@ pub fn diff(
474474
&extend_paths(
475475
&vendor_package.include_from_upstream,
476476
&vendor_package.target_dir,
477+
false,
477478
)?,
478479
&vendor_package
479480
.exclude_from_upstream
@@ -792,12 +793,13 @@ pub fn copy_recursively(
792793
pub fn extend_paths(
793794
include_from_upstream: &[String],
794795
prefix: impl AsRef<Path>,
796+
dir_only: bool,
795797
) -> Result<Vec<String>> {
796798
include_from_upstream
797799
.iter()
798800
.map(|pattern| {
799801
let pattern_long = PathBuf::from(pattern).prefix_paths(prefix.as_ref())?;
800-
if pattern_long.is_dir() {
802+
if pattern_long.is_dir() && !dir_only {
801803
Ok(String::from(pattern_long.join("**").to_str().unwrap()))
802804
} else {
803805
Ok(String::from(pattern_long.to_str().unwrap()))

src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ impl Validate for PartialVendorPackage {
892892
},
893893
include_from_upstream: match self.include_from_upstream {
894894
Some(include_from_upstream) => include_from_upstream,
895-
None => vec![String::from("**")],
895+
None => vec![String::from("")],
896896
},
897897
exclude_from_upstream: {
898898
let mut excl = match self.exclude_from_upstream {

0 commit comments

Comments
 (0)