Re: pkg_add gives error and then installs

2007-03-04 Thread Marc Espie
On Sat, Mar 03, 2007 at 10:43:52PM -0500, Peter wrote:
 export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/
 for i in bash \
wget
 do
 pkg_add $i
 done

Don't do that. When you can, don't put pkg_add in a loop, but use
the whole list of packages you want to add in a single invocation.

pkg_add often needs to build a memory image of which packages it knows,
and how they relate to one another. Each time you start a new pkg_add,
you pay that cost. If you use one single invocation, things will go ways
faster.



Re: pkg_add gives error and then installs

2007-03-04 Thread Peter
Le Samedi 3 Mars 2007 23:31, Tobias Ulmer a icrit :
 On Sat, Mar 03, 2007 at 10:43:52PM -0500, Peter wrote:
  I am scripting (sh) some package installs on an updated (today)
  OpenBSD 4.0-STABLE system and I am getting errors even when the
  pkg_add command ultimately succeeds and installs the packages.
 
  The shell script in question and sample output:
 
  export
  PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/ for i
  in bash \
 wget
  do
  pkg_add $i
  done

 And the point is? you can just do a pkg_add bash wget

The point is that inside the loop I prompt the user whether to install
or not.  I also have a much longer list of packages that what I gave.

  Error from ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/:
  Unknwn command.
  wget-1.10.2p0 complete

 This is a warning from ftp.openbsd.org because it doesn't
 understand EPSV or something, just ignore it.

Thank you.

  BTW, I am also having trouble specifying a package whose name
  contains version numbers like:
 
  cvsup-16.1h-no_x11
 
  I would rather include this in my for loop as:
 
  cvsup-*-no_x11

[ snip ]

 pkg_add -i list of packages
 (interactive only)

 or grab $PKG_PATH/index.txt, grep whatever you need and feed it to
 pkg_add.

Thanks for these ideas.

PM



Re: pkg_add gives error and then installs

2007-03-04 Thread Peter
Le Dimanche 4 Mars 2007 04:50, Marc Espie a icrit :
 On Sat, Mar 03, 2007 at 10:43:52PM -0500, Peter wrote:
  export
  PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/ for i
  in bash \
 wget
  do
  pkg_add $i
  done

 Don't do that. When you can, don't put pkg_add in a loop, but use
 the whole list of packages you want to add in a single invocation.

 pkg_add often needs to build a memory image of which packages it
 knows, and how they relate to one another. Each time you start a new
 pkg_add, you pay that cost. If you use one single invocation, things
 will go ways faster.

Yes, I did notice it was slow.  Thanks for this information.

PM



Re: pkg_add gives error and then installs

2007-03-03 Thread Tobias Ulmer
On Sat, Mar 03, 2007 at 10:43:52PM -0500, Peter wrote:
 I am scripting (sh) some package installs on an updated (today) OpenBSD 
 4.0-STABLE system and I am getting errors even when the pkg_add command 
 ultimately succeeds and installs the packages.
 
 The shell script in question and sample output:
 
 export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/
 for i in bash \
wget
 do
 pkg_add $i
 done

And the point is? you can just do a pkg_add bash wget

 
 Error from ftp://ftp.openbsd.org/pub/OpenBSD/4.0/packages/i386/:
 Unknwn command.
 wget-1.10.2p0 complete

This is a warning from ftp.openbsd.org because it doesn't
understand EPSV or something, just ignore it.

 
 BTW, I am also having trouble specifying a package whose name contains 
 version numbers like:
 
 cvsup-16.1h-no_x11
 
 I would rather include this in my for loop as:
 
 cvsup-*-no_x11
 
 My attempts to escape the glob character have been futile (cannot 
 resolve):
 
 cvsup-\*-no_x11
 
 and putting the $i in double quotes doesn't help.
 
 Thanks for any pointers.
 
 PM
 
 

pkg_add -i list of packages
(interactive only)

or grab $PKG_PATH/index.txt, grep whatever you need and feed it to
pkg_add.

Tobiasu