Re: PKG_PATH pain

2007-03-07 Thread Nick !

On 3/7/07, Peter [EMAIL PROTECTED] wrote:

Hi everyone.

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.  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

The thing is that pkg_add wants to go directly to the internet site instead of
the local one:

Error from ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/:
Unknown command.
Ambiguous: postfix could be postfix-2.3.2 postfix-2.3.2-ldap
postfix-2.3.2-mysql postfix-2.3.2-sasl2 postfix-2.4.20060727
postfix-2.4.20060727-ldap postfix-2.4.20060727-mysql
postfix-2.4.20060727-sasl2



Hmm, odd. Try making it just
PKG_PATH=ftp://$LAN_FTP/OpenBSD/$OS_V0/packages/ and report what
happens.


But my server contains postfix-2.3.2.tgz:

$ lftp 192.168.3.11


Don't test with lftp, test with the built in ftp that pkg_add is using.


Thanks for any pointers.

PM


-Nick



Re: PKG_PATH pain

2007-03-07 Thread Peter
Le Mercredi 7 Mars 2007 09:39, Nick ! a icrit :
 On 3/7/07, Peter [EMAIL PROTECTED] wrote:
  Hi everyone.
 
  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.  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/pu
 b/OpenBSD/$OS_V0/packages/i386/
 
  export PKG_PATH
  pkg_add -v postfix
 
  The thing is that pkg_add wants to go directly to the internet site
  instead of the local one:
 
  Error from ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/:
  Unknown command.
  Ambiguous: postfix could be postfix-2.3.2 postfix-2.3.2-ldap
  postfix-2.3.2-mysql postfix-2.3.2-sasl2 postfix-2.4.20060727
  postfix-2.4.20060727-ldap postfix-2.4.20060727-mysql
  postfix-2.4.20060727-sasl2

 Hmm, odd. Try making it just
 PKG_PATH=ftp://$LAN_FTP/OpenBSD/$OS_V0/packages/ and report what
 happens.

Yes, that works.  Except that I get the situation that I want to avoid:
missing dependencies.  That's why I want that 2nd FTP site in my PKG_PATH:

parsing postfix-2.3.2
Dependencies for postfix-2.3.2 resolve to: pcre-6.4p1 (todo: pcre-6.4p1)
Error from ftp://192.168.3.11/OpenBSD/4.0/packages/:
550 Failed to open file.
postfix-2.3.2:Can't find pcre-6.4p1
/usr/sbin/pkg_add: pcre-6.4p1:Fatal error

Thanks for any help.

PM



Re: PKG_PATH pain

2007-03-07 Thread Nick !

On 3/7/07, Peter [EMAIL PROTECTED] wrote:


Yes, that works.  Except that I get the situation that I want to avoid:
missing dependencies.  That's why I want that 2nd FTP site in my PKG_PATH:

parsing postfix-2.3.2
Dependencies for postfix-2.3.2 resolve to: pcre-6.4p1 (todo: pcre-6.4p1)
Error from ftp://192.168.3.11/OpenBSD/4.0/packages/:
550 Failed to open file.
postfix-2.3.2:Can't find pcre-6.4p1
/usr/sbin/pkg_add: pcre-6.4p1:Fatal error

Thanks for any help.


Yeah... I think I tried to do something like this too (not with a
local mirror, but with multiple mirrors) and it never worked.

Wait, I'm silly, I know what's wrong. You're misreading the error
messages (pkg_add doesn't make errors too readable). The error from
is being given by ftp(1), but it's ignorable. The next error is from
pkg_add and it's saying that you haven't been specific enough: there's
more than one possible package.

Use the -i flag (I always run `pkg_add -iv ...`) to make it prompt you
for which.

-Nick



Re: PKG_PATH pain

2007-03-07 Thread Ingo Schwarze
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



Re: PKG_PATH pain

2007-03-07 Thread Peter
Le Mercredi 7 Mars 2007 16:34, Ingo Schwarze a icrit :
 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.

That's a very nice setup.  I think I will try it.  Thank you.

PM