History log of /src/usr.sbin/pkg/pkg.c (Results 1 – 25 of 424)
Revision Date Author Comments
# abf911af 05-Feb-2026 Pavel Knoblokh <info@software-advisory.com.au>

pkg: Fix mirror type parsing and service discovery

Signed-off-by: Pavel Knoblokh <info@software-advisory.com.au>
Reviewed by: emaste, imp, kevans
Fixes: dc4581589a3 ("pkg: clean support for reposit

pkg: Fix mirror type parsing and service discovery

Signed-off-by: Pavel Knoblokh <info@software-advisory.com.au>
Reviewed by: emaste, imp, kevans
Fixes: dc4581589a3 ("pkg: clean support for repositories")
Closes: https://github.com/freebsd/freebsd-src/pull/1989

show more ...


# 08b88431 11-Sep-2025 Seyed Pouria Mousavizadeh Tehrani <p.mousavizadeh@protonmail.com>

pkg(7): Add support for pkg+ prefix to bootstrap pubkey

MFC After: 1 day
Sponsored by: Amn Afzar Hoopad Inc
Differencial Revision: https://reviews.freebsd.org/D52418


# 73ba568b 05-May-2025 Isaac Freund <ifreund@freebsdfoundation.org>

pkg: suppress error on unknown options

pkg(7) does not understand all the options that pkg(8) understands and
should never log errors about unknown options that it will pass on to
pkg(8) without tou

pkg: suppress error on unknown options

pkg(7) does not understand all the options that pkg(8) understands and
should never log errors about unknown options that it will pass on to
pkg(8) without touching.

PR: 286510
Reviewed by: bapt
Fixes: be61deae0aa2 ("pkg: clarify argument parsing")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50163

show more ...


# be61deae 23-Apr-2025 Isaac Freund <ifreund@freebsdfoundation.org>

pkg: clarify argument parsing

Currently pkg parses all arguments and subcommands in a single
getopt_long() loop. This results in quite a bit of accidental
complexity, especially around the -r option

pkg: clarify argument parsing

Currently pkg parses all arguments and subcommands in a single
getopt_long() loop. This results in quite a bit of accidental
complexity, especially around the -r option for the bootstrap and add
subcommands.

This also results in the undocumented behavior of all options understood
by pkg(7) being accepted anywhere in the argument list regardless of
their position. This contradicts the behavior of pkg(8) and I find it
quite unexpected.

This patch splits the argument parsing done by pkg(7) into two phases
for global options and subcommand options. This gives behavior that
matches pkg(8), accepting the subset of pkg(8) options supported by
pkg(7) in the exact same positions that pkg(8) accepts them.

This is however a somewhat breaking change, as options are no longer
accepted by pkg(7) in places they are rejected by pkg(8). For example,
`pkg -f bootstrap` no longer works, only `pkg bootstrap -f`.

The original motivation for writing this patch was investigating support
for --rootdir in pkg(7). Since pkg(8) uses -r as the short form for
both --rootdir and --repository depending on the position, I decided
that pkg(7) needed to be brought inline with pkg(8)'s argument parsing
behavior to avoid confusion.

This patch also gets rid of args_add_message (unused since 40b9f924b1)

Relnotes: yes
Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49977

show more ...


# c1557708 16-Jan-2025 Mark Johnston <markj@FreeBSD.org>

pkg: Fix Coverity warnings

- Fix allocation size in config_get_repositories().
- Fix a memory leak in read_conf_file().
- Avoid a null pointer dereference in an error path in
verify_pubsignature()

pkg: Fix Coverity warnings

- Fix allocation size in config_get_repositories().
- Fix a memory leak in read_conf_file().
- Avoid a null pointer dereference in an error path in
verify_pubsignature().

Fixes: e3b4a51580fc ("pkg(7): expand VERSION_MAJOR, VERSION_MINOR, RELEASE and OSNAME")
Fixes: dc4581589a32 ("pkg: clean support for repositories")

show more ...


# 0cd9513a 07-Oct-2024 Ed Maste <emaste@FreeBSD.org>

pkg: retire backwards compatibility bootstrap support

pkg.pkg has been available for years and is the default in all supported
releases. Retire fallback support for pkg.txz.

Reviewed by: bapt
Spon

pkg: retire backwards compatibility bootstrap support

pkg.pkg has been available for years and is the default in all supported
releases. Retire fallback support for pkg.txz.

Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46990

show more ...


# dc458158 14-Jan-2025 Baptiste Daroussin <bapt@FreeBSD.org>

pkg: clean support for repositories

Rework the way the bootstrap fetches pkg, by implementing a full support
for the repositories, the boostrap will now loop over all available repo
and try to fetch

pkg: clean support for repositories

Rework the way the bootstrap fetches pkg, by implementing a full support
for the repositories, the boostrap will now loop over all available repo
and try to fetch the full package from there. It will at the first valid
package found.

Fallback to packagesite (which has been deprecated for a while) if needed, by
transforming it into a repo, if no repo is found.

MFC After: 3 weeks

show more ...


# 3d0a0dda 01-Jan-2025 Kyle Evans <kevans@FreeBSD.org>

pkg: finish adding the ECC signer and signature type bits

Signature types need to be parsed out of the key/signature information
that we are presented with from the files we download. We use that t

pkg: finish adding the ECC signer and signature type bits

Signature types need to be parsed out of the key/signature information
that we are presented with from the files we download. We use that to
understand whicher signer we need to dispatch to.

The ECC signer is more-or-less lifted from pkg(8), with some changes to
slim it down for pkg(7).

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D48108

show more ...


# 2e065d74 01-Jan-2025 Kyle Evans <kevans@FreeBSD.org>

pkg: add a pkgsign_verify_data callback

This will be used to verify raw payloads, as if signed by pkg-key(8).
It will be used specifically in pkg(7) to verify .pubkeysig as published
by poudriere.

pkg: add a pkgsign_verify_data callback

This will be used to verify raw payloads, as if signed by pkg-key(8).
It will be used specifically in pkg(7) to verify .pubkeysig as published
by poudriere.

Amend verify_pubsignature() now to use it. For the RSA signer, we need
to verify using a sha256 of the data instead of the data itself.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D48109

show more ...


# 2ecfc040 01-Jan-2025 Kyle Evans <kevans@FreeBSD.org>

pkg: refactor out a pkg_read_fd()

We already have to do this for reading the pubkey, just pull it out for
other uses. The ECC signer will use this to verify the bootstrap if
the PUBKEY mechanism is

pkg: refactor out a pkg_read_fd()

We already have to do this for reading the pubkey, just pull it out for
other uses. The ECC signer will use this to verify the bootstrap if
the PUBKEY mechanism is used.

Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D48107

show more ...


# 5862580d 01-Jan-2025 Kyle Evans <kevans@FreeBSD.org>

pkg: abstract rsa out behind a pkgsign API

This mirrors a change we made in pkg(8), and will be used to next add
another signer that does ECC.

Reviewed by: bapt, emaste
Differential Revision: https

pkg: abstract rsa out behind a pkgsign API

This mirrors a change we made in pkg(8), and will be used to next add
another signer that does ECC.

Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D48106

show more ...


# 2629e90d 01-Jan-2025 Kyle Evans <kevans@FreeBSD.org>

pkg: pull rsa bits out of pkg.c

We'll eventually add a pkgsign abstraction over these similar to how we do
in pkg(8), but start by isolating these parts.

Reviewed by: bapt, emaste
Differential Revi

pkg: pull rsa bits out of pkg.c

We'll eventually add a pkgsign abstraction over these similar to how we do
in pkg(8), but start by isolating these parts.

Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D48105

show more ...


# be924340 07-Oct-2024 Ed Maste <emaste@FreeBSD.org>

pkg: improve error message

Print the complete list of url that have failed

PR: 281924
Co-authored-by: Baptiste Daroussin <bapt@FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D46983


# f5c847ae 07-Oct-2024 Ed Maste <emaste@FreeBSD.org>

pkg: prefer .pkg extension

.pkg is the default extension as of commit c244b1d8a387, falling back to
.txz if not found.

PR: 281924
Reviewed by: bapt
Fixes: a2aac2f5e564 ("pkg(7): when bootstrapping

pkg: prefer .pkg extension

.pkg is the default extension as of commit c244b1d8a387, falling back to
.txz if not found.

PR: 281924
Reviewed by: bapt
Fixes: a2aac2f5e564 ("pkg(7): when bootstrapping first search for pkg.bsd file then pkg.txz")
Fixes: c244b1d8a387 ("pkg: settle the uniq extension to .pkg instead of .bsd")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46977

show more ...


# 4d65a7c6 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.sbin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

usr.sbin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


# e5dd5bfa 09-Mar-2023 Baptiste Daroussin <bapt@FreeBSD.org>

pkg(7): now that we do use libmd, use it completly

Use SHA256_Fd and SHA256_Data instead of home made equivalent.
wrap those functions into hash.c to avoid header collition between
openssl and libmd

pkg(7): now that we do use libmd, use it completly

Use SHA256_Fd and SHA256_Data instead of home made equivalent.
wrap those functions into hash.c to avoid header collition between
openssl and libmd

Suggested by: kevans

show more ...


# b2654064 09-Mar-2023 Baptiste Daroussin <bapt@FreeBSD.org>

pkg(7): use libmd for sha256 instead of openssl

OpenSSL 3.0 has deprecated the sha256 api, let's use libmd which has the
same API instead.

In order to avoid the collision in definitions (sha256.h c

pkg(7): use libmd for sha256 instead of openssl

OpenSSL 3.0 has deprecated the sha256 api, let's use libmd which has the
same API instead.

In order to avoid the collision in definitions (sha256.h cannot be
included in the same file as a file where openssl headers has been
included) let's move the sha256 related code in its own file

PR: 270023
Reported by: ngie

show more ...


# c816aea7 09-Mar-2023 Kyle Evans <kevans@FreeBSD.org>

Revert "grep: remove tautological condition"

This reverts commit f6d6c66889001208aee7b0c46efe1c8ddffda57c.

Gremlins snuck into my tree and injected some WIP.


# f6d6c668 09-Mar-2023 Kyle Evans <kevans@FreeBSD.org>

grep: remove tautological condition

st_size is an off_t, it cannot hold values larger than OFF_MAX.

CID: 1008931


# 990878b0 04-Sep-2022 Gordon Bergling <gbe@FreeBSD.org>

pkg(8): Remove a double word in a source code comment

- s/that that/that/

MFC after: 3 days


# e9ad2964 24-Aug-2022 Brooks Davis <brooks@FreeBSD.org>

pkg: Add limited --debug/-d support

Add an internal debug level global:
- Level 1 (-d) currently does nothing.

- Level 2 (-d -d) enables libfetch debugging (quite verbose) so it's
possible to

pkg: Add limited --debug/-d support

Add an internal debug level global:
- Level 1 (-d) currently does nothing.

- Level 2 (-d -d) enables libfetch debugging (quite verbose) so it's
possible to see what pkg is attempting to download without having
to sniff traffic.

Reviewed by: debdrup, bapt
Differential Revision: https://reviews.freebsd.org/D35756

show more ...


# 60b92ba9 21-Apr-2022 John Hood <jhood@niksun.com>

/usr/sbin/pkg: don't sleep on fetch failure

PR: 263458


# c96b4d87 10-Sep-2021 Gleb Smirnoff <glebius@FreeBSD.org>

pkg: fix regression that breaks bootstrap from not a current directory.

Fixes: 40b9f924b18
Reviewed by: kevans


12345678910>>...17