224 lines
6.0 KiB
HTML
224 lines
6.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SORT-DCTRL</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SORT-DCTRL</H1>
|
|
Section: Debian user's manual (1)<BR>Updated: 2005-06-08<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
sort-dctrl - sort Debian control files
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>sort-dctrl</B>
|
|
|
|
[options]
|
|
[
|
|
<I>file</I> ...
|
|
|
|
]
|
|
<P>
|
|
<B>sort-dctrl</B>
|
|
|
|
--copying | --help | --version | -ChV
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>sort-dctrl</B>
|
|
|
|
program sorts Debian control files according to specified criteria.
|
|
<P>
|
|
|
|
A Debian control (dctrl) file is a semistructured single-table
|
|
database stored in a machine-parseable text file.
|
|
Such a database
|
|
consists of a set of records; each record is a mapping from field
|
|
names to field content.
|
|
Textually, records are separated by empty
|
|
lines, while each field is encoded as one or more nonempty lines
|
|
inside a record.
|
|
A field starts with its name, followed by a colon,
|
|
followed by the field content.
|
|
The colon must reside on the first
|
|
line of the field, and the first line must start with no whitespace.
|
|
Subsequent lines, in contrast, always start with linear whitespace
|
|
(one or more space or tab characters).
|
|
<P>
|
|
|
|
The
|
|
<B>sort-dctrl</B>
|
|
|
|
program recognizes two field types: string fields and version fields.
|
|
Version fields act also as numeric fields. String fields are compared
|
|
according to strict lexicographical octet-by-octet comparison, after
|
|
ignoring any initial whitespace after the colon. Version fields are
|
|
parsed and compared as Debian version numbers. When comparing version
|
|
numbers, if a field content does not in fact conform to the version
|
|
number syntax, it compares less than any field content that does
|
|
conform, and equal to any other nonconforming field content. The
|
|
<B>sort-dctrl</B>
|
|
|
|
program assumes all fields are string fields unless told otherwise.
|
|
<P>
|
|
|
|
You can specify arbitrary number of keys for sorting, using the
|
|
<B>-k</B>
|
|
|
|
option. The keys are interpreted in a descending order of priority:
|
|
the first key specified is primary, the second key specified is
|
|
secondary, and so on. If two records compare equal under the primary
|
|
key, then they are compared under the secondary key, and so on. If no
|
|
keys are specified, a default key is assumed (the "Package" field with
|
|
no modifiers).
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-k </B><I>keyspec</I>, <B>--key-spec=</B><I>keyspec<DD>
|
|
Specify one or more keys for sorting. You may specify this option any
|
|
number of times. The
|
|
keyspec</I>
|
|
|
|
argument consists of a comma-separated
|
|
list of key specifications. Each key specification consists of the
|
|
name of the field that serves as the key, optionally followed by a
|
|
colon and key modifiers. The following key modifiers are supported:
|
|
<DL COMPACT><DT id="2"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3"><B>r</B>
|
|
|
|
<DD>
|
|
Invert the comparison for this key, reversing the sorting order.
|
|
<DT id="4"><B>v</B>
|
|
|
|
<DD>
|
|
Treat this field as a version number field.
|
|
<DT id="5"><B>n</B>
|
|
|
|
<DD>
|
|
Treat this field as numeric, which currently is synonymous with
|
|
<B>v</B>.
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="6"><B>-q</B>, <B>--quiet</B>, <B>--silent<DD>
|
|
Output nothing to the standard output stream. Instead, exit
|
|
immediately after finding the first match.
|
|
<DT id="7">-l </B><I>level</I>, <B>--errorlevel=</B><I>level<DD>
|
|
Set log level to
|
|
level</I>.
|
|
|
|
<I>level</I>
|
|
|
|
is one of
|
|
<B>fatal</B>, <B>important</B>, <B>informational</B> and <B>debug</B>,
|
|
|
|
but the last may not be available,
|
|
depending on the compile-time options. These categories are given
|
|
here in order; every message that is emitted when
|
|
<B>fatal</B>
|
|
|
|
is in effect, will be emitted in the
|
|
<B>important</B>
|
|
|
|
error level, and so on. The default is
|
|
<B>important</B>.
|
|
|
|
<DT id="8"><B>-V</B>, <B>--version<DD>
|
|
Print out version information.
|
|
<DT id="9">-C</B>, <B>--copying<DD>
|
|
Print out the copyright license. This produces much output; be sure
|
|
to redirect or pipe it somewhere (such as your favourite pager).
|
|
<DT id="10">-h</B>, <B>--help<DD>
|
|
Print out a help summary.
|
|
</DL>
|
|
</B><A NAME="lbAF"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
Here are some sample invocations of the program:
|
|
<DL COMPACT>
|
|
<DT id="11">sort-dctrl /var/lib/dpkg/available<DD>
|
|
Output the
|
|
<B>dpkg</B>
|
|
|
|
<I>available</I>
|
|
|
|
file sorted by the package name.
|
|
<DT id="12">sort-dctrl -k Version:v /var/lib/dpkg/available<DD>
|
|
Output the
|
|
<B>dpkg</B>
|
|
|
|
<I>available</I>
|
|
|
|
file sorted in ascending order of
|
|
version numbers.
|
|
<DT id="13">sort-dctrl -k Version:vr /var/lib/dpkg/available<DD>
|
|
Output the
|
|
<B>dpkg</B>
|
|
|
|
<I>available</I>
|
|
|
|
file sorted in descending order of
|
|
version numbers.
|
|
<DT id="14">sort-dctrl -k Package,Version:v /var/lib/dpkg/available<DD>
|
|
Output the
|
|
<B>dpkg</B>
|
|
|
|
<I>available</I>
|
|
|
|
file sorted primarily in ascending order of
|
|
package names and secondarily in descending order of version numbers.
|
|
<DT id="15">sort-dctrl -k Installed-Size:n,Size:nr /var/lib/dpkg/available<DD>
|
|
Output the
|
|
<B>dpkg</B>
|
|
|
|
<I>available</I>
|
|
|
|
file sorted primarily in ascending order of
|
|
installation sizes and secondarily in descending order of package
|
|
sizes.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
The program and this manual page were written by Antti-Juhani
|
|
Kaijanaho <<A HREF="mailto:ajk@debian.org">ajk@debian.org</A>>.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
Debian Policy Manual. Published as the Debian
|
|
package
|
|
<B>debian-policy</B>.
|
|
|
|
Also available in the Debian website.
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+grep-dctrl">grep-dctrl</A></B>(1)
|
|
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="16"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="17"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="18"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="19"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="20"><A HREF="#lbAF">EXAMPLES</A><DD>
|
|
<DT id="21"><A HREF="#lbAG">AUTHOR</A><DD>
|
|
<DT id="22"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:27 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|