Questions about packages and ports

Wayne Sierke ws at au.dyndns.ws
Tue Jul 5 05:52:29 GMT 2005


On Mon, 2005-06-27 at 13:25 -0500, Nikolas Britton wrote:
> On a similar note can someone remind me how to set the remote package
> site for pkg_add and portupgrade -P? I remember it had something to do
> with setenv but don't remember the variable it uses and I've never
> used the portupgrade -P option before.

It requires a bit of rtfm it seems...

$ man -P /bin/cat pkg_add | grep --context=2 -- "-r"
             what you are doing!

     -r      Use the remote fetching feature.  This will determine the appro-
             priate objformat and release and then fetch and install the pack-
             age.
--
     The environment variable PACKAGEROOT specifies an alternate location for
     pkg_add to fetch from.  The fetch URL is built using this environment
     variable and the automatic directory logic that pkg_add uses when the -r
     option is invoked.  An example setting would be "ftp://ftp3.FreeBSD.org".

     The environment variable PACKAGESITE specifies an alternate location for
     pkg_add to fetch from.  This variable subverts the automatic directory
     logic that pkg_add uses when the -r option is invoked.  Thus it should be
     a complete URL to the remote package file(s).

$


( - By the way, if anyone knows a simpler way of achieving that man/grep
combination, please tell!)

I couldn't find any documented reference as to where to put the env
setting, so I presume I must have either stumbled upon it while browsing
pkgtools.conf or seen it in an answer here or on a web page somewhere...


$ grep --context=2 PACKAGEROOT /usr/local/etc/pkgtools.conf
#    Equivalent to:
#      sprintf('%s/pub/FreeBSD/ports/%s/packages-%s/',
#              root  || ENV['PACKAGEROOT'] || 'ftp://ftp.FreeBSD.org',
#              OS_PLATFORM, OS_PKGBRANCH)
#
--
  #   ENV['PKG_FETCH'] = "curl '%s' -o '%s'"
  #   ENV['PKG_FETCH'] = 'false'        # never fetch packages from a remote site
  #   ENV['PACKAGEROOT'] = 'ftp://ftpN.XX.FreeBSD.org'

  ENV['PORTSDIR'] ||= '/usr/ports'
  ENV['PACKAGES'] ||= ENV['PORTSDIR'] + '/packages'
  ENV['PKG_PATH'] ||= ENV['PACKAGES'] + '/All'
# 20040210 ws - added PACKAGEROOT
  ENV['PACKAGEROOT'] = 'ftp://ftp.au.FreeBSD.org'

  # SANITY_CHECK: boolean (default: true)
$


You probably worked it out already but I thought this one was worthwhile
to toss in to the archives, and perhaps prompt someone to contemplate a
revision for the handbook.


hth

Wayne




More information about the freebsd-questions mailing list