<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">

<!-- Manual page for apt-listchanges, DocBook source file
     (C) 2000 Matt Zimmerman <mdz@debian.org>
     (C) 2016-2017 Robert Luberda <robert@debian.org>

     Based on the example page docbook-to-man.sgml from docbook-to-man
-->

<refentry>
  <refentryinfo>
    <productname>apt-listchanges</productname>
    <address><email>mdz@debian.org</email></address>
    <author>
      <firstname>Matt</firstname>
      <surname>Zimmerman</surname>
      <contrib/>
    </author>
    <date>2017-07-08</date>
  </refentryinfo>
  <refmeta>
    <refentrytitle>apt-listchanges</refentrytitle>
    <manvolnum>1</manvolnum>
    <refmiscinfo class="manual">Debian</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>apt-listchanges</refname>
    <refpurpose>Show new changelog entries from Debian package archives</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>apt-listchanges</command>
      <group choice="opt">
        <arg rep="repeat"><replaceable>options</replaceable></arg>
      </group>

      <group choice="req">
        <arg><option>--apt</option></arg>
        <arg rep="repeat"><replaceable>package.deb</replaceable></arg>
      </group>

    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>

    <para><command>apt-listchanges</command> is a tool to show what
      has been changed in a new version of a Debian package, as
      compared to the version currently installed on the
      system.</para>

    <para>It does this by extracting the relevant entries from both the
      NEWS.Debian and changelog<optional>.Debian</optional> files, usually found in
      <filename>/usr/share/doc/</filename><replaceable>package</replaceable>,
      from Debian package archives.
    </para>

    <para>Please note that in the default installation
      if <command>apt-listchanges</command> is run during upgrades as an APT
      plugin, it displays NEWS.Debian entries only. This can be changed with
      the <option>--which</option> option.
    </para>

    <para>If changelog entries are displayed and the
       <replaceable>package</replaceable> does not contain
       changelog<optional>.Debian</optional> file, <command>apt-listchanges</command>
       calls <command>apt-get changelog</command> command to download the changelog
       from network. This behavior can be disabled with the <option>--no-network</option>
       option.
    </para>

    <para>
       Given a set of filenames as arguments (or read from apt when
       using <option>--apt</option>),
       <command>apt-listchanges</command> will scan the files (assumed
       to be Debian package archives) for the relevant changelog
       entries, and display them all in a summary grouped by source package.
       The groups are sorted by the urgency of the most urgent change,
       and than by the package name.  Changes within each package group are
       displayed in the order of their appearance in the changelog files,
       i.e. starting from the latest to the oldest; the
       <option>--reverse</option> option can be used to alter this order.
    </para>

  </refsect1>

  <refsect1>
    <title>OPTIONS</title>
    <para>
      <command>apt-listchanges</command> provides the following options
       to control its behavior. Most of them have their equivalent entries
       in the configuration file, see the "CONFIGURATION FILE" below for
       details.
    </para>

    <variablelist>
      <varlistentry>
        <term><option>--apt</option></term>
        <listitem>
          <para>Read filenames from a specially-formatted pipeline (as
            provided by apt), rather than from command line arguments,
            and honor certain apt-specific options in the config
            file.  This pipeline must be in "version 2" format,
            specified in the apt configuration.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>-v, --verbose</option></term>
        <listitem>
          <para>Display additional (usually unwanted) information.
            For instance, print a message when a package of the same
            or older version is to be installed, or when a package is
            to be newly installed.
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>-f, --frontend</option></term>
        <listitem>
          <para>
            Select which frontend to use to display information to the
            user.  Current frontends include:
          </para>
          <variablelist>
            <varlistentry>
              <term>pager</term>
              <listitem>
                <para>
                  Uses <citerefentry><refentrytitle>sensible-pager</refentrytitle>
                  <manvolnum>1</manvolnum></citerefentry> command to
                  display output.  The command uses PAGER environment
                  variable to choose your favourite pager.  The "pager" option
                  may be specified in the configuration file to select a specific pager for
                  use with apt-listchanges.
                </para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term>browser</term>
              <listitem>
                <para>
                  Displays an HTML-formatted changelog with hyperlinks for bugs
                  and email addresses using the <citerefentry>
                  <refentrytitle>sensible-browser</refentrytitle><manvolnum>1</manvolnum>
                  </citerefentry> command that examines BROWSER environment variable
                  to choose your favourite browser.  The "browser" option may be
                  specified in the configuration file to select a specific browser for
                  use with apt-listchanges.
                </para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term>xterm-pager</term>
              <listitem>
                <para>
                  Uses your favorite pager to display output, but does
                  so in an xterm (using the x-terminal-emulator
                  alternative) in the background.  This allows you
                  to go on with the upgrade if you like, and continue
                  to browse the changelogs.  You can override the
                  terminal emulator to be used with the "xterm"
                  configuration option.
                </para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term>xterm-browser</term>
              <listitem>
                <para>
                  The logical combination of xterm-pager and browser.
                  Only appropriate for text-mode browsers.
                </para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term>text</term>
              <listitem>
                <para>
                  Dumps output to stdout, with no pauses.
                </para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term>mail</term>
              <listitem>
                <para>
                  Sends mail to the address specified with
                  --email-address, and does not display changelogs.
                </para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term>gtk</term>
              <listitem>
                <para>
                  Spawns a gtk window to display the changelogs. Needs
                  python3-gi to be installed.
                </para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term>none</term>
              <listitem>
                <para>
                  Does nothing.  Can be used to prevent
                  apt-listchanges from running when configured to run
                  automatically from apt.
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
          <para>
           Please note that apt-listchanges will try to switch to an unprivileged
           user before spawning commands in "browser", "xterm-browser",
           and "xterm-pager" frontends.  However this currently does not apply
           to the "pager" frontend.  See also "ENVIRONMENT VARIABLES" below.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--email-address=<replaceable>address</replaceable></option></term>
        <listitem>
          <para>
            In addition to displaying it, mail a copy of the changelog
            data to the specified address.  To only mail changelog
            entries, use this option with the special frontend 'mail'.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--email-format={text|html}</option></term>
        <listitem>
          <para>
            If sending mail copies is enabled (see <option>--email-address</option> above),
            this option selects whether the mail should be sent
            as an old good plain text data (which is the default behavior),
            or as html data with clickable links, which might be more
            convenient for people using graphical mail clients.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-c, --confirm</option></term>
        <listitem>
          <para>
            Once changelogs have been displayed, ask the user whether
            or not to proceed.  If the user chooses not to proceed, a
            nonzero exit status will be returned, and apt will abort.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-a, --show-all</option></term>
        <listitem>
          <para>
            Rather than trying to display changelog entries that are
            newer than the currently installed version of the package,
            simply display all changelog entries for all packages.
            This is useful for viewing the entire changelog of a .deb
            before extracting it.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-n, --no-network</option></term>
        <listitem>
          <para>
            In rare cases when a binary package (or to be more precise: none
            of the binary packages built from the same source package that
            are processed together as a group) does not contain a changelog file,
            <command>apt-listchanges</command> by default executes
            <command>apt-get changelog</command> to downolad changelogs
            from the network servers usually provided by your operating system
            distribution.  This option will disable this behavior, what might
            be useful for example for systems behind a firewall.
          </para>
        </listitem>
      </varlistentry>


      <varlistentry>
        <term><option>--save-seen=<replaceable>file</replaceable></option></term>
        <listitem>
          <para>
            This option will cause apt-listchanges to keep track of
            the last version of a package for which changelogs have
            been displayed, to avoid redisplaying the same changelogs
            in a future invocation.  The database is stored in the
            named file.  Specify 'none' to disable this feature.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--dump-seen</option></term>
        <listitem>
          <para>
            Display the contents of the seen database to standard output
            as a list of lines consisting of source package name and its
            latest seen version, separated by space.  This option requires
            the path to the seen database to be known: please either specify
            it using <option>--save-seen</option> option or pass
            <option>--profile=apt</option> option to have it read from the
            configuration file.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--since=<replaceable>version</replaceable></option></term>
        <listitem>
          <para>
            This option will cause apt-listchanges to show the entries later
            than the specified version. With this option, the only other
            argument you can pass is the path to a .deb file.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--which={news|changelogs|both}</option></term>
        <listitem>
          <para>
            This option selects whether news (from NEWS.Debian et
            al.), changelogs (from changelog.Debian et al.) or both
            should be displayed.  The default is to display only news.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--help</option></term>
        <listitem>
          <para>
            Displays syntax information.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-h, --headers</option></term>
        <listitem>
          <para>
            These options will cause apt-listchanges to insert a
            header before each package's changelog showing the name of
            the package, and the names of the binary packages which
            are being upgraded (if there is more than one, or it
            differs from the source package name).
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--debug</option></term>
        <listitem>
          <para>Display some debugging information.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--profile=<replaceable>name</replaceable></option></term>
        <listitem>
          <para>Select an option profile.
          <replaceable>name</replaceable> corresponds to a section in
          <filename>/etc/apt/listchanges.conf</filename>.  The default
          when invoked from apt is "apt", and "cmdline" otherwise.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--reverse</option></term>
        <listitem>
          <para>
            Show the changelog entries in reverse order.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--ignore-apt-assume</option>, <option>--ignore-debian-frontend</option></term>
        <listitem>
          <para>
            Disable forcing non-interactive frontend in some of the cases described in the
            "AUTOMATIC FRONTEND OVERRIDE" section below.
          </para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--select-frontend</option></term>
        <listitem>
          <para>
            Choose frontend interactively.  This option is mainly for testing purposes,
            please do not use it.
          </para>
        </listitem>
      </varlistentry>

    </variablelist>

  </refsect1>

  <refsect1>
    <title>AUTOMATIC FRONTEND OVERRIDE</title>
        <para>
            For a better integration with existing package management tools,
            <command>apt-listchanges</command> tries to detect if package upgrades
            are done in a non-interactive way, and automatically switches its frontend
            to 'text' when <emphasis>any</emphasis> of the following conditions is satisfied:
            <itemizedlist mark="opencircle">
                <listitem>
                    <para>the standard output is not connected to terminal;</para>
                </listitem>
                <listitem>
                    <para>the <option>--quiet</option> (<option>-q</option>) option is given
                       to <citerefentry><refentrytitle>apt-get</refentrytitle><manvolnum>8</manvolnum>
                       </citerefentry> (or <citerefentry><refentrytitle>aptitude</refentrytitle>
                       <manvolnum>8</manvolnum></citerefentry>); note however that when the option
                       is used more than once, apt-listchanges switches the frontend to 'mail';</para>
                </listitem>
                <listitem>
                    <para>the <option>--assume-yes</option> (<option>-y</option>) option is given
                       to <citerefentry><refentrytitle>apt-get</refentrytitle>
                       <manvolnum>8</manvolnum></citerefentry>;</para>
                </listitem>
                <listitem>
                    <para>the <envar>DEBIAN_FRONTEND</envar> environment variable is set to
                      "noninteractive", and <envar>APT_LISTCHANGES_FRONTED</envar> is not set.</para>
                </listitem>
            </itemizedlist>
        </para>
        <para>
            For backward compatibility purposes the last two of the above checks can be disabled
            either with "ignore_apt_assume=true" or "ignore_debian_frontend=true" configuration file
            entries (see "CONFIGURATION FILE" below) or by using the command line
            options: <option>--ignore-apt-assume</option> or <option>--ignore-debian-frontend</option>.
        </para>
        <para>
            Please also note that the "mail" frontend is already non-interactive one, so it is never
            switched to the "text" frontend.
        </para>
        <para>
            Additionally <command>apt-listchanges</command> overrides X11-based frontends
            ("gtk", "xterm-pager", "xterm-browser") with "pager" (or "browser" in case
            of "xterm-browser") when the environment variable <envar>DISPLAY</envar>
            is not set.
        </para>
  </refsect1>

  <refsect1>
    <title>CONFIGURATION FILE</title>
        <para>
          <command>apt-listchanges</command> reads its configuration from the
          <filename>/etc/apt/listchanges.conf</filename>.  The file consists of
          <replaceable>sections</replaceable> with names enclosed in the square
          brackets.  Each section should contain lines in the
          <replaceable>key</replaceable>=<replaceable>value</replaceable> format.
          Lines starting with the "#" sign are treated as comments and ignored.
        </para>
        <para>
          <replaceable>Section</replaceable> is a name of profile that can be
          used as parameter of the <option>--profile</option> option.
        </para>
        <para>
          The configuration of the "apt" section can be managed by
          <citerefentry><refentrytitle>debconf</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
          and the most of the settings there can be changed with the help of the
          <command>dpkg-reconfigure apt-listchanges</command> command.
        </para>
        <para>
          <replaceable>Key</replaceable> is a name of some command-line option
          (except for <option>--apt</option>, <option>--profile</option>,
          <option>--help</option>) with the initial hyphens removed, and the
          remaining hyphens translated to underscores, for example: "email_format"
          or "save_seen".
        </para>
        <para>
          <replaceable>Value</replaceable> represents the value of the corresponding
           option.  For command-line options that do not take argument, like "confirm"
           or "header", the <replaceable>value</replaceable> should be set either to
           "1", "yes", "true", and "on" in order to enable the option, or to  "0",
           "no", "false", and "off" to disable it.
        </para>
        <para>
           Additionally <replaceable>key</replaceable> can be one of the following
           keywords: "browser", "pager" or "xterm".  The <replaceable>value</replaceable>
           of such configuration entry should be the name of an appropriate command,
           eventually followed by its arguments, for example: "pager=less -R".
        </para>

        <example>
          <title>Example configuration file</title>
<programlisting>
[cmdline]
frontend=pager

[apt]
frontend=xterm-pager
email_address=root
confirm=1

[custom]
frontend=browser
browser=mozilla
</programlisting>
        </example>

        <para>The above configuration file specifies that in
        command-line mode, the default frontend should be "pager".
        In apt mode, the xterm-pager frontend is default, a copy
        of the changelogs (if any) should be emailed to root, and
        apt-listchanges should ask for confirmation.  If
        apt-listchanges is invoked with --profile=custom, the
        browser frontend will be used, and invoke mozilla.</para>
  </refsect1>

  <refsect1>
    <title>ENVIRONMENT</title>

    <variablelist>
      <varlistentry>
        <term>APT_LISTCHANGES_FRONTEND</term>
        <listitem><para>Frontend to use.</para></listitem>
      </varlistentry>
    </variablelist>

    <variablelist>
      <varlistentry>
        <term>APT_LISTCHANGES_USER, SUDO_USER, USERNAME</term>
        <listitem><para>The value of the first existing of the above variables
            will be used as the name of user to switch to when running
            commands spawned by the "browser", "xterm-browser",
            and "xterm-pager" frontends if <command>apt-listchanges</command> is
            started by a privileged user.</para></listitem>
      </varlistentry>
    </variablelist>

    <variablelist>
      <varlistentry>
        <term>DEBIAN_FRONTEND</term>
        <listitem><para>If set to "noninteractive", then it can force
            <command>apt-listchanges</command> to use non-interactive frontend,
            see the "AUTOMATIC FRONTEND OVERRIDE" section for details.</para>
        </listitem>
      </varlistentry>
    </variablelist>

    <variablelist>
      <varlistentry>
        <term>BROWSER</term>
        <listitem><para>Used by
            the browser frontend, should be set to a command expecting a
            file: URL for an HTML file to display.</para>
        </listitem>
      </varlistentry>
    </variablelist>

    <variablelist>
      <varlistentry>
        <term>PAGER</term>
        <listitem><para>Used by the pager frontend.</para></listitem>
      </varlistentry>
    </variablelist>

    <variablelist>
      <varlistentry>
        <term>APT_HOOK_INFO_FD</term>
        <listitem><para>File descriptor to read package names from in
            the <option>--apt</option> mode.  (Apt is expected to set
            this variable to a proper file descriptor number).</para></listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>FILES</title>

    <variablelist>
      <varlistentry>
        <term>/etc/apt/listchanges.conf</term>
        <listitem><para>Configuration file.</para></listitem>
      </varlistentry>

      <varlistentry>
        <term>/etc/apt/apt.conf.d/20listchanges</term>
        <listitem><para>File used for registering apt-listchanges into apt system.</para></listitem>
      </varlistentry>

      <varlistentry>
        <term>/var/lib/apt/listchanges.db</term>
        <listitem><para>Database used for save-seen.</para></listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>AUTHOR</title>

    <para>
      apt-listchanges was written by Matt Zimmerman
      &lt;mdz@debian.org&gt;
    </para>
    <para>
      The current maintainer is Robert Luberda
      &lt;robert@debian.org&gt;
    </para>
  </refsect1>

  <refsect1>
    <title>SEE ALSO</title>

    <para>
      <citerefentry><refentrytitle>sensible-pager</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>sensible-browser</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>apt-get</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
      <citerefentry><refentrytitle>aptitude</refentrytitle><manvolnum>8</manvolnum></citerefentry>
    </para>
  </refsect1>
</refentry>
<!-- vim:set fileencoding=utf-8 et ts=2 sts=2 sw=2: -->
