Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2001 11:30:08 -0700 (PDT)
From:      Anton Berezin <tobez@tobez.org>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: ports/27707: Bogus make errors while executing pkg_version -v
Message-ID:  <200105281830.f4SIU8P77434@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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?
 
 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 = <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




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