Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7163782
D5011.id17895.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D5011.id17895.diff
View Options
diff --git a/benchmark.py b/benchmark.py
--- a/benchmark.py
+++ b/benchmark.py
@@ -15,7 +15,7 @@
import click
-SEED_OPTIONS = ["-s 10", "-s 20", "-s 30"]
+SEED_OPTIONS = ["-s 10"]
def get_scenario_cmd(algo, kb_url, kb_label, origin_info, extracted_repo_path):
diff --git a/swh/scanner/benchmark_algos.py b/swh/scanner/benchmark_algos.py
--- a/swh/scanner/benchmark_algos.py
+++ b/swh/scanner/benchmark_algos.py
@@ -299,18 +299,23 @@
"""
def _scan(root_path, source_tree, sre_patterns):
- dirpath, dnames, fnames = next(os.walk(root_path, followlinks=False))
- dirpath = Path(dirpath)
-
- if fnames:
- files = [dirpath.joinpath(fname) for fname in fnames]
+ files = []
+ dirs = []
+ for elem in os.listdir(root_path):
+ cnt = Path(root_path).joinpath(elem)
+ if not os.path.islink(cnt):
+ if os.path.isfile(cnt):
+ files.append(cnt)
+ elif os.path.isdir(cnt):
+ dirs.append(cnt)
+
+ if files:
parsed_file_swhids = dict(get_swhids(files, sre_patterns))
for path, swhid_ in parsed_file_swhids.items():
source_tree.add_node(Path(path), swhid_)
- if dnames:
- dirs = [dirpath.joinpath(dname) for dname in dnames]
+ if dirs:
parsed_dirs_swhids = dict(get_swhids(dirs, sre_patterns))
for path, swhid_ in parsed_dirs_swhids.items():
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 30, 3:32 PM (1 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3224523
Attached To
D5011: scanner-benchmark: use os.listdir() instead of os.walk() to avoid symlinks
Event Timeline
Log In to Comment