Hi Peter,

> I have a local FTP server that contains many packages.
> When doing an install I want my pc to first check this server
> before going onto the net.

Why would you want to do that?
This might be a bad idea in the first place.

Suppose you got some package from a public mirror, and after that,
a security hole was found in the package, so it was updated on the
mirror.  In that case, you might end up installing the vulnerable
local copy, not even noticing there's an update.

> I have set up the following in a shell script on the pc being installed:
> 
> LAN_FTP=192.168.3.11
> OS_V0=$(uname -r)
> PKG_PATH=ftp://$LAN_FTP/OpenBSD/$OS_V0/packages/:
>          ftp://ftp.openbsd.org/pub/OpenBSD/$OS_V0/packages/i386/
> export PKG_PATH
> pkg_add -v postfix

According to my understanding, pkg_add will always check all paths
given in PKG_PATH.  In order to choose the right package, it will
inspect the package itself, not its position in PKG_PATH.

What i'm currently doing is the following:
On my reference machine, i use the settings
  PKG_PATH=ftp://openbsd.ftp.fu-berlin.de/snapshots/packages/i386/:
            /srv/ftp/OpenBSD/current/packages/i386/all/
  PKG_CACHE=/srv/ftp/OpenBSD/current/packages/i386/all/
On that machine, i do
  pkg_add -ui
whenever some update is required.  Whenever i need to use some
new software, i first install and test it on that machine.
Thus, i always have up-to-date versions of all locally required
packages on that box.

In case i need to compile a package from ports or from ports/mystuff,
i put the home-made package there, too.  Should an official package
be released later, i will very probably notice at once.

On all other machines, i point PKG_PATH to the (local) ftp server
on that reference machine *only*, thus neither creating external
network load nor retrieving untested packages when installing or
updating production servers.

Yours,
  Ingo

Reply via email to