-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsort-blobs-list.py
More file actions
executable file
·45 lines (37 loc) · 1.13 KB
/
sort-blobs-list.py
File metadata and controls
executable file
·45 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python3
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
import os
import sys
import subprocess
from pathlib import Path
# List of files to sort
PROPRIETARY_FILES_TXT = [
"proprietary-files.txt",
"proprietary-files-phone.txt"
]
def main():
# Determine script directory
script_dir = Path(__file__).parent.absolute()
# Determine Android root directory
android_root = script_dir.parent.parent.parent
# Path to the helper script
helper = android_root / "tools" / "extract-utils" / "sort-blobs-list.py"
# Check if helper exists
if not helper.is_file():
print(f"Unable to find helper script at {helper}")
sys.exit(1)
# Call the helper to sort the list
# Add --dir-first to give priority to directories and subdirectories
try:
subprocess.run(
[str(helper), "--dir-first"] + PROPRIETARY_FILES_TXT,
check=True
)
except subprocess.CalledProcessError as e:
print(f"Error running sort-blobs-list.py: {e}")
sys.exit(1)
if __name__ == "__main__":
main()