Skip to content

Commit 0d1b28a

Browse files
committed
allow my fork
1 parent 81d50b6 commit 0d1b28a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/tools/tidy/src/extdeps.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ use std::fs;
44
use std::path::Path;
55

66
/// List of allowed sources for packages.
7-
const ALLOWED_SOURCES: &[&str] = &["\"registry+https://github.com/rust-lang/crates.io-index\""];
7+
const ALLOWED_SOURCES: &[&str] = &[
8+
"\"registry+https://github.com/rust-lang/crates.io-index\"",
9+
"\"git+https://github.com/lzutao/rust-libc",
10+
];
811

912
/// Checks for external package sources. `root` is the path to the directory that contains the
1013
/// workspace `Cargo.toml`.
@@ -26,7 +29,14 @@ pub fn check(root: &Path, bad: &mut bool) {
2629
let source = line.splitn(2, '=').nth(1).unwrap().trim();
2730

2831
// Ensure source is allowed.
29-
if !ALLOWED_SOURCES.contains(&&*source) {
32+
let mut matched = false;
33+
for allowed in ALLOWED_SOURCES {
34+
if source.starts_with(allowed) {
35+
matched = true;
36+
break;
37+
}
38+
}
39+
if !matched {
3040
println!("invalid source: {}", source);
3141
*bad = true;
3242
}

0 commit comments

Comments
 (0)