paru icon indicating copy to clipboard operation
paru copied to clipboard

paru -Sc always cleans devel packages

Open conlogic opened this issue 4 years ago • 8 comments

Affected Version

paru -V: paru v1.5.0.r4.g9d9cdb1 - libalpm v12.0.2

Description

When I issue an paru -Sc and answer Y to

Clone Directory: /var/cache/paru/build
:: Do you want to remove all other AUR packages from cache? [Y/n]:

all built *-git packages are deleted from paru's cache - even all installed ones. By the way, this is not affected by the value of CleanMethod in the used pacman.conf file.

conlogic avatar Apr 07 '21 04:04 conlogic

That's what -Sc. What do you expect it to do?

Morganamilo avatar Apr 07 '21 22:04 Morganamilo

I expect for devel packages a similar behavior like for stable packages - both for repository and AUR packages: that the last version of the package is kept in paru's cache. To be a bit more specific: At least if in the used pacman.conf is set as:

CleanMethod = KeepInstalled

the installed version of a *-git package is kept in paru's cache.

conlogic avatar Apr 07 '21 22:04 conlogic

Right, you didn't mention the clean method in the original issue. There's not code to treat devel packages differently. Are you sure the issue is devel packages always get cleaned and not some other factor?

Morganamilo avatar Apr 08 '21 18:04 Morganamilo

Are you sure the issue is devel packages always get cleaned and not some other factor?

Of course I am not sure, but when using the scenario described above in the original issue, i.e.:

  • Calling paru -Sc;
  • Answering Y to the third question mentioned above, I always get the built packages for -git packages cleaned but all stable packages - even from AUR - handled according to the CleanMethod value in the used pacman.conf.

Do you get different results for -git packages in this scenario?

For comparison, here are the relevant content of my used configuration files:

/etc/paru.conf:

[options]
PgpFetch
Devel
Provides
DevelSuffixes = -git -cvs -svn -darcs -always
RemoveMake = ask
SudoLoop

CloneDir = /var/cache/paru/build
PacmanConf = /etc/pacman.conf

/etc/pacman.conf:

[options]
HoldPkg     = pacman glibc
Architecture = auto
Color
CheckSpace
VerbosePkgLists
SigLevel    = Required DatabaseOptional
LocalFileSigLevel = Optional

[custom]
SigLevel = Optional TrustAll
Server = file:///var/cache/artix-custom/pkg

[paru]
SigLevel = PackageOptional DatabaseOptional
Server = file:///var/cache/paru/pkg

# Standard Artix / Arch Linux repositories...

By the way, the described handling of -git packages in paru's cache remains the same if I do not use a local repository for paru. This behavior seems also not to be affected by the value of CleanMethod in pacman.conf: if this parameter either remains unset or is set to KeepInstalled or to KeepCurrent I always get the same clean behavior for -git packages in paru's cache.

conlogic avatar Apr 08 '21 20:04 conlogic

I've just done exactly this and it has deleted the sudo package (and only sudo seemingly for some reason). Now without sudo and without knowing my root password, I am locked out of root privileges.

Currently trying to solve this without reinstalling Arch, but I'm not sure if it's possible. Quite a headache.

I do hope accidentally deleting base-devel packages would be made harder to prevent others from facing a similar fate. 1+ for this issue.

M1T0zd avatar Nov 13 '22 15:11 M1T0zd

Not sure what you're on about as this issue is about clearing the paru cache.

Morganamilo avatar Nov 13 '22 16:11 Morganamilo

Honestly, I'm not knowledgeable enough to tell you exactly why or what. But I'm quite sure this happened after doing paru -Sc.

I just saw this line in the installation section of the readme however: sudo pacman -S --needed base-devel I think that would have prevented this problem? But since I installed paru via yay, I haven't run this command.

But anyways. If there is something I can do to make it more clear to you, let me know.

M1T0zd avatar Nov 13 '22 16:11 M1T0zd