Jean28518 / linux-assistant

A daily linux helper with powerful integrated search, routines checks and administrative tasks. The Project is built with flutter and python.
https://www.linux-assistant.org
GNU General Public License v3.0
87 stars 12 forks source link

Improve Arch Linux related code #223

Open nkxdev opened 2 months ago

nkxdev commented 2 months ago

The goal is to improve the current code related to Arch Linux and its derivatives. The code was tested on EndeavourOS.

Firstly, the PKGBUILD file is changed so it corresponds to the suggested layout described in the Arch Linux wiki. The layout and install process matches now the packaging guidelines (https://wiki.archlinux.org/title/PKGBUILD). The checksum parameter is now implemented in the PKGBUILD file. Please consider providing a real checksum for each release instead of skipping the checksum.

Furthermore, the pacman package handling code is now capable of not reinstalling packages if they are already installed. Pacman also removes unused dependencies when uninstalling a package. This cleans up unused packages.

The package install detection for pacman was also rewritten because the old implementation had limitations with different repositories. The old implementation only filters for specific repositories and excludes custom repos, while the new code respects them.

Moreover, the current check update implementation for the security check is not recommended by Arch Linux because partial upgrades are not supported on a rolling distro. It can brick the system (https://wiki.archlinux.org/title/System_maintenance#Avoid_certain_pacman_commands). Instead a save way of checking updates is added to the code base, which will not touch the pacman system databases.

nkxdev commented 4 weeks ago

Hello, I changed the arch_checkupdates.py file as you mentioned in your twitch coding live stream (2024-08-04). Unfortunately I missed it :cry:. The python script now uses your jessentials module to execute files and the bug with the try except block is also gone.

You also want to know why this special db path exist. The db path is required to not change the system database which should only be altered while upgrading the system (pacman -Syu). If pacman updates the system repository databases without a system upgrade, pacman executes an partial upgrade which could break your system (pacman -Sy). With the new db path, pacman updates the repository databases in the defined temp directory (db path) and can perform a save update check without touching the real databases. Here are some links which provide further information: https://wiki.archlinux.org/title/System_maintenance#Partial_upgrades_are_unsupported https://gitlab.archlinux.org/pacman/pacman-contrib/-/blob/master/src/checkupdates.sh.in?ref_type=heads

Furthermore, concerns about the checksums were raised, which are not skipped any more with the parameter "--skipchecksums". Instead the checksums are skipped with this one liner in PKGBUILD: sha256sums=('SKIP')

Jean28518 commented 1 week ago

That looks good, thanks! I will merge it at my next linux-assistant session