Skip to content

Refactoring and introducing tool manager for linux#588

Open
Eashan-H wants to merge 8 commits into
FOSSEE:feature/tool-manager-integrationfrom
Eashan-H:tool_manager_linux
Open

Refactoring and introducing tool manager for linux#588
Eashan-H wants to merge 8 commits into
FOSSEE:feature/tool-manager-integrationfrom
Eashan-H:tool_manager_linux

Conversation

@Eashan-H

@Eashan-H Eashan-H commented Jul 5, 2026

Copy link
Copy Markdown

Summary

This PR refactors the Tool Manager to use a platform-specific backend architecture and introduces a dedicated Linux backend for native tool management. Platform-dependent logic has been separated into backend modules, making the codebase cleaner, easier to maintain, and easier to extend to additional operating systems.

The Linux backend supports native tool check, install, update, and uninstall operations on Debian/Ubuntu (APT), Fedora/RHEL (DNF), openSUSE (Zypper), and Arch Linux (Pacman). The Tool Manager now delegates platform-specific operations to the appropriate backend while preserving the existing GUI workflow.

Changes

Refactoring

Platform-specific Tool Manager logic has been moved into dedicated backend modules.

A common abstraction layer now allows the GUI to interact with the appropriate backend regardless of the host operating system.

main.py has been simplified by delegating platform-specific operations to backend implementations, providing a scalable foundation for future Windows and macOS support.

New File: src/toolManager/tool_manager_linux.py

A self-contained CLI backend responsible for Linux package management.

Supports automatic detection of APT, DNF, Zypper, and Pacman.

Uses a PACKAGE_MAP dictionary to translate logical tool names such as ngspice, kicad, and verilator into the correct distribution-specific package names.

Detects WSL environments and adapts privilege escalation accordingly.

Uses pkexec when available in graphical environments and falls back to sudo -S for WSL and headless systems.

Avoids using pkexec when no D-Bus or PolicyKit agent is available.

Resolves binaries safely under WSL by ignoring Windows executables mounted under /mnt.

Serializes APT operations using fcntl.flock to prevent concurrent package manager conflicts.

Streams package manager output in real time so installation progress is visible in the GUI.

Implements check, install, update, and uninstall operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant