Date: Mon, 28 May 2001 21:26:42 +0200 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: <20010528212642.B10911@heechee.tobez.org> In-Reply-To: <20010528220802.E8556@ringworld.oblivion.bg>; from roam@orbitel.bg on Mon, May 28, 2001 at 10:08:02PM %2B0300 References: <200105281830.f4SIU8P77434@freefall.freebsd.org> <20010528220802.E8556@ringworld.oblivion.bg>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 28, 2001 at 10:08:02PM +0300, Peter Pentchev wrote: > OK, how about this: reporting the no-longer-existent directory, too? Almost. :-) "$PortsDirectory/$origin" is too long, and there is no need for concatenation in the report line - the string interpolation will do. Now, would you commit it, or shall we wait for Bruce's opinion? ;-) By the way, it will be necessary to add an extra sed line to 400.status-pkg (see a smallish patch below the main patch). =Anton. -- May the tuna salad be with you. 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 19:16:01 @@ -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} = $origin; + 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: $currentPackages{$packageString}->{orphaned}"; + + } elsif (defined $currentPackages{$packageString}{'portversion'}) { - if (defined $currentPackages{$packageString}{'portversion'}) { $portVersion = $currentPackages{$packageString}{'portversion'}; $portPath = "$PortsDirectory/$currentPackages{$packageString}{'origin'}"; Index: 400.status-pkg =================================================================== RCS file: /home/ncvs/src/etc/periodic/weekly/400.status-pkg,v retrieving revision 1.6 diff -u -r1.6 400.status-pkg --- 400.status-pkg 2001/04/28 16:15:50 1.6 +++ 400.status-pkg 2001/05/28 19:25:05 @@ -21,7 +21,8 @@ -e '/^[^ ]*-\([^ ]*\) *\* *multiple versions.*[ ,]\1[,)].*/d' \ -e 's/^\([^ ]*\) *\* *multiple versions.*\((.*\)/ \1 needs updating \2/p' \ -e 's/^\(bsdpan-[^ ]*\) *? *unknown in index/ \1 may be outdated - check CPAN version manually/p' \ - -e 's/^\([^ ]*-[^ ]*\) *? *unknown in index/ \1 is obsolete/p' | + -e 's/^\([^ ]*-[^ ]*\) *? *unknown in index/ \1 is obsolete/p' \ + -e 's/^\([^ ]*-[^ ]*\) *? *\(orphaned:.*\)$/ \1 was \2/p' | tee /dev/stderr | wc -l) [ $rc -gt 1 ] && rc=1;; 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?20010528212642.B10911>