<commit_before>.\"
.\" FreeBSD pkg - a next generation package for the installation and maintenance
.\" of non-core utilities.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\"
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
.Dd September 8, 2013
.Dt PKG 8
.Os
.\" ---------------------------------------------------------------------------
.Sh NAME
.Nm pkg ,
.Nm pkg-static
.Nd a utility for manipulating packages
.\" ---------------------------------------------------------------------------
.Sh SYNOPSIS
.Nm
.Op Fl v
.Op Fl d
.Op Fl l
.Op Fl N
.Op Fl j Ao jail name or id Ac | Fl c Ao chroot path Ac
.Op Fl C Ao configuration file Ac
.Op Fl R Ao repository configuration directory Ac
.Ao command Ac Ao Ar flags Ac
.\" ---------------------------------------------------------------------------
.Sh DESCRIPTION
provides an interface for manipulating packages - registering,
adding, removing and upgrading of packages.
.Nm pkg-static
is a statically linked variant of
.Nm
typically only used for the initial installation of
.Nm .
There are some differences in functionality.
See
.Xr pkg.conf 5
for details.
.\" ---------------------------------------------------------------------------
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width indent
.It Fl v
Displays the current version of
.Nm
.It Fl d
Show debug information
.It Fl l
List all the available command names, and exit without performing any
other action.
The
.Fl v
option takes precedence over
.Fl l
but
.Fl l
will override any other command line arguments.
.It Fl N
Activation status check mode.
Prevent
.Nm
from automatically creating or initializing the sqlite database in
.Pa /var/db/pkg/local.sqlite
if it does not already exist.
.Pp
Prevent
.Nm
from performing any actions if no packages are currently installed, on
the basis that a correctly initialised system using
.Nm
will always have at least the
.Nm
package itself registered.
.Pp
If used without any other arguments,
.Nm Fl N
will run the sanity tests and if successful print out a short message
showing how many packages are currently installed.
The exit status should be a reliable indication of whether a system
is configured to use
.Nm
as its package management system or not.
.Pp
Example usage:
.Bd -literal -offset indent
  if pkg -N >/dev/null 2>&1; then
    # pkgng-specifics
  else
    # pkg_install-specifics
  fi
.Ed
.Pp
The
.Fl N
flag was first released in the
.Pa /usr/sbin/pkg
bootstrapper
in FreeBSD 8.4,
but was missing from FreeBSD 9.1.
It was not released in
.Nm
until 1.0.13.
Because of this, it may not be enough to just call
.Nm Fl N ,
as the bootstrapper may be invoked, or an error returned
from
.Nm .
The following script is the safest way to detect if
.Nm
is installed and activated:
.Bd -literal -offset indent
  if TMPDIR=/dev/null ASSUME_ALWAYS_YES=1 \\
       PACKAGESITE=file:///nonexistent \\
       pkg info pkg >/dev/null 2>&1; then
    # pkgng-specifics<commit_msg>pkg.8: Update example for detecting pkg(8) to support pkg-devel<commit_after>.\"
.\" FreeBSD pkg - a next generation package for the installation and maintenance
.\" of non-core utilities.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\"
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
.Dd September 14, 2013
.Dt PKG 8
.Os
.\" ---------------------------------------------------------------------------
.Sh NAME
.Nm pkg ,
.Nm pkg-static
.Nd a utility for manipulating packages
.\" ---------------------------------------------------------------------------
.Sh SYNOPSIS
.Nm
.Op Fl v
.Op Fl d
.Op Fl l
.Op Fl N
.Op Fl j Ao jail name or id Ac | Fl c Ao chroot path Ac
.Op Fl C Ao configuration file Ac
.Op Fl R Ao repository configuration directory Ac
.Ao command Ac Ao Ar flags Ac
.\" ---------------------------------------------------------------------------
.Sh DESCRIPTION
provides an interface for manipulating packages - registering,
adding, removing and upgrading of packages.
.Nm pkg-static
is a statically linked variant of
.Nm
typically only used for the initial installation of
.Nm .
There are some differences in functionality.
See
.Xr pkg.conf 5
for details.
.\" ---------------------------------------------------------------------------
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width indent
.It Fl v
Displays the current version of
.Nm
.It Fl d
Show debug information
.It Fl l
List all the available command names, and exit without performing any
other action.
The
.Fl v
option takes precedence over
.Fl l
but
.Fl l
will override any other command line arguments.
.It Fl N
Activation status check mode.
Prevent
.Nm
from automatically creating or initializing the sqlite database in
.Pa /var/db/pkg/local.sqlite
if it does not already exist.
.Pp
Prevent
.Nm
from performing any actions if no packages are currently installed, on
the basis that a correctly initialised system using
.Nm
will always have at least the
.Nm
package itself registered.
.Pp
If used without any other arguments,
.Nm Fl N
will run the sanity tests and if successful print out a short message
showing how many packages are currently installed.
The exit status should be a reliable indication of whether a system
is configured to use
.Nm
as its package management system or not.
.Pp
Example usage:
.Bd -literal -offset indent
  if pkg -N >/dev/null 2>&1; then
    # pkgng-specifics
  else
    # pkg_install-specifics
  fi
.Ed
.Pp
The
.Fl N
flag was first released in the
.Pa /usr/sbin/pkg
bootstrapper
in FreeBSD 8.4,
but was missing from FreeBSD 9.1.
It was not released in
.Nm
until 1.0.13.
Because of this, it may not be enough to just call
.Nm Fl N ,
as the bootstrapper may be invoked, or an error returned
from
.Nm .
The following script is the safest way to detect if
.Nm
is installed and activated:
.Bd -literal -offset indent
  if TMPDIR=/dev/null ASSUME_ALWAYS_YES=1 \\
       PACKAGESITE=file:///nonexistent \\
       pkg info -x 'pkg(-devel)?$' >/dev/null 2>&1; then
    # pkgng-specifics
{'fraction_non_alphanumeric': 0.1533217290397447, 'fraction_numerical': 0.007107629823034523, 'mean_word_length': 2.3470873786407767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3330836', 'n_tokens_mistral': 2000, 'n_tokens_neox': 1846, 'n_words': 974}