Subject: pkg/26940: pkg_tarup PATH order
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <pancake@phreaker.net>
List: pkgsrc-bugs
Date: 09/13/2004 21:53:29
>Number:         26940
>Category:       pkg
>Synopsis:       pkg_tarup uses incorrect PATH order
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 13 21:23:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 2.0G
>Organization:
	
>Environment:
	
	
System: NetBSD pl2 2.0G NetBSD 2.0G (pancake-laptop) #10: Wed Jul 21 20:57:24 CEST 2004 pancake@panser:/usr/src/sys/arch/i386/compile/PANCAKE_LAPTOP i386
Architecture: i386
Machine: i386
>Description:
	I had some problems on freebsd and linux trying to use pkg_tarup it
	says that the pkg doesn't exists...problem is solved changing the path.
	
>How-To-Repeat:
	
#~> pkg_tarup bash
Warning: no package matching bash found
ERROR: No packages to tarup identified!
Usage: /usr/pkg/bin/pkg_tarup [-a] [-K pkg_dbdir] [-d pkgrepository] [-s pkg_sufx] installed_pkg|pattern [...]
The following environment variables are used:
(unless overriden by command line parameters)
PKGREPOSITORY - A destination directory for packages (/tmp)
PKG_DBDIR     - The location of the package database directory
PKG_SUFX      - The suffix to append to the package (.tgz)
#~> pkg_info -a| grep bash
bash-2.05.2.7nb2    The GNU Bourne Again Shell
#~> uname -a
FreeBSD porticoluna 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Wed Jul 21 19:27:12 CEST 2004     foo@porticoluna:/usr/obj/usr/src/sys/KERN_PLUNA2  i386
#~> 
/// APPLY THE PATCH
#~> vim /usr/pkg/bin/pkg_tarup
#~> pkg_tarup bash
Creating binary package: bash-2.05.2.7nb2
Creating package /tmp/bash-2.05.2.7nb2.tgz
Registering depends: gettext-lib>=0.11.5nb1.
Registering conflicts: static-bash-[0-9]*.
#~> 


>Fix:
	
Apply this patch to /usr/pkgsrc/pkgtools/pkg_tarup/files/pkg_tarup:

--- pkg_tarup.orig	2004-09-13 21:42:30.000000000 +0000
+++ pkg_tarup	2004-09-13 21:43:13.000000000 +0000
@@ -11,7 +11,7 @@
 
 PREFIX=${PREFIX:-@PREFIX@}
 
-PATH=/sbin:/usr/sbin:/bin:/usr/bin:${PREFIX}/sbin:${PREFIX}/bin:@PKG_TOOLS_BIN@
+PATH=${PREFIX}/sbin:${PREFIX}/bin:/sbin:/bin:/usr/sbin:/usr/bin:@PKG_TOOLS_BIN@
 export PATH
 
 OS=`uname -s`
	
>Release-Note:
>Audit-Trail:
>Unformatted: