Bug 246130

Summary: ports-mgmt/pkg: variables not expanded (except ABI)
Product: Ports & Packages Reporter: Stéphane D'Alu <sdalu>
Component: Individual Port(s)Assignee: freebsd-pkg (Nobody) <pkg>
Status: Closed FIXED    
Severity: Affects Only Me CC: lasse
Priority: --- Flags: bugzilla: maintainer-feedback? (pkg)
Version: Latest   
Hardware: Any   
OS: Any   

Description Stéphane D'Alu 2020-05-02 21:43:02 UTC
According to pkg.conf manual, the following variables are expanded during the parsing of pkg.conf: ABI, OSNAME, RELEASE, VERSION_MAJOR, VERSION_MINOR, ARCH

Using a variable other than ABI, the expansion is not performed.

poudriere: {
    url: https://xxxx/poudriere/packages/$RELEASE/
}

$ pkg --version
1.14.2

$ pkg update
pkg: https://xxxx/poudriere/packages/$RELEASE//packagesite.txz: Not Found
Comment 1 Stéphane D'Alu 2020-11-06 10:47:00 UTC
Same behaviour with 1.15.10
Comment 2 Lasse Brandt Thomsen 2020-12-04 08:47:23 UTC
ABI works.
ARCH, VERSION_MINOR, VERSION_MAJOR does not.

repo config url:
http://poudriere/freebsd${VERSION_MAJOR}${VERSION_MINOR}-default/${ABI}/${ARCH}

Translates to:
http://poudriere/freebsd${VERSION_MAJOR}${VERSION_MINOR}-default/FreeBSD:12:amd64/${ARCH}/meta.txz: Not Found

2020/12/04 09:35:57 [error] 757#100584: *39202 open() "/poudriere/data/packages/freebsd${VERSION_MAJOR}${VERSION_MINOR}-default/FreeBSD:12:amd64/${ARCH}/meta.conf" failed (2: No such file or directory)

pkg --version 1.15.10 on FreeBSD 12.2-RELEASE-p1
Comment 3 Lasse Brandt Thomsen 2020-12-04 10:43:06 UTC
I discovered the same issue in Github:
https://github.com/freebsd/pkg/issues/1897

And fixed in:
https://github.com/freebsd/pkg/commit/740c384344fc50ca7b0c839ce8da135fd6bbc003