Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Test ${PORTSDIR}/Makefile rather than only ${PORTSDIR}
Baptiste Daroussin committed 13 years ago
commit 5b3c74f504f13af0626f3201907c658f115eb21f
parent cb792eb
1 file changed +5 -1
modified pkg/version.c
@@ -167,6 +167,7 @@ exec_version(int argc, char **argv)
	match_t match = MATCH_ALL;
	char *pattern=NULL;
	struct stat sb;
+
	char portsdirmakefile[MAXPATHLEN];

	SLIST_INIT(&indexhead);

@@ -294,7 +295,10 @@ exec_version(int argc, char **argv)
		if (pkg_config_string(PKG_CONFIG_PORTSDIR, &portsdir) != EPKG_OK)
			err(1, "Cannot get portsdir config entry!");

-
		have_ports = (stat(portsdir, &sb) == 0 && S_ISDIR(sb.st_mode));
+
		snprintf(portsdirmakefile, sizeof(portsdirmakefile),
+
		    "%s/Makefile", portsdir);
+

+
		have_ports = (stat(portsdirmakefile, &sb) == 0 && S_ISREG(sb.st_mode));

		/* If none of -IPR were specified, and portsdir exists use that,
		   otherwise fallback to remote. */