From owner-freebsd-ports Mon May 28 12: 9:18 2001 Delivered-To: freebsd-ports@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id E3D4037B424 for ; Mon, 28 May 2001 12:09:06 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 29965 invoked by uid 1000); 28 May 2001 19:08:02 -0000 Date: Mon, 28 May 2001 22:08:02 +0300 From: Peter Pentchev To: Anton Berezin Cc: freebsd-ports@FreeBSD.org Subject: Re: ports/27707: Bogus make errors while executing pkg_version -v Message-ID: <20010528220802.E8556@ringworld.oblivion.bg> Mail-Followup-To: Anton Berezin , freebsd-ports@FreeBSD.org References: <200105281830.f4SIU8P77434@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105281830.f4SIU8P77434@freefall.freebsd.org>; from tobez@tobez.org on Mon, May 28, 2001 at 11:30:08AM -0700 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 On Mon, May 28, 2001 at 11:30:08AM -0700, Anton Berezin wrote: > 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? OK, how about this: reporting the no-longer-existent directory, too? G'luck, Peter -- This sentence claims to be an Epimenides paradox, but it is lying. Index: src/usr.sbin/pkg_install/version/pkg_version.pl =================================================================== RCS file: /home/ncvs/src/usr.sbin/pkg_install/version/pkg_version.pl,v retrieving revision 1.4.2.11 diff -u -r1.4.2.11 pkg_version.pl --- src/usr.sbin/pkg_install/version/pkg_version.pl 2001/05/18 14:40:44 1.4.2.11 +++ src/usr.sbin/pkg_install/version/pkg_version.pl 2001/05/28 19:04:32 @@ -373,7 +373,11 @@ # 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} = + "$PortsDirectory/$origin"; + next; + } open PKGNAME, "$GetPkgNameCommand|"; $pkgname = ; @@ -448,8 +452,15 @@ $packageName = $currentPackages{$packageString}{'name'}; $currentVersion = $currentPackages{$packageString}{'fullversion'}; + + if ($currentPackages{$packageString}->{orphaned}) { + + next if $ShowCommandsFlag; + $versionCode = "?"; + $Comment = "orphaned: ".$currentPackages{$packageString}->{orphaned}; + + } elsif (defined $currentPackages{$packageString}{'portversion'}) { - if (defined $currentPackages{$packageString}{'portversion'}) { $portVersion = $currentPackages{$packageString}{'portversion'}; $portPath = "$PortsDirectory/$currentPackages{$packageString}{'origin'}"; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message