You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cfbs/analyze.py
+52-2Lines changed: 52 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@
10
10
fromcfbs.utilsimport (
11
11
FetchError,
12
12
cfbs_dir,
13
+
deduplicate_list,
13
14
fetch_url,
14
15
file_sha256,
15
16
get_json,
@@ -25,14 +26,20 @@ def path_components(path):
25
26
26
27
The first component is `""` for a path starting with a separator. On Windows, if `path` begins with n backslashes, the first n components will be `""`.
27
28
28
-
The last component is the filename, trailing separators do not affect the result."""
29
+
The last component is the name of the file or directory, trailing separators do not affect the result.
30
+
"""
29
31
norm_path=os.path.normpath(path)
30
32
31
33
dir_components=norm_path.split(os.sep)
32
34
33
35
returndir_components
34
36
35
37
38
+
defname(path):
39
+
"""Returns the name of the path to file or directory."""
40
+
returnpath_components(path)[-1]
41
+
42
+
36
43
defis_path_component(path, component):
37
44
"""Returns whether `component` is a path component of `path`."""
# if not a single file in the analyzed policyset has an MPF-known checksum, and a specific `reference_version` was not given, `reference_version` will still be `None`
561
+
# if not a single file in the analyzed policyset has an MPF-known (checksum, filepath), and a specific `reference_version` was not given, `reference_version` will still be `None`
555
562
ifreference_versionisNone:
563
+
# try to detect whether the user provided a wrong policy set path
564
+
# gather all possible policy set paths, by detecting promises.cf or update.cf
0 commit comments