This is the source for the app-installer-tool program.
******************************************************

The app-installer-tool is a non-GUI, command-line program that
performs the basic package management operations.  It can list
installed packages, output the description of individual packages,
install a new package, and remove installed packages.

When dpkg leaves a package in a not-completely-installed state, the
package will be removed.

Removing a package might fail.  Packages that could not be
removed are marked as 'broken' and should be presented to the user
accordingly.

app-installer-tool will be invoked via sudo and does no setuid stuff
etc on its own.  It uses dpkg to do the real thing and passes on
diagnostic output.

app-installer-tool does not hide the existence of the fake "maemo"
package.

app-installer-tool does not handle GnomeVFS URIs since that might mean
that a file needs to be copied to local storage more than once during
installation, since installing usually consists of two invocations of
app-installer-tool, one to get the description of the package and one
to actually install it.

Usage:

  - app-installer-tool list

  Lists all installed packages to stdout in this format:

    package<TAB>version<TAB>installed-size<TAB>status<NL>

  The 'status' is either 'ok' or 'broken'.  A 'broken' package might
  result from a failed uninstall attempt and is usually caused by a
  buggy package.

  Stderr contains diagnostic messages that should be displayed to the
  user when the exit code is non-zero.

  - app-installer-tool describe-file <file.deb>

  Outputs information about <file.deb> to stdout.  The first line of
  stdout contains the package name, the second line the version, the
  third line the size, the fourth line the dependencies, the fifth
  line the architecture and the rest of the lines contain the
  description.

  Exits zero when stdout contains a proper description.  Exits
  non-zero when some error occured.  Diagnostic output goes to stderr.

  - app-installer-tool describe-package <package>

  Outputs the description of the package <package> on stdout.

  Exits zero when stdout contains a proper description.
  Exits non-zero when the package is not installed or some other error
  occured.  Diagnostic output goes to stderr.

  - app-installer-tool install <file.deb>

  Installs the package contained in <file.deb> and exits zero when
  this succeeded, non-zero otherwise.  Diagnostic output is displayed
  on stderr.  A status report is output on stdout.

  For each unsatisfied dependency, a line of the form

    depends <dependency>

  will appear on stdout.  Here, <dependency> is one entry from the
  Depends field of the package.  It can be something simple like
  "foo", it can include version number requirements like "foo (>=
  2.3)" or be more complex like "libc6 (>= 2.2.1), exim |
  mail-transport-agent".  However, application packages are advised
  not to have complicated dependencies.

  For each conflict, a line of the form

    conflicts <conflict>

  will appear on stdout.  Here, <conflict> is one entry from the
  Conflicts field of the package, with the same syntax as <dependency>
  above.

  When it looks like as if the installation failed due to unsufficient
  space in the filesystem, a line of the form

    full

  will appear on stdout.

  When some unexpexted error happens, a line of the form

    failed

  will appear on stdout (and stderr should then be displayed to the
  user).

  
  - app-installer-tool remove <package>

  Removes <package> and exits zero when this succeeded, non-zero
  otherwise.  Diagnostic output is displayed on stderr.  Nothing
  appears on stdout.


  - app-installer-tool get-dependencies <package>

  For each unsatisfied dependency that would be caused by a removal of
  <package>, a line of the form

    depended <package>

  appears on stdout.  Here, <package> is the name of the package that
  depends on the one to be removed.


  - app-installer-tool copy <remote-uri> <local>

  Copies <remote-uri> to <local> using gnome-vfs.  Progress is
  indicated on stdout with lines containing the fraction of completed
  work (floating point from 0 to 1).

  When the copy is successful, it exits zero.  When there has been
  some error, stderr contains a description and the exit code is
  non-zero.

  (This operation does not really fit into app-installer-tool, but it
  is a convenient place to put it.  We can not use gnome_vfs_sync_xfer
  in the GUI program itself, for example, since it appearantly doesn't
  report errors.)
