Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2001 10:30:08 -0700 (PDT)
From:      Peter Pentchev <roam@orbitel.bg>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: ports/27707: Bogus make errors while executing pkg_version -v
Message-ID:  <200105281730.f4SHU8003737@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: Peter Pentchev <roam@orbitel.bg>
To: tobez@tobez.org
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:25:15 +0300

 On Mon, May 28, 2001 at 03:40:39PM +0200, tobez@tobez.org wrote:
 > 
 > >Number:         27707
 > >Category:       ports
 > >Synopsis:       Bogus make errors while executing pkg_version -v
 > >Originator:     Anton Berezin
 > >Release:        FreeBSD 5.0-CURRENT i386
 > >Organization:
 > catpipe Systems ApS
 > >Environment:
 > 
 > Any FreeBSD system with ORIGIN-aware ports collection.
 > 
 > >Description:
 > 
 > 	# sh /etc/periodic/weekly/400.status-pkg 
 > 
 > 	Check for out of date packages:
 > 	make: no target to make.
 > 	make: no target to make.
 > 	  AbiWord-0.7.13 needs updating (port has 0.7.13_1)
 >     ...
 > 
 > These bogus make errors appear because pkg_version does not check for
 > the existence of the Makefile in the port skeleton directory.  Under
 > certain circumstances it is possible to have stale ports directories
 > with only README.html file in them.
 >
 > >How-To-Repeat:
 > 
 > If you ports collection was installed by sysinstall (i.e., it has
 > README.html files), and the skeletons of some of the ports you have
 > installed were subsequently nuked by cvsup, you will see these make
 > error messages when you execute pkg_version.
 > 
 > >Fix:
 > 
 > 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 13:28:38
 > @@ -374,6 +374,7 @@
 >  	# The chdir needs to be successful or our make -V invocation
 >  	# will fail.
 >  	chdir "$PortsDirectory/$origin" or next;
 > +	next unless -r "Makefile";
 >  
 >  	open PKGNAME, "$GetPkgNameCommand|";
 >  	$pkgname = <PKGNAME>;
 
 Most of these cases involve ports which were removed altogether or
 repo-copied into another category.
 
 I personally think that both these cases merit the user's attention -
 in the case of a removed port, the CVS log messages would show
 a possible reason - obsoleted by this-and-this, or removed for lack
 of attention and a bad security track, or something similar;
 in the case of a repo-copied port, it is highly in the admin's interest
 to either just change the origin line in /var/db/pkg/name/+CONTENTS,
 or rebuild the port, to make sure that subsequent pkg_version runs
 report correct version information.
 
 So how about this instead:
 
 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 17:19:13
 @@ -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;
 +	if (!(chdir("$PortsDirectory/$origin") && -r "Makefile")) {
 +		warn("orphaned: $packageString: $PortsDirectory/$origin\n");
 +		next;
 +	}
  
  	open PKGNAME, "$GetPkgNameCommand|";
  	$pkgname = <PKGNAME>;
 
 ..making pkg_version actually whine about the change?
 
 G'luck,
 Peter
 
 -- 
 I am not the subject of this sentence.

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?200105281730.f4SHU8003737>