Skip to content

Commit

Permalink
Escaping manifest path from glob evaluation during license search.
Browse files Browse the repository at this point in the history
  • Loading branch information
idavis committed Apr 2, 2022
1 parent 0121c15 commit 0c1a530
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,12 @@ impl Metadata21 {
// We're already emitting the License-Files metadata without issue.
// license-files.globs = ["LICEN[CS]E*", "COPYING*", "NOTICE*", "AUTHORS*"]
let license_include_targets = ["LICEN[CS]E*", "COPYING*", "NOTICE*", "AUTHORS*"];
let escaped_manifest_string = glob::Pattern::escape(manifest_path.to_str().unwrap());
let escaped_manifest_path = Path::new(&escaped_manifest_string);
for pattern in license_include_targets.iter() {
for license_path in glob::glob(&manifest_path.join(pattern).to_string_lossy())?
.filter_map(Result::ok)
for license_path in
glob::glob(&escaped_manifest_path.join(pattern).to_string_lossy())?
.filter_map(Result::ok)
{
// if the pyproject.toml specified the license file,
// then we won't list it as automatically included
Expand Down

0 comments on commit 0c1a530

Please sign in to comment.