Compare commits

1 Commits

Author SHA1 Message Date
6852a933da feat(dev-script): added appimage cleaner script
All checks were successful
Build Check - AppImage, Arch, Fedora / changes (pull_request) Successful in 29s
Code check / Check code (pull_request) Successful in 1m30s
Build Check - AppImage, Arch, Fedora / Build AppImage (pull_request) Successful in 3m15s
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 12:31:57 +05:00
4 changed files with 41 additions and 23 deletions

View File

@ -17,7 +17,7 @@ jobs:
- name: Install required dependencies - name: Install required dependencies
run: | run: |
sudo apt update sudo apt update
sudo apt install -y binutils coreutils desktop-file-utils gtk-update-icon-cache fakeroot fuse libgdk-pixbuf2.0-dev patchelf python3-pip python3-dev python3-setuptools squashfs-tools strace util-linux zsync git zstd sudo apt install -y binutils coreutils desktop-file-utils gtk-update-icon-cache fakeroot fuse libgdk-pixbuf2.0-dev patchelf python3-pip python3-dev python3-setuptools squashfs-tools strace util-linux zsync git
- name: Install tools - name: Install tools
run: | run: |

View File

@ -23,7 +23,7 @@ jobs:
- name: Install required dependencies - name: Install required dependencies
run: | run: |
sudo apt update sudo apt update
sudo apt install -y binutils coreutils desktop-file-utils gtk-update-icon-cache fakeroot fuse libgdk-pixbuf2.0-dev patchelf python3-pip python3-dev python3-setuptools squashfs-tools strace util-linux zsync git zstd sudo apt install -y binutils coreutils desktop-file-utils gtk-update-icon-cache fakeroot fuse libgdk-pixbuf2.0-dev patchelf python3-pip python3-dev python3-setuptools squashfs-tools strace util-linux zsync git
- name: Install tools - name: Install tools
run: | run: |
@ -159,7 +159,6 @@ jobs:
mkdir -p extracted mkdir -p extracted
find release/ -name '*.zip' -exec unzip -o {} -d extracted/ \; find release/ -name '*.zip' -exec unzip -o {} -d extracted/ \;
find extracted/ -type f -exec mv {} release/ \; find extracted/ -type f -exec mv {} release/ \;
find release/ -name '*.zip' -delete
rm -rf extracted/ rm -rf extracted/
- name: Extract changelog for version - name: Extract changelog for version

View File

@ -68,7 +68,7 @@ jobs:
- name: Install required dependencies - name: Install required dependencies
run: | run: |
sudo apt update sudo apt update
sudo apt install -y binutils coreutils desktop-file-utils gtk-update-icon-cache fakeroot fuse libgdk-pixbuf2.0-dev patchelf python3-pip python3-dev python3-setuptools squashfs-tools strace util-linux zsync zstd git sudo apt install -y binutils coreutils desktop-file-utils gtk-update-icon-cache fakeroot fuse libgdk-pixbuf2.0-dev patchelf python3-pip python3-dev python3-setuptools squashfs-tools strace util-linux zsync git
- name: Install tools - name: Install tools
run: | run: |

View File

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