Bug 249178 - base system pkg bootstrap handles only .txz packages
Summary: base system pkg bootstrap handles only .txz packages
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-pkg (Nobody)
Depends on:
Reported: 2020-09-07 20:28 UTC by Ed Maste
Modified: 2020-09-18 18:22 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2020-09-07 20:28:32 UTC
usr.sbin/pkg/pkg.c specifies the filename for the pkg package via:

snprintf(url, MAXPATHLEN, "%s/Latest/pkg.txz", packagesite);

we should support the same set of compression types as pkg itself (tzst, txz, tbz, tgz, tar)
Comment 1 Ed Maste freebsd_committer 2020-09-14 19:20:00 UTC
In discussion with manu and bapt, we should accept:

.pkg <proposed compression-agnostic format>
.tzst <tar + zstd>
.txz <tar + xz, current format>
.tbz <tar + bz, uninteresting>
.tgz <tar + gzip>
.tar <uncompressed tar>
Comment 2 Ed Maste freebsd_committer 2020-09-14 19:20:56 UTC
Also note that libarchive internally detects the compression format, so we do not actually care about the extension, just find a matching file.
Comment 3 Mathieu Arnold freebsd_committer 2020-09-15 10:50:56 UTC
It should probably fetch the meta.conf file and use that to find out the extension, no?
Comment 4 Ed Maste freebsd_committer 2020-09-16 18:50:38 UTC
(In reply to Mathieu Arnold from comment #3)
It could, but I'd guess we'd want also try looping over all extensions as a fallback anyway?
Comment 5 Kyle Evans freebsd_committer 2020-09-18 14:55:29 UTC
I note that full-blown pkg(8) seems to have a similar problem with meta.txz:

root@viper:/var/db/pkg# pkg update -fr FreeBSD-base
Updating FreeBSD-base repository catalogue...
Fetching meta.conf: 100%    164 B   0.2kB/s    00:01
Fetching packagesite.tzst: 100%   18 KiB  18.1kB/s    00:01
Processing entries: 100%
FreeBSD-base repository update completed. 193 packages processed.
All repositories are up to date.

OK, that looks good, it fetched meta.conf... but then:

root@viper:/var/db/pkg# pkg upgrade -r FreeBSD-base
Updating FreeBSD-base repository catalogue...
pkg: file:///usr/local/pkgbase/repo/FreeBSD:13:amd64/latest/meta.txz: No such file or directory
repository FreeBSD-base has no meta file, using default settings
FreeBSD-base repository is up to date.
All repositories are up to date.
Checking for upgrades (0 candidates): 100%
Processing candidates (0 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.

root@viper:/var/db/pkg# cat FreeBSD-base.meta
Comment 6 Kyle Evans freebsd_committer 2020-09-18 18:22:09 UTC
(In reply to Kyle Evans from comment #5)

I've tracked down the behavior in this comment to that described in this issue: https://github.com/freebsd/pkg/issues/1886