summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authortobez <tobez@FreeBSD.org>2001-06-11 21:31:04 +0000
committertobez <tobez@FreeBSD.org>2001-06-11 21:31:04 +0000
commit7fa7e8bf10219015efdf8b20b155b34880385246 (patch)
tree054d9036fd80e0d6a304ee2f726b3ebb28b248ce /usr.sbin
parent04564ac889d37a3908fa01fc6e833e27e55cf668 (diff)
downloadFreeBSD-src-7fa7e8bf10219015efdf8b20b155b34880385246.zip
FreeBSD-src-7fa7e8bf10219015efdf8b20b155b34880385246.tar.gz
Check for the existence of the Makefile in the port skeleton directory
before running make. If the package origin points to a non-existent or stale port, report this package as orphaned, instead of producing more general `unknown in index' message. PR: 27707 Submitted by: myself, roamer Approved by: bmah, markm
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/pkg_install/version/pkg_version.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/version/pkg_version.pl b/usr.sbin/pkg_install/version/pkg_version.pl
index 94623e6..8647741 100755
--- a/usr.sbin/pkg_install/version/pkg_version.pl
+++ b/usr.sbin/pkg_install/version/pkg_version.pl
@@ -373,7 +373,10 @@ foreach $packageString (sort keys %currentPackages) {
# 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>;
@@ -449,7 +452,14 @@ foreach $packageString (sort keys %currentPackages) {
$currentVersion = $currentPackages{$packageString}{'fullversion'};
- if (defined $currentPackages{$packageString}{'portversion'}) {
+ if ($currentPackages{$packageString}->{orphaned}) {
+
+ next if $ShowCommandsFlag;
+ $versionCode = "?";
+ $Comment = "orphaned: $currentPackages{$packageString}->{orphaned}";
+
+ } elsif (defined $currentPackages{$packageString}{'portversion'}) {
+
$portVersion = $currentPackages{$packageString}{'portversion'};
$portPath = "$PortsDirectory/$currentPackages{$packageString}{'origin'}";
OpenPOWER on IntegriCloud