diff --git a/ports-mgmt/pkg/Makefile b/ports-mgmt/pkg/Makefile index 028fda8a38c8..d4bbdcd1fcd3 100644 --- a/ports-mgmt/pkg/Makefile +++ b/ports-mgmt/pkg/Makefile @@ -1,63 +1,64 @@ PORTNAME= pkg DISTVERSION= 2.8.1 +PORTREVISION= 1 _PKG_VERSION= ${DISTVERSION} CATEGORIES= ports-mgmt MAINTAINER= pkg@FreeBSD.org COMMENT= Package manager WWW= https://github.com/freebsd/pkg LICENSE= BSD2CLAUSE USE_GITHUB= yes GH_ACCOUNT= freebsd USE_LDCONFIG= ${PREFIX}/lib/compat/pkg HAS_CONFIGURE= yes PORTDOCS= NEWS PORTSCOUT= ignore:1 CONFIGURE_ARGS= --prefix="${PREFIX}" \ --mandir="${PREFIX}/share/man" CONFIGURE_ENV= CC_FOR_BUILD="${CC}" # Use a submake as 'deinstall install' needs to reevaluate PKG_REGISTER # so that pkg-static is used from the wrkdir USE_SUBMAKE= yes OPTIONS_DEFINE= DOCS .if !exists(/usr/include/jail.h) EXTRA_PATCHES= ${FILESDIR}/extra-patch-docs_pkg.8 .endif .include .if defined(WITH_DEBUG) MAKE_ARGS+= DEBUG_FLAGS="${DEBUG_FLAGS}" .endif .if defined(WITH_PKG) .if ${WITH_PKG} == devel IGNORE= WITH_PKG is defined to 'devel', this version is the stable one .endif .endif #define PKG_DEPENDS to nothing to avoid infinite loop looking for pkg :) PKG_DEPENDS= .undef INSTALLS_DEPENDS # Use the internal pkg instead, generally, unless this is a cross-build, # in which case that won't work. Hope for the best then. .if !defined(CROSS_TOOLCHAIN) PKG_BIN= ${WRKSRC}/src/pkg-static .endif post-install: ${INSTALL_DATA} ${WRKSRC}/src/pkg.conf.sample ${STAGEDIR}${PREFIX}/etc/ @${MKDIR} ${STAGEDIR}${PREFIX}/lib/compat/pkg post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/NEWS ${STAGEDIR}${DOCSDIR}/NEWS .include diff --git a/ports-mgmt/pkg/files/patch-libpkg_pkg__jobs.c b/ports-mgmt/pkg/files/patch-libpkg_pkg__jobs.c new file mode 100644 index 000000000000..719706e9e5f8 --- /dev/null +++ b/ports-mgmt/pkg/files/patch-libpkg_pkg__jobs.c @@ -0,0 +1,12 @@ +--- libpkg/pkg_jobs.c.orig 2026-07-21 09:50:31 UTC ++++ libpkg/pkg_jobs.c +@@ -925,7 +925,8 @@ pkg_jobs_find_upgrade(struct pkg_jobs *j, const char * + "remote repo", pattern); + rc = pkg_jobs_universe_add_pkg(j->universe, p, &unit); + if (rc == EPKG_END) { +- pkg_free(p); ++ if (!pkg_in_universe(j->universe, p)) ++ pkg_free(p); + rc = EPKG_OK; + } + }