Compare commits

..

1 Commits

Author SHA1 Message Date
cc6f527371 feat(dev-script): added appimage cleaner script
All checks were successful
Build Check - AppImage, Arch, Fedora / changes (pull_request) Successful in 32s
Code check / Check code (pull_request) Successful in 1m30s
Build Check - AppImage, Arch, Fedora / Build AppImage (pull_request) Successful in 2m33s
Build Check - AppImage, Arch, Fedora / Build Fedora RPM (41) (pull_request) Has been skipped
Build Check - AppImage, Arch, Fedora / Build Fedora RPM (42) (pull_request) Has been skipped
Build Check - AppImage, Arch, Fedora / Build Fedora RPM (rawhide) (pull_request) Has been skipped
Build Check - AppImage, Arch, Fedora / Build Arch Package (pull_request) Has been skipped
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
2025-07-22 13:52:41 +05:00

View File

@ -33,7 +33,7 @@ class PySide6DependencyAnalyzer:
"""Находит все Python файлы в директории"""
python_files = []
for root, dirs, files in os.walk(directory):
dirs[:] = [d for d in dirs if d not in {'.venv', '__pycache__', '.git'}]
dirs[:] = [d for d in dirs if d not in {'.venv', '__pycache__', '.git', 'node_modules'}]
for file in files:
if file.endswith('.py'):
@ -44,11 +44,27 @@ class PySide6DependencyAnalyzer:
"""Находит все PySide6 библиотеки (.so файлы)"""
libs = {}
# Поиск в единственной локации
search_path = Path("../.venv/lib/python3.10/site-packages/PySide6")
# Поиск в разных возможных локациях
search_paths = [
base_path / "usr/local/lib/python3.10/dist-packages/PySide6",
base_path / "usr/local/lib/python3.11/dist-packages/PySide6",
base_path / "usr/lib/python3/dist-packages/PySide6",
base_path / ".venv/lib/python3.10/site-packages/PySide6",
base_path / ".venv/lib/python3.11/site-packages/PySide6",
]
# Также добавляем путь, если PySide6 установлен системно
try:
import PySide6
system_path = Path(PySide6.__file__).parent
search_paths.append(system_path)
except ImportError:
pass
for search_path in search_paths:
if search_path.exists():
print(f"Поиск PySide6 библиотек в: {search_path}")
if search_path.exists():
# Ищем .so файлы модулей
for so_file in search_path.glob("Qt*.*.so"):
module_name = so_file.stem.split('.')[0] # QtCore.abi3.so -> QtCore
@ -63,6 +79,9 @@ class PySide6DependencyAnalyzer:
libs[subdir.name] = so_file
break
if libs:
break
return libs
def analyze_ldd_dependencies(self, lib_path: Path) -> Set[str]:
@ -347,13 +366,13 @@ def main():
print(f"\nПотенциальная экономия места: {results['analysis_summary']['space_saving_potential']}")
if args.verbose and results['real_dependencies']:
Devlin(f"\nРеальные зависимости (ldd):")
print(f"\nРеальные зависимости (ldd):")
for module, deps in results['real_dependencies'].items():
if deps:
print(f" {module}{', '.join(deps)}")
# Обновляем AppImage рецепт
recipe_path = Path("../build-aux/AppImageBuilder.yml")
recipe_path = project_path / "../build-aux/AppImageBuilder.yml"
if recipe_path.exists():
updated_recipe = analyzer.generate_appimage_recipe(results['removable'], recipe_path)
if updated_recipe: