Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Sep 2021 21:55:14 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: c96b4d87ba33 - main - pkg: fix regression that breaks bootstrap from not a current directory.
Message-ID:  <202109102155.18ALtEq3059971@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

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

commit c96b4d87ba3336e6d4bea04c49d6abde158b7aae
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2021-09-10 21:49:17 +0000
Commit:     Gleb Smirnoff <glebius@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109102155.18ALtEq3059971>