diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py index 8e882b3..b2d82a2 100644 --- a/rust2rpm/__main__.py +++ b/rust2rpm/__main__.py @@ -212,12 +212,11 @@ def get_license_files(path): for root, dirs, files in os.walk(path, topdown=True): dirs[:] = [d for d in dirs if d not in exclude] license_files.extend([os.path.relpath(os.path.join(root, f), path) for f in files if LICENSES.match(f)]) + license_files.sort() return license_files def get_doc_files(path): doc_files = [] - include = {"doc", "docs", "example", "examples", "_example", "_examples"} - exclude = {"vendor", ".github", "tests", "test", ".circleci"} matcher = re.compile( r"(.*\.md|.*\.markdown|.*\.mdown|.*\.mkdn|.*\.rst|.*\.txt|AUTHORS|" r"AUTHORS[\.\-].*|CONTRIBUTORS|CONTRIBUTORS[\.\-].*|README|" @@ -225,9 +224,9 @@ def get_doc_files(path): re.IGNORECASE) matcherex = re.compile(r"CMakeLists\.txt") for root, dirs, files in os.walk(path, topdown=True): - doc_files = doc_files + [d for d in dirs if d in include] - dirs[:] = [d for d in dirs if d not in exclude] + dirs[:] = [] doc_files.extend([os.path.relpath(os.path.join(root, f), path) for f in files if matcher.match(f) and not LICENSES.match(f) and not matcherex.match(f)]) + doc_files.sort() return doc_files def make_diff_metadata(crate, version, patch=False, store=False):