Project

General

Profile

Bug #1983

Updated by tuxillo over 2 years ago

For configuring pkg_radd/pkg_search, how about /usr/pkg/etc/mk.conf 
 
 instead of /etc/settings.conf or /etc/pkg_radd.conf.    We create mk.conf 
 
 automatically anyway, so it will normally exist. 

 

 Putting the config for pkg_radd and pkg_search there makes sense in that 
 
 other pkgsrc config options go there.    The default values would still work 
 
 as expected, even if mk.conf did not exist. 

 

 Also, this puts it in a place where it will integrate with the bin-install 
 
 target if a user wants to change it.    I don't want to have to set the same 
 
 variable in multiple places to get the desired results. 

 <pre> 
 <code class="diff"> 
 

 diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc 
 
 index 71fcfbe..88d330d 100644 
 
 --- a/Makefile_upgrade.inc 
 
 +++ b/Makefile_upgrade.inc 
 
 @@ -1586,4 +1586,3 @@ TO_REMOVE+=/usr/share/man/man4/i386/ndis.4.gz 
  
  TO_REMOVE+=/usr/sbin/ndiscvt 
  
  TO_REMOVE+=/usr/share/man/cat8/ndiscvt.8.gz 
  
  TO_REMOVE+=/usr/share/man/man8/ndiscvt.8.gz 
 
 -TO_REMOVE+=/etc/settings.conf 
 
 diff --git a/etc/pkg_radd.conf b/etc/pkg_radd.conf 
 
 deleted file mode 100644 
 
 index e9682b6..0000000 
 
 --- a/etc/pkg_radd.conf 
 
 +++ /dev/null 
 
 @@ -1,9 +0,0 @@ 
 
 -# This config file controls where pkg_radd looks for pkgsrc binaries. 
 
 -# The example here is the default. 
 
 -# Consult the dragonflybsd.org website for a list of mirrors. 
 
 -# The path should lead to a directory containing the architectures, 
 
 -# like 'i386' and x86_64.    The correct arch and DragonFly version is 
 
 -# automatically appended to the path by pkg_radd. 
 
 -# 
 
 -# BINPKG_BASE=http://mirror-master.dragonflybsd.org/packages 
 
 -# 
 
 diff --git a/usr.bin/pkg_radd/pkg_radd.1 b/usr.bin/pkg_radd/pkg_radd.1 
 
 index a6d5300..c2c33ae 100644 
 
 --- a/usr.bin/pkg_radd/pkg_radd.1 
 
 +++ b/usr.bin/pkg_radd/pkg_radd.1 
 
 @@ -47,11 +47,11 @@ variable to the 
  
  default 
  
  .Xr pkgsrc 7 
  
  binary package server or uses the global 
 
 -.Pa /etc/pkg_radd.conf 
 
 +.Pa /usr/pkg/etc/mk.conf 
  
  config file to calculate 
  
  .Ev PKG_PATH . 
  
  In 
 
 -.Pa /etc/pkg_radd.conf , 
 
 +.Pa /usr/pkg/etc/mk.conf , 
  
  set 
  
  .Ev BINPKG_BASE 
  
  to your favorite binary packages mirror URL to allow 
 
 @@ -87,7 +87,7 @@ If you add the following line 
  
  .Dl "BINPKG_BASE=http://mirror-master.dragonflybsd.org/packages" 
  
  .Pp 
  
  to 
 
 -.Pa /etc/pkg_radd.conf , 
 
 +.Pa /usr/pkg/etc/mk.conf , 
  
  .Nm 
  
  fetches packages from the main 
  
  .Dx 
 
 diff --git a/usr.bin/pkg_radd/pkg_radd.sh b/usr.bin/pkg_radd/pkg_radd.sh 
 
 index 10d903c..ef44806 100644 
 
 --- a/usr.bin/pkg_radd/pkg_radd.sh 
 
 +++ b/usr.bin/pkg_radd/pkg_radd.sh 
 
 @@ -31,7 +31,8 @@ 

  

  osver=`uname -r | awk -F - '{ print $1; }'` 
  
  cpuver=`uname -p | awk -F - '{ print $1; }'` 
 
 -[ -f /etc/pkg_radd.conf ] && . /etc/pkg_radd.conf 
 
 +[ -f /etc/settings.conf ] && . /etc/settings.conf # deprecated 
 
 +[ -f /usr/pkg/etc/mk.conf ] && . /usr/pkg/etc/mk.conf 
  
  : ${BINPKG_BASE:=http://mirror-master.dragonflybsd.org/packages} 
  
  : ${BINPKG_SITES:=$BINPKG_BASE/$cpuver/DragonFly-$osver/stable} 
  
  : ${PKG_PATH:=$BINPKG_SITES/All} 
 
 diff --git a/usr.bin/pkg_search/pkg_search.sh 
 
 b/usr.bin/pkg_search/pkg_search.sh 
 
 index 31e5df8..dc905a2 100644 
 
 --- a/usr.bin/pkg_search/pkg_search.sh 
 
 +++ b/usr.bin/pkg_search/pkg_search.sh 
 
 @@ -39,7 +39,8 @@ set_binpkg_sites() { 
  
  UNAME=`uname -s` 
  
  osver=`uname -r | awk -F - '{ print $1; }'` 
  
  cpuver=`uname -p | awk -F - '{ print $1; }'` 
 
 -[ -f /etc/settings.conf ] && . /etc/settings.conf 
 
 +[ -f /etc/settings.conf ] && . /etc/settings.conf # deprecated 
 
 +[ -f /usr/pkg/etc/mk.conf ] && . /usr/pkg/etc/mk.conf 
  
  set_binpkg_sites 

  

  NO_INDEX=0 
 </code> 
 </pre>

Back