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

Run paccache after updates on Arch Linux-based systems #778

Open
zombiepigdragon opened this issue Apr 23, 2024 · 0 comments
Open

Run paccache after updates on Arch Linux-based systems #778

zombiepigdragon opened this issue Apr 23, 2024 · 0 comments
Labels
C-feature request New feature request

Comments

@zombiepigdragon
Copy link

I want to suggest a new step

Which tool is this about? Where is its repository?

The Arch Linux pacman repo includes a script+service+timer for automatically cleaning the package cache by removing old copies of packages that are no longer installed and removing any packages of which there are more than three copies (Arch Wiki). I think that it makes sense for Topgrade to automatically run the tool after doing its normal upgrade routine in order to free up disk space without waiting for the weekly timer to trigger. I would suggest using the service because it's designed to run regularly and because I already configured the service with overrides to change the default number of packages kept though running it directly is also an entirely reasonable (and probably more expected) solution.

Which operating systems are supported by this tool?

Arch Linux and its derivatives (in general, pacman-based systems). I'm not sure if this includes devkitPro and other non-Arch pacman systems.

What should Topgrade do to figure out if the tool needs to be invoked?

Test for the existence of the service file (/usr/lib/systemd/system/paccache.service) or the program itself (command paccache or /usr/bin/paccache). Presumably if the user opts in to installing pacman-contrib they'll expect this to be run, like pacdiff from the same package.

Which exact commands should Topgrade run?

sudo systemctl start paccache.service or sudo /usr/bin/paccache -r (i.e. the default for the service, the arguments should .

More information

I started looking at implementing this myself, but I'm not completely sure about where to put it, so I decided to leave an issue rather than a probably-misplaced PR. I'll happily PR this myself after guidance on which implementation strategy (service VS invoking the command) is preferred (I suspect it's the command, but I can always dream of not copying my single line of config, can't I?) and which file/approximate line I should add this new step to (I'm guessing add a function to archlinux.rs and call it somewhere near line 231 of main.rs?)

@zombiepigdragon zombiepigdragon added the C-feature request New feature request label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature request New feature request
Projects
None yet
Development

No branches or pull requests

1 participant