History log of /src/usr.sbin/pkg/pkg.7 (Results 1 – 25 of 66)
Revision Date Author Comments
# 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 ...


# 14704a7f 24-Apr-2025 Isaac Freund <ifreund@freebsdfoundation.org>

pkg: update references to pkg.txz in man page

Only pkg.pkg is supported since 0cd9513a5ba5b.

Reviewed by: emaste, ziaee
Fixes: 0cd9513a5ba5 ("pkg: retire backwards compatibility bootstrap support")

pkg: update references to pkg.txz in man page

Only pkg.pkg is supported since 0cd9513a5ba5b.

Reviewed by: emaste, ziaee
Fixes: 0cd9513a5ba5 ("pkg: retire backwards compatibility bootstrap support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49994

show more ...


# 8900283f 01-Apr-2025 Christos Margiolis <christos@FreeBSD.org>

pkg.7: Add example for fetching package for different FreeBSD versions

MFC after: 1 week
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D49580


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

Remove $FreeBSD$: two-line nroff pattern

Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/


# 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 ...


# 3beedc38 30-Jun-2022 Mateusz Piotrowski <0mp@FreeBSD.org>

pkg.7: Clean up mdoc

MFC after: 1 week


# 18418e19 12-Feb-2021 Kyle Evans <kevans@FreeBSD.org>

pkg(7): add an -r reponame option for bootstrap and add

This is limited to bootstrap/add because some real pkg(8) commands
have -r flags with an incompatible meaning/usage, e.g., pkg-audit.
pkg(7) w

pkg(7): add an -r reponame option for bootstrap and add

This is limited to bootstrap/add because some real pkg(8) commands
have -r flags with an incompatible meaning/usage, e.g., pkg-audit.
pkg(7) will still commence the search as it has, but it will ignore any
repo objects without the given name so that overrides and whatnot still
work as expected.

The use of it for add is noted in the manpage; notably, that the
signature config for that repository will be used over global config if
it's specified. i.e., pkg(7) should assume that the given pkg did come
from that repository and treat it appropriately.

Reviewed by: bapt, manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28524

show more ...


# ae994fdc 06-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

pkg(7): rework the arguments handling

Rework the arguments handling around using getopt_long:
* add long option support
* add -4 and -6 support to enforce ipv4 or ipv6

While here fix a regression w

pkg(7): rework the arguments handling

Rework the arguments handling around using getopt_long:
* add long option support
* add -4 and -6 support to enforce ipv4 or ipv6

While here fix a regression which occured between FreeBSD 12.1 and
FreeBSD 12.2 where pkg bootstrap -y stopped working

PR: 252270
MFC after: 2 weeks
Submitted by: evilham <contact@evilham.com>
Differential Revision: https://reviews.freebsd.org/D27860

show more ...


# e771d590 06-Nov-2020 John-Mark Gurney <jmg@FreeBSD.org>

fix up docs, if signature checking is enabled, the file MUST exist...


# 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 ...


# 14704a7f 24-Apr-2025 Isaac Freund <ifreund@freebsdfoundation.org>

pkg: update references to pkg.txz in man page

Only pkg.pkg is supported since 0cd9513a5ba5b.

Reviewed by: emaste, ziaee
Fixes: 0cd9513a5ba5 ("pkg: retire backwards compatibility bootstrap support")

pkg: update references to pkg.txz in man page

Only pkg.pkg is supported since 0cd9513a5ba5b.

Reviewed by: emaste, ziaee
Fixes: 0cd9513a5ba5 ("pkg: retire backwards compatibility bootstrap support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49994

show more ...


# 8900283f 01-Apr-2025 Christos Margiolis <christos@FreeBSD.org>

pkg.7: Add example for fetching package for different FreeBSD versions

MFC after: 1 week
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D49580


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

Remove $FreeBSD$: two-line nroff pattern

Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/


# 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 ...


# 3beedc38 30-Jun-2022 Mateusz Piotrowski <0mp@FreeBSD.org>

pkg.7: Clean up mdoc

MFC after: 1 week


# 18418e19 12-Feb-2021 Kyle Evans <kevans@FreeBSD.org>

pkg(7): add an -r reponame option for bootstrap and add

This is limited to bootstrap/add because some real pkg(8) commands
have -r flags with an incompatible meaning/usage, e.g., pkg-audit.
pkg(7) w

pkg(7): add an -r reponame option for bootstrap and add

This is limited to bootstrap/add because some real pkg(8) commands
have -r flags with an incompatible meaning/usage, e.g., pkg-audit.
pkg(7) will still commence the search as it has, but it will ignore any
repo objects without the given name so that overrides and whatnot still
work as expected.

The use of it for add is noted in the manpage; notably, that the
signature config for that repository will be used over global config if
it's specified. i.e., pkg(7) should assume that the given pkg did come
from that repository and treat it appropriately.

Reviewed by: bapt, manu
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28524

show more ...


# ae994fdc 06-Jan-2021 Baptiste Daroussin <bapt@FreeBSD.org>

pkg(7): rework the arguments handling

Rework the arguments handling around using getopt_long:
* add long option support
* add -4 and -6 support to enforce ipv4 or ipv6

While here fix a regression w

pkg(7): rework the arguments handling

Rework the arguments handling around using getopt_long:
* add long option support
* add -4 and -6 support to enforce ipv4 or ipv6

While here fix a regression which occured between FreeBSD 12.1 and
FreeBSD 12.2 where pkg bootstrap -y stopped working

PR: 252270
MFC after: 2 weeks
Submitted by: evilham <contact@evilham.com>
Differential Revision: https://reviews.freebsd.org/D27860

show more ...


# e771d590 06-Nov-2020 John-Mark Gurney <jmg@FreeBSD.org>

fix up docs, if signature checking is enabled, the file MUST exist...


# 3b8f0845 28-Apr-2014 Simon J. Gerraty <sjg@FreeBSD.org>

Merge head


# 84e51a1b 23-Apr-2014 Alan Somers <asomers@FreeBSD.org>

IFC @264767


# bf775ebb 25-Feb-2014 Peter Grehan <grehan@FreeBSD.org>

MFC @ r259635

This brings in the "-w" option from bhyve to ignore unknown MSRs.
It will make debugging Linux guests a bit easier.

Suggested by: Willem Jan Withagen (wjw at digiware nl)


# 5748b897 19-Feb-2014 Martin Matuska <mm@FreeBSD.org>

Merge head up to r262222 (last merge was incomplete).


# 485ac45a 04-Feb-2014 Peter Grehan <grehan@FreeBSD.org>

MFC @ r259205 in preparation for some SVM updates. (for real this time)


# eb31a574 12-Dec-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Fix multi-repository support by properly respecting 'enabled' flag.

This will read the REPOS_DIR env/config setting (default is /etc/pkg
and /usr/local/etc/pkg/repos) and use the last enabled reposi

Fix multi-repository support by properly respecting 'enabled' flag.

This will read the REPOS_DIR env/config setting (default is /etc/pkg
and /usr/local/etc/pkg/repos) and use the last enabled repository.

This can be changed in the environment using a comma-separated list,
or in /usr/local/etc/pkg.conf with JSON array syntax of:
REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"]

Approved by: bapt
MFC after: 1 week

show more ...


# d6ea2739 19-Nov-2013 Bryan Drewery <bdrewery@FreeBSD.org>

Follow-up to r258227 and document 'enabled' as a boolean instead of
a string.

Approved by: bapt
MFC after: 2 days
X-MFC-With: r258227


123