Am 05.11.25 um 03:01 schrieb Janky Jay, III:
Hi All,

On 11/4/25 05:23PM, Tatsuki Makino wrote:
Hello.

On 2025/11/04 23:59, Jan Henrik Sylvester wrote:
That /usr/local/lib/compat/pkg was missing seems to be a bug in portmaster, which was used to upgrade pkg-2.3.1_1 to pkg-2.4.1, because when I do 'pkg delete -f pkg' and 'make -C /usr/ports/ports-mgmt/pkg install clean' the directory is created correctly. I guess I should learn that portmaster really is an outdated method to upgrade.
When the port is installed using make, ${LOCALBASE}/lib/compat/pkg may be removed by /usr/ports/Templates/BSD.local.dist if the directory is empty. portmaster is merely one of the entities through which that operation is carried out.

Also, just a quick FYI, I tested the upgrade of pkg-2.3.1_1 to pkg-2.4.1 today using portmaster on both FreeBSD-14.3-R-p5 and FreeBSD-15.0-STABLE (latest 15- n281026-e2a87c08171a) and I didn't have any issues or errors at all. The "pkg" command continued to work as expected afterwards.

I haven't tried copying any "pkg" packages to another system to test, but everything seems to be in order for the way portmaster is building and installing the port.

I cannot reproduce the issue, and do not understand why the package
creation may have failed for the OP.

My test build ended thus:

===>>> Creating a package for new version pkg-2.3.1_1
        ===>>> Package saved to yes/All

===>>> Installation of ports-mgmt/pkg (pkg-2.3.1_1) complete

# ls -l /usr/packages/All/pkg-2.3.1_1.pkg
-rw-r--r--  1 root wheel 14128264 Nov  5 09:21 /usr/packages/All/pkg-2.3.1_1.pkg
# tar tvf /usr/packages/All/pkg-2.3.1_1.pkg +MANIFEST
-rw-r--r--  0 root   wheel    9862 Jan  1  1970 +MANIFEST

Portmaster invokes just the same commands used to manually build packages,
and it depends on the port system to create the stage directory.

When building packages with "portmaster -g", "make package" is used, as
would be the case in a "manual" package build.

The pkg command noticed the missing directory in the reported issue:

pkg: dir '/usr/local/lib/compat/pkg' is missing
pkg: package creation failed

That message indicates that this directory was missing in the stage
directory, which is created by the post-install target in pkg/Makefile:

post-install:
        @${MKDIR} ${STAGEDIR}${PREFIX}/lib/compat/pkg

Since the post-install target is invoked during "make stage", which is a
pre-requisite for "make package", I do not see how this could have failed
when building the package with portmaster.

None of these build steps is special when building with portmaster and
none of the build steps depends on the pkg command (well, creation of the
package obviously does, but creation of the missing compat/pkg directory
does not).

Regards, STefan

Reply via email to