Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2001 22:08:02 +0300
From:      Peter Pentchev <roam@orbitel.bg>
To:        Anton Berezin <tobez@tobez.org>
Cc:        freebsd-ports@FreeBSD.org
Subject:   Re: ports/27707: Bogus make errors while executing pkg_version -v
Message-ID:  <20010528220802.E8556@ringworld.oblivion.bg>
In-Reply-To: <200105281830.f4SIU8P77434@freefall.freebsd.org>; from tobez@tobez.org on Mon, May 28, 2001 at 11:30:08AM -0700
References:  <200105281830.f4SIU8P77434@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <tobez@tobez.org>
> To: Peter Pentchev <roam@orbitel.bg>
> 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 = <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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010528220802.E8556>