From owner-freebsd-ports Mon May 28 11:30:17 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 26EA137B422 for ; Mon, 28 May 2001 11:30:08 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4SIU8P77434; Mon, 28 May 2001 11:30:08 -0700 (PDT) (envelope-from gnats) Date: Mon, 28 May 2001 11:30:08 -0700 (PDT) Message-Id: <200105281830.f4SIU8P77434@freefall.freebsd.org> To: freebsd-ports@FreeBSD.org Cc: From: Anton Berezin Subject: Re: ports/27707: Bogus make errors while executing pkg_version -v Reply-To: Anton Berezin Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR ports/27707; it has been noted by GNATS. From: Anton Berezin To: Peter Pentchev Cc: FreeBSD-gnats-submit@freebsd.org, bmah@freebsd.org Subject: Re: ports/27707: Bogus make errors while executing pkg_version -v Date: Mon, 28 May 2001 20:27:31 +0200 On Mon, May 28, 2001 at 08:55:05PM +0300, Peter Pentchev wrote: > On Mon, May 28, 2001 at 07:40:26PM +0200, Anton Berezin wrote: > > On Mon, May 28, 2001 at 08:25:15PM +0300, Peter Pentchev wrote: > > > > > Most of these cases involve ports which were removed altogether or > > > repo-copied into another category. > > > > I agree, but how's that different from the current `unknown in index' > > report for such packages? > > It is different for: > 1. repo-copied packages with the same version, which are *still* > in the index with the same name, and > 2. packages deleted since the last index rebuild (which can take > a while - after all, people do have things to do other than > rebuild port indices every now and then :) > > Both of these will be 'fixed' as soon as the index is rebuilt, but > still, I think a fast notification that something is wrong would > be preferable. Hmm, okay. In this case the better fix would be to actually use the same reporting mechanism pgk_version(1) already uses, instead of getting away with warn. What do you think? Index: pkg_version.pl =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/version/pkg_version.pl,v retrieving revision 1.20 diff -u -r1.20 pkg_version.pl --- pkg_version.pl 2001/05/15 18:37:23 1.20 +++ pkg_version.pl 2001/05/28 18:24:04 @@ -373,7 +373,10 @@ # Try to get the version out of the makefile. # The chdir needs to be successful or our make -V invocation # will fail. - chdir "$PortsDirectory/$origin" or next; + unless (chdir "$PortsDirectory/$origin" and -r "Makefile") { + $currentPackages{$packageString}->{orphaned} = 1; + next; + } open PKGNAME, "$GetPkgNameCommand|"; $pkgname = ; @@ -448,8 +451,15 @@ $packageName = $currentPackages{$packageString}{'name'}; $currentVersion = $currentPackages{$packageString}{'fullversion'}; + + if ($currentPackages{$packageString}->{orphaned}) { + + next if $ShowCommandsFlag; + $versionCode = "?"; + $Comment = "orphaned"; + + } elsif (defined $currentPackages{$packageString}{'portversion'}) { - if (defined $currentPackages{$packageString}{'portversion'}) { $portVersion = $currentPackages{$packageString}{'portversion'}; $portPath = "$PortsDirectory/$currentPackages{$packageString}{'origin'}"; %Anton. -- May the tuna salad be with you. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message