git: c96b4d87ba33 - main - pkg: fix regression that breaks bootstrap from not a current directory.

Gleb Smirnoff glebius at FreeBSD.org
Fri Sep 10 21:55:15 UTC 2021


The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=c96b4d87ba3336e6d4bea04c49d6abde158b7aae

commit c96b4d87ba3336e6d4bea04c49d6abde158b7aae
Author:     Gleb Smirnoff <glebius at FreeBSD.org>
AuthorDate: 2021-09-10 21:49:17 +0000
Commit:     Gleb Smirnoff <glebius at FreeBSD.org>
CommitDate: 2021-09-10 21:49:17 +0000

    pkg: fix regression that breaks bootstrap from not a current directory.
    
    Fixes:          40b9f924b18
    Reviewed by:    kevans
---
 usr.sbin/pkg/pkg.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
index 1196c78e5cc9..292f4a68b824 100644
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -1063,9 +1063,13 @@ cleanup:
 static bool
 pkg_is_pkg_pkg(const char *pkg)
 {
-	char *vstart;
+	char *vstart, *basename;
 	size_t namelen;
 
+	/* Strip path. */
+	if ((basename = strrchr(pkg, '/')) != NULL)
+		pkg = basename + 1;
+
 	/*
 	 * Chop off the final "-" (version delimiter) and check the name that
 	 * precedes it.  If we didn't have a version delimiter, it must be the


More information about the dev-commits-src-main mailing list