<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/usr.sbin/pkg/pkg.7, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2026-07-13T22:08:58Z</updated>
<entry>
<title>Revert "pkg: Add -j and -r options"</title>
<updated>2026-07-13T22:08:58Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2026-07-13T22:08:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=9dfaf1cb37f8ac89cf6dbfd1d6905c8d03722391'/>
<id>urn:sha1:9dfaf1cb37f8ac89cf6dbfd1d6905c8d03722391</id>
<content type='text'>
This reverts commit d94e034d504682be56fc2e9d20ac2c0fe15b70ec at the
request of des@, as it seems to have broken the pass-through case.
</content>
</entry>
<entry>
<title>pkg: Add -j and -r options</title>
<updated>2026-07-13T15:32:41Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-07-13T15:32:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d94e034d504682be56fc2e9d20ac2c0fe15b70ec'/>
<id>urn:sha1:d94e034d504682be56fc2e9d20ac2c0fe15b70ec</id>
<content type='text'>
This allows pkg(7) to be used to bootstrap a jail or chroot, and to
recognize the -j and -r options and pass them through to pkg(8) if
already bootstrapped.

Note that this does not address the issue of repository keys.  If using
a signed package repository, you will still need to copy /usr/share/keys
into the target environment before or after bootstrapping, or pkg will
be unable to verify package signatures.

MFC after:	1 week
Reviewed by:	imp, bapt
Differential Revision:	https://reviews.freebsd.org/D58165
</content>
</entry>
<entry>
<title>pkg: clarify argument parsing</title>
<updated>2025-04-30T01:00:17Z</updated>
<author>
<name>Isaac Freund</name>
<email>ifreund@freebsdfoundation.org</email>
</author>
<published>2025-04-23T10:27:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=be61deae0aa2923bb9908fc5b37b35712603e622'/>
<id>urn:sha1:be61deae0aa2923bb9908fc5b37b35712603e622</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>pkg: update references to pkg.txz in man page</title>
<updated>2025-04-24T15:34:06Z</updated>
<author>
<name>Isaac Freund</name>
<email>ifreund@freebsdfoundation.org</email>
</author>
<published>2025-04-24T07:05:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=14704a7fdb77e92fdea11fc4b1e4e7479b0effbc'/>
<id>urn:sha1:14704a7fdb77e92fdea11fc4b1e4e7479b0effbc</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>pkg.7: Add example for fetching package for different FreeBSD versions</title>
<updated>2025-04-01T13:29:50Z</updated>
<author>
<name>Christos Margiolis</name>
<email>christos@FreeBSD.org</email>
</author>
<published>2025-04-01T13:29:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8900283fa37f6555055d8af5ffa1a5a2fbe2940e'/>
<id>urn:sha1:8900283fa37f6555055d8af5ffa1a5a2fbe2940e</id>
<content type='text'>
MFC after:	1 week
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D49580
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line nroff pattern</title>
<updated>2023-08-16T17:55:10Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=fa9896e082a1046ff4fbc75fcba4d18d1f2efc19'/>
<id>urn:sha1:fa9896e082a1046ff4fbc75fcba4d18d1f2efc19</id>
<content type='text'>
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
</content>
</entry>
<entry>
<title>pkg: Add limited --debug/-d support</title>
<updated>2022-08-24T17:32:09Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2022-08-24T17:32:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e9ad2964f5de925f21f54db17da8de3796381186'/>
<id>urn:sha1:e9ad2964f5de925f21f54db17da8de3796381186</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>pkg.7: Clean up mdoc</title>
<updated>2022-06-30T14:22:02Z</updated>
<author>
<name>Mateusz Piotrowski</name>
<email>0mp@FreeBSD.org</email>
</author>
<published>2022-06-30T13:46:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3beedc3840c29f3f728ed28cbc1450e1b9999f61'/>
<id>urn:sha1:3beedc3840c29f3f728ed28cbc1450e1b9999f61</id>
<content type='text'>
MFC after:	1 week
</content>
</entry>
<entry>
<title>pkg(7): add an -r reponame option for bootstrap and add</title>
<updated>2021-02-12T00:58:26Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2021-02-12T00:58:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=18418e1936b59c34a9c4a02a1ba5fe0d00dde1b3'/>
<id>urn:sha1:18418e1936b59c34a9c4a02a1ba5fe0d00dde1b3</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>pkg(7): rework the arguments handling</title>
<updated>2021-01-06T10:47:34Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2021-01-06T10:35:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ae994fdc5bd2ccc0ac0b8745fd1f1be67ad6e071'/>
<id>urn:sha1:ae994fdc5bd2ccc0ac0b8745fd1f1be67ad6e071</id>
<content type='text'>
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 &lt;contact@evilham.com&gt;
Differential Revision:	https://reviews.freebsd.org/D27860
</content>
</entry>
</feed>
