Closed refaelsh closed 2 years ago
@refaelsh hey! In the particular situation that you describe, duplication wouldn't (shouldn't) happen, because only the last build can ever leave garbage.
On the other hand, I imagine it could be nice to have the garbage cleared even for 1 build. I'd imagine two things could help:
rua clean
(or rua clean-cache
) to clean the build cacheWhat do you think?
Sounds great!
I've added the tags to invite collaboration. (Personally busy with another task ATM, building the seccomp rules on non-x86_64 architectures.)
Theoretically, if somebody would open a PR on this, what the command should do? Delete something, right? But what? This folder maybe: ~/.cache/rua/build/foo-bar-package/
or maybe ~/.cache/rua/build/
?
To give an intermediate update, I'm super-busy with work ATM, but I'll really try to get back to it soon!
Hey, sorry, that was a very slow "soon". I made it within 1 month though! :sweat_smile: (was really busy with personal things and work)
I think ~/.cache/rua/build/foo-bar-package/
can be deleted at the end of a successful build and ~/.cache/rua/build/
can be deleted by rua clean-cache
That should be really straightforward, and an improvement upon the current situation. I think it's a really good thing to do
Thank you for the reply. I will try and see wether my Rust skill are not rusted. If they are not, I will open a PR.
One more question please. If ~/.cache/rua/build/
gets deleted, would it not break rua upgrade
?
@refaelsh shouldn't, build
is only used during build, but not after. Git history of AUR itself is kept in ~/.config/rua/pkg/
, then copied inside ~/.cache/rua
and built, and the built artifacts are then copied to ~/.local/share/rua
. This was done intentionally so that a user can delete the XDG cache and not lose anything important.
See the directories section: https://github.com/vn971/rua#how-it-works--directories
As for figuring out what package needs upgrading, rua
solely uses AUR and the local pacman state. E.g. it gets all current local packages, excludes the ones available in pacman itself, and queries AUR for the rest.
I will be submitting a PR for this shortly.
Here is a scenario that happened to me. I was doing a
rua install foo-bar-package
(1 GB download) and the WiFi got disconnected in the middle of the download. This happened several times. I now have multiple fragments downloaded that are eating disk space. I suggest arua clean cache
command to get rid of them.Thanks.