Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/portupgrade
Path: blob/master/man/portsdb.1
102 views
.\"
.Dd June 13, 2006
.Dt PORTSDB 1
.Os FreeBSD
.Sh NAME
.Nm portsdb ,
.Nm ports_glob
.Nd tools to manage and look up the ports database file
.Sh SYNOPSIS
.Nm
.Op Fl hfFquU
.Nm ports_glob
.Op Fl hMrR
.Op Fl x Ar pkgname_glob | portorigin_glob
.Op Ar pkgname_glob | portorigin_glob
.Ar ...
.Sh DESCRIPTION
The
.Nm
command is a tool to generates the ports database named
.Pa INDEX.db
from the ports index file named
.Pa INDEX .
It is commonly used among the tool suite and automatically updated on
demand when it gets older than the index file.
To save time, you can
update it beforehand, like right after the index file is updated.
Note that
.Pa INDEX
file is updated every few hours on official site,
it is recommended that you run
.Dq Nm portsdb Fl Fu
after every CVSup of the ports tree in order to keep them always
up-to-date and in sync with the ports tree.
.Pp
.Nm ports_glob
looks up the ports database to expand given patterns.
.Pp
Actually,
.Nm
and
.Nm ports_glob
share an entity and are totally equivalent.
.Pp
Before reading these instructions, you must understand that a
port/package can have the following two types of related
ports/packages:
.Bl -tag -width "dependent" -compact
.It required
Ports/packages that a port/package needs for it to be built and/or
run.
Port Makefiles refer to this type of ports/packages using the
.Dv BUILD_DEPENDS
and
.Dv RUN_DEPENDS
macros, respectively.
.It dependent
Ports/packages that need this port/package.
.El
.Sh OPTIONS
The following command line arguments are supported:
.Pp
.Bl -tag -width "--updateindex" -compact
.It Ar pkgname_glob
Specify one of these: a full pkgname, a pkgname without version, a
shell glob pattern in which you can use wildcards
.Sq * ,
.Sq \&? ,
and
.Sq [..]
(e.g.
.Dq Ar zsh ,
.Dq Ar gnome* ,
.Dq Ar bash-2* ,
etc.), or an extended regular expression preceded by a colon
.Sq \&: .
.Pp
.Nm ports_glob
lists ports which pkgnames match the pattern.
.Pp
.It Ar portorigin_glob
Specify a shell glob pattern. (e.g.
.Dq Ar archivers/p5-* ) ,
or an extended regular expression preceded by a colon
.Sq \&: .
.Pp
.Nm ports_glob
lists ports that match the pattern.
.Pp
Do not forget to include a slash if you want
.Nm ports_glob
to treat a pattern as a portorigin glob.
.Pp
.It Fl h
.It Fl -help
Show help and exit.
.Pp
.It Fl f
.It Fl -force
Force to update database regardless of timestamps.
.Pp
.It Fl F
.It Fl -fetchindex
Fetch the ports index file called
.Pa INDEX
from the official site.
.Pp
.It Fl M
.It Fl -master-recursive
List all master ports of the given ports as well.
It also lists the
master ports of all those required by the given ports if
.Fl R
is specified.
.Pp
.It Fl q
.It Fl -noconfig
Do not read the configuration file -
.Pa $PREFIX/etc/pkgtools.conf .
.Pp
.It Fl r
.It Fl -recursive
List all those ports depending on the given ports as well.
.Pp
.It Fl R
.It Fl -upward-recursive
List all those ports required by the given ports as well.
.Pp
.It Fl u
.It Fl -update
Update or create the ports database file
.Pa INDEX.db
from the ports index file.
It is in binary form and meant to be fast
to search for information.
.Pp
Note: the ports database file is automatically updated if it is not
up-to-date when looked up, so manual updating is not mandatory.
.Pp
.It Fl U
.It Fl -updateindex
Update or create the
.Pa INDEX
file by running
.Dq Nm make index .
If you define special macros in
.Pa /etc/make.conf
and the dependency of some ports are changed, you should create
.Pa INDEX
by yourself by using this option.
Otherwise, using
.Fl F
option is recommended since it is much faster.
.Pp
.It Fl x Ar portorigin_glob
.It Fl -exclude Ar portorigin_glob
Exclude ports matching the specified glob pattern from the list.
.El
.Sh ENVIRONMENT
.Bl -tag -width "PKGTOOLS_CONF" -compact
.It Ev PORTSDIR
Alternative location for the ports tree.
Default is
.Dq Pa /usr/ports .
.Pp
.It Ev PORTS_INDEX
Alternative location for the ports INDEX file.
Default is
.Dq Pa $PORTSDIR/INDEX .
.Pp
It is recommendable that you set this variable to something other than
the default to avoid conflict with CVS, CVSup, or CTM.
.Pp
.It Ev PORTS_DBDIR
Alternative location for the ports database file.
The database file
will be located in the first writable directory in the following ones:
.Ev $PORTS_DBDIR ,
.Ev $PORTSDIR ,
.Pa /usr/ports ,
.Ev $PKG_DBDIR ,
.Pa /var/db/pkg ,
.Ev $TMPDIR ,
.Pa /var/tmp ,
and
.Pa /tmp .
.Pp
.It Ev PKGTOOLS_CONF
Configuration file for the pkgtools suite.
Default is
.Dq Pa $PREFIX/etc/pkgtools.conf .
.El
.Sh FILES
.Bl -tag -width "$PREFIX/etc/pkgtools.conf" -compact
.It Pa /var/db/pkg
Default location of the installed package database.
.Pp
.It Pa /usr/ports
Default location of the ports tree.
.Pp
.It Pa INDEX
Ports index file, located right under the ports tree.
.Pp
.It Pa INDEX.db
Ports database file, located in
.Pa $PORTS_DBDIR .
.Pp
.It Pa $PREFIX/etc/pkgtools.conf
Default location of the pkgtools configuration file.
.El
.Sh SEE ALSO
.Xr pkgdb 1 ,
.Xr portversion 1 ,
.Xr pkgtools.conf 5 ,
.Xr ports 7
.Sh AUTHORS
.An Akinori MUSHA Aq [email protected]
.Sh BUGS
.Fl S / Fl -slave-recursive
is not implemented yet.
.Pp
.Fl M
is very slow due to the limitation of
.Xr make 1
and
.Xr ports 7 .