You are not logged in.

#1 2015-03-03 16:01:26

gilmoreja
Member
From: Florida
Registered: 2012-05-28
Posts: 74

Getting pacman to cache local packages (from AUR)

I want pacman to cache the packages that I build from the AUR. I know that you can trick pacman into doing this by using file://path/to/pkg.

What I want to know is how to make this behavior default for makepkg when it installs built packages using the -i switch. Is that possible?


Time you enjoy wasting isn't wasted time.

Offline

#2 2015-03-03 16:09:15

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,399
Website

Re: Getting pacman to cache local packages (from AUR)

Set PKGDEST in makepkg.conf to the pacman cache dir.

Offline

#3 2015-03-03 21:22:31

gilmoreja
Member
From: Florida
Registered: 2012-05-28
Posts: 74

Re: Getting pacman to cache local packages (from AUR)

I tried it, and it seemed like it would do what I want. However, that just causes package building to fail right out of the gate with an error stating:

==> ERROR: You do not have write permission to store packages in /var/cache/pacman/pkg.
    Aborting...

I don't want to change the permissions on pacman's cache directory; I think those permissions would get reset by the system anyway, right?


Time you enjoy wasting isn't wasted time.

Offline

#4 2015-03-03 21:44:25

progandy
Member
Registered: 2012-05-17
Posts: 5,201

Re: Getting pacman to cache local packages (from AUR)

Why do the packages need to be in the pacman cache? Just create a second cache for your AUR packages, e.g. ~/.aurcache and use that as PKGDEST.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2015-03-03 21:53:01

gilmoreja
Member
From: Florida
Registered: 2012-05-28
Posts: 74

Re: Getting pacman to cache local packages (from AUR)

The idea was so that I could easily use downgrade if it was necessary. It would also allow old versions of those packages to be pruned at the same time when old packages are pruned from the rest of pacman's cache.

In short, it would save me a little hassle and a little time.

Last edited by gilmoreja (2015-03-03 21:56:29)


Time you enjoy wasting isn't wasted time.

Offline

#6 2015-03-03 21:55:53

progandy
Member
Registered: 2012-05-17
Posts: 5,201

Re: Getting pacman to cache local packages (from AUR)

gilmoreja wrote:

The idea was so that I could easily use downgrade if it was necessary.

Do you mean the script from AUR? Maybe there should be an option to add user defined directories.

It would also allow old versions of those packages to be pruned at the same time when old packages are pruned from the rest of pacman's cache.

You can specify the path to prune, e.g. paccache -c ~/.aurcache. If you are concerned with efficiency, then add a shell function like pacprune that does everything you want for both caches. Then you don't have to use commandline switches.

Last edited by progandy (2015-03-03 21:59:46)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2015-03-03 22:00:03

gilmoreja
Member
From: Florida
Registered: 2012-05-28
Posts: 74

Re: Getting pacman to cache local packages (from AUR)

Yeah, the AUR script.

Thanks.. I missed paccache's ability to look in custom directories.

For now it looks like the best option is what you suggested, then.. To have makepkg put packages into an ~/aurcache of sorts.

progandy wrote:

Maybe there should be an option to add user defined directories.

Either that, or an option for makepkg to append file:// when installing built packages.

In the end, though, I'd really prefer to have the packages end up in the actual pacman cache because my root and home partitions are set up with the consideration that the root partition will get full of stuff like cached packages, and not my home partition.

Last edited by gilmoreja (2015-03-03 22:12:51)


Time you enjoy wasting isn't wasted time.

Offline

#8 2015-03-03 22:24:06

progandy
Member
Registered: 2012-05-17
Posts: 5,201

Re: Getting pacman to cache local packages (from AUR)

You can specify the CacheDir multiple times in pacman.conf. This way you can have a user writable cache that downgrade should be able to use, too. You can put that cache on the root partition instead of the data partition, maybe even use a special makepkg user and prevent write access for everyone else.

If you really want to have makepkg install files with the file:// protocol, then maybe you can add a feature request in the tracker. Even if you don't want to do that or it gets rejected, makepkg is a bash script, so you can easily copy it and try to make the modifications for yourself.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#9 2015-03-04 16:40:15

gilmoreja
Member
From: Florida
Registered: 2012-05-28
Posts: 74

Re: Getting pacman to cache local packages (from AUR)

I created a feature request for this in the bug tracker (here). For now I'll do what you suggested and copy/edit the makepkg script myself.


Time you enjoy wasting isn't wasted time.

Offline

#10 2015-03-05 01:18:30

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,399
Website

Re: Getting pacman to cache local packages (from AUR)

progandy wrote:

You can specify the CacheDir multiple times in pacman.conf. This way you can have a user writable cache that downgrade should be able to use, too. You can put that cache on the root partition instead of the data partition, maybe even use a special makepkg user and prevent write access for everyone else.

This is the solution...

Offline

Board footer

Powered by FluxBB