From b8c292f0aaa55fe4e91a1b673ec2b24f75c6e055 Mon Sep 17 00:00:00 2001 From: Alberto Planas Date: Mon, 22 Mar 2021 19:09:54 +0100 Subject: [PATCH] Drop _go_to_top_cargo_toml --- rust2rpm/inspector.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/rust2rpm/inspector.py b/rust2rpm/inspector.py index c357153..c5142fb 100644 --- a/rust2rpm/inspector.py +++ b/rust2rpm/inspector.py @@ -32,15 +32,6 @@ def _cargo_toml(source_path, path, exclude_vendor=True): raise Exception(f'Cargo.toml not found for binary {binary}') -def _go_to_top_cargo_toml(source_path, path): - """Find the top Cargo.toml and change directory.""" - path = os.path.dirname(path) - while path != source_path: - if os.path.exists(os.path.join(path, 'Cargo.toml')): - os.chdir(path) - path = os.path.dirname(path) - - def main(): parser = argparse.ArgumentParser() group = parser.add_mutually_exclusive_group(required=True) @@ -110,10 +101,6 @@ def main(): return data for f in files: - # We need to change directory, so cargo can find any local - # configuration file - _go_to_top_cargo_toml(args.path, f) - data = set() mds = Metadata.from_file(f) for md in mds: