Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Arch Linux related code #223

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nkxdev
Copy link

@nkxdev nkxdev commented Jul 7, 2024

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 added 4 commits June 26, 2024 20:27
Change the PKGBUILD file so it corresponse to the suggested build layout described in the Arch Linux wiki.
The skip checksum parameter for makepkg is moved into the PKGBUILD file.
Pacman now installs packages only if they are not already installed and does not perform a reinstall.
Pacman now removes unused dependencies while removing a package.
The package install detection was rewritten because the old implementation had limitations with repositories.
The old implementation with pacman -Sy is not recommended by Arch Linux (https://wiki.archlinux.org/title/System_maintenance#Avoid_certain_pacman_commands).
Instead the wiki recommend the usage of checkupdates (using python port to avoid dependency).
@nkxdev
Copy link
Author

nkxdev commented Aug 9, 2024

Hello, I changed the arch_checkupdates.py file as you mentioned in your twitch coding live stream (2024-08-04). Unfortunately I missed it 😢. 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
Copy link
Owner

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

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.

2 participants