Date: Wed, 5 Sep 2001 11:23:17 -0700 (PDT) From: "NINOMIYA Hideyuki <NINOMIYA Hideyuki" <nin@jp.FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/30350: pkg_version output was "?" only Message-ID: <200109051823.f85INHF96073@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 30350
>Category: bin
>Synopsis: pkg_version output was "?" only
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 05 11:30:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: NINOMIYA Hideyuki
>Release: FreeBSD 4.4-RC i386
>Organization:
>Environment:
System: FreeBSD mebius 4.4-RC FreeBSD 4.4-RC #0: Wed Sep 5 17:38:24 JST 2001 nin
bin file: /usr/sbin/pkg_version
>Description:
When ports tree was not in the default place.
pkg_version does not work normally.
$ pkg_version /foo/bar/ports/INDEX
Output is
ImageMagick ?
........ ?
It seems to become the above.
This is because pkg_version does not refer to environmenti
variable ${PORTSDIR}.
>How-To-Repeat:
$ mv /usr/ports /foo/bar/ports
$ setenv PORTSDIR /foo/bar/ports
$ pkg_version /foo/bar/ports/INDEX
>Fix:
pkg_version gets possible to refer to ${PORTSDIR} with this patch
and comes to turn over a right result even if I move with ports tree
from the place of default.
Furthermore, if INDEX is ${PORTSDIR}/INDEX, I do not need to give it
as command line option.
Index: pkg_version.pl
===================================================================
RCS file: /tmp/am/da/freebsd_cvs/src/usr.sbin/pkg_install/version/pkg_version.pl
retrieving revision 1.4.2.12
diff -u -r1.4.2.12 pkg_version.pl
--- pkg_version.pl 2001/06/18 18:07:43 1.4.2.12
+++ pkg_version.pl 2001/09/05 15:17:18
@@ -45,8 +45,8 @@
$GetPkgNameCommand = 'make -V PKGNAME';
#$IndexFile = "ftp://ftp.freebsd.org/pub/FreeBSD/branches/-current/ports/INDEX"
-$PortsDirectory = '/usr/ports';
-$IndexFile = '/usr/ports/INDEX';
+$PortsDirectory = $ENV{PORTSDIR} || '/usr/ports';
+$IndexFile = "$PortsDirectory/INDEX";
$ShowCommandsFlag = 0;
$DebugFlag = 0;
$VerboseFlag = 0;
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109051823.f85INHF96073>
