On 06/03/2011 08:27, [email protected] wrote: > Last time I tried it, pkg_add -r -K did indeed save local copies of > the packages fetched from the remote repository, but a problem arose > when one later wanted to _use_ that local stash while falling back to > -r behavior for anything not found locally. Last I knew there was no > easy way to tell pkg_add to do that.
Interestingly, portmaster(8) is good for doing that. These two lines in
portmasterrc (or the equivalent command line options: --packages,
--local-packagedir) make portmaster try to install a package from a
local package repository first, then fall back to fetching packages from
the net, and only then try building the port:
PM_PACKAGES=first
LOCAL_PACKAGEDIR=/usr/ports/packages
Which is what you want. Or perhaps 'PM_PACKAGES=only' which only uses
pkgs and doesn't build any ports.
Personally I find these most useful combined with a third option:
PM_PACKAGES_LOCAL=pmp_local
(Cmd line: --packages-local) which makes portmaster try to install pkgs
from a local repository first, and failing that, build the port.
Oh, and to save anyone needlessly re-downloading packages: if you've got
the port / package already installed, then you can recreate the pkg
tarball easily by:
# pkg_create -b pkg-name
Add a '-R' to that to create pkg tarballs for everything pkg-name
depends on too. pkg-name will include the version number as shown in
eg. 'pkg_info -Ia' output.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: [email protected] Kent, CT11 9PW
signature.asc
Description: OpenPGP digital signature
