Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/pkg
Path: blob/main/docs/pkg-register.8
2645 views
.\"
.\" 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
.\"
.Dd March 22, 2023
.Dt PKG-REGISTER 8
.Os
.Sh NAME
.Nm "pkg register"
.Nd register a package into the local package database
.Sh SYNOPSIS
.Nm
.Op Fl dltN
.Op Fl f Ar plist-file
.Fl m Ar metadatadir
.Fl i Ar input-path
.Nm
.Op Fl dltN
.Fl M Ar metadatafile
.Pp
.Nm
.Op Cm --{debug,test,no-registration}
.Op Cm --relocate Ar location
.Op Cm --plist Ar plist-file
.Cm --metadata Ar metadatadir
.Cm --root Ar input-path
.Nm
.Op Cm --{debug,test,no-registration}
.Op Cm --relocate Ar location
.Cm --manifest Ar metadatafile
.Sh DESCRIPTION
.Nm
is used for registering a package into the local package database.
.Pp
.Nm
assembles a full set of package metadata from various possible inputs,
and writes the metadata into the package registry database.
This is one of the final steps when installing software from ports:
the package files are installed into the filesystem, and then
.Nm
is called to record what was installed into the package database.
.Pp
.Nm
can derive package metadata from a number of different sources:
.Bl -bullet
.It
The package manifest
.It
The metadata directory
.It
Direct analysis of files installed by the package
.El
.Pp
The package manifest is a
.Cm UCL
format listing of package metadata.
It can contain all of the necessary metadata needed by the package,
but the more usual approach is to provide selected items via the
manifest, and fill in the rest, either from legacy files such as
.Fa pkg-plist ,
.Fa +DESC ,
.Fa +DISPLAY
or
.Fa +MESSAGE
which are optional and mostly located in the
.Ar metadatadir
given as the argument to the
.Fl m
option.
.Pp
Other information about shared library requirements and the packages
necessary to provide them may be obtained by direct analysis of the
files installed by the package.
File checksums may be left blank in the input metadata:
all checksums will be recalculated from the installed or staged files
overwriting the input.
This is the mechanism currently used when installing software directly
from the ports tree, as it provides reasonable backwards compatibility
with the old style
.Xr pkg_add 1
command.
.Pp
Reading in a complete and comprehensive manifest from one file is a
simpler alternative, but requires all the metadata to have been
assembled beforehand.
.Pp
Direct analysis of the installed files can be suppressed by use of
the
.Fl t
option.
This is intended for testing the functionality of
.Xr pkg 8
itself, and should not be routinely used.
.Sh OPTIONS
The following options are supported by
.Nm :
.Bl -tag -width metadata
.It Fl A , Cm --automatic
Mark the package to be automatically removed if no other packages
depend on it.
For more information please refer to
.Xr pkg-autoremove 8 .
.It Fl d , Cm --debug
Enable debugging output.
.It Fl N , Cm --no-registration
Disable registration in the package database, the files will be installed,
the scripts will be executed.
.It Fl f Ar plist-file , Cm --plist Ar plist-file
Specifies a
.Fa pkg-plist
style packing list file.
.It Fl i Ar input-path , Cm --root Ar input-path
Specifies the package input path or staging directory.
.It  Fl M Ar manifest , Cm --manifest Ar manifest
Specifies the package manifest file.
Use of this option means that the only file which will be used as a
source of package metadata is the named
.Ar manifest
file.
The
.Fl M
option is mutually exclusive with
.Fl m .
.It  Fl m Ar metadatadir , Cm --metadata Ar metadatadir
Specifies the metadata directory to use when registering the package.
This directory will hold the package manifest, and optionally may contain
a number of other old-style metadata input files.
The
.Fl m
option is mutually exclusive with
.Fl M .
.It  Fl t , Cm --test
Enable testing mode.
This allows
.Nm
to update the package database without performing any of the usual
analyses of files installed by the package.
This option should only be used with caution, and preferably only
for the intended purpose of performing regression tests on
.Xr pkg 8
itself.
.It Cm --relocate Ar location
Annotates the package as having been relocated to
.Pa location ,
which is an alternate system root.
This is an experimental feature and intended for cross-architecture
package management.
There is no corresponding single letter option.
.Pq DEPRECATED
.El
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm .
See
.Xr pkg.conf 5
for further description.
.Bl -tag -width ".Ev NO_DESCRIPTIONS"
.It Ev PKG_DBDIR
.El
.Sh FILES
See
.Xr pkg.conf 5 .
.Sh SEE ALSO
.Xr pkg_create 3 ,
.Xr pkg_printf 3 ,
.Xr pkg_repo_create 3 ,
.Xr pkg_repos 3 ,
.Xr pkg-keywords 5 ,
.Xr pkg-lua-script 5 ,
.Xr pkg-repository 5 ,
.Xr pkg-script 5 ,
.Xr pkg-triggers 5 ,
.Xr pkg.conf 5 ,
.Xr pkg 8 ,
.Xr pkg-add 8 ,
.Xr pkg-alias 8 ,
.Xr pkg-annotate 8 ,
.Xr pkg-audit 8 ,
.Xr pkg-autoremove 8 ,
.Xr pkg-check 8 ,
.Xr pkg-clean 8 ,
.Xr pkg-config 8 ,
.Xr pkg-create 8 ,
.Xr pkg-delete 8 ,
.Xr pkg-fetch 8 ,
.Xr pkg-info 8 ,
.Xr pkg-install 8 ,
.Xr pkg-key 8 ,
.Xr pkg-lock 8 ,
.Xr pkg-query 8 ,
.Xr pkg-repo 8 ,
.Xr pkg-repositories 8 ,
.Xr pkg-rquery 8 ,
.Xr pkg-search 8 ,
.Xr pkg-set 8 ,
.Xr pkg-shell 8 ,
.Xr pkg-shlib 8 ,
.Xr pkg-ssh 8 ,
.Xr pkg-stats 8 ,
.Xr pkg-triggers 8 ,
.Xr pkg-update 8 ,
.Xr pkg-updating 8 ,
.Xr pkg-upgrade 8 ,
.Xr pkg-version 8 ,
.Xr pkg-which 8