From 8506b843c59b549bbe674a64a85b5e072a6b2274 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Tue, 10 Oct 2023 00:47:58 +0200 Subject: [PATCH] crate: exclude "target/" directory from %doc file search --- rust2rpm/crate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust2rpm/crate.py b/rust2rpm/crate.py index dbc15f7..6ad6947 100644 --- a/rust2rpm/crate.py +++ b/rust2rpm/crate.py @@ -137,7 +137,9 @@ def get_doc_files(path: str) -> list[str]: and not LICENSE_FILE_PATTERN.fullmatch(f) and not DOC_FILE_EXCLUDES.fullmatch(f) ): - results.append(os.path.relpath(os.path.join(root, f), path)) + relpath = os.path.relpath(os.path.join(root, f), path) + if not relpath.startswith("target/"): + results.append(relpath) results.sort() return results