Table of Contents
The Python Package Manager
pmgr - the high-level command-line
interface.
pmgr [options] package [ package... ] [env-variable]
pmgr
stands for Python Package Manager. It is inspired by Portage, the Gentoo
Linux package management system - both work with source distribution archives,
build them on the host system before they install them and keep track of
installed versions. The main difference is that Portage is far more complex
and is backed by a huge infrastructure.
pmgr works closely together with
Python’s Distribution Utilities distutils, which do most of the work, but
can also cope with packages that do not comply with that standard. For this
purpose there is a feature (borrowed from Portage) called pbuild scripts,
which define how to configure, build and install non-distutils packages.
Flawed distutils-packages can be processed this way, too. Similar to Portage’s
ebuild scripts a pbuild script is written in shell code which means that
there are (almost) no limitations.
pmgr has two optional command-line front-ends:
pmgr(1)
and pbuild(1)
The unexperienced user is better off using the pmgr(1)
front-end for installing packages. It is the more comfortable of both and
is supposed to do all necessary operations with a single invocation.
pbuild(1)
is more complicated to use and is intended more towards the developer. It
also comes in very handy when something goes wrong in the installation
process and you want to spot the cause. See the pbuild(1)
man page.
- source
package
- This can be the path to a source tarball, a zip-archive or a python
module, e.g. ~/downloads/Imaging-1.1.4.tar.gz.
- package name
- This is a package name
without a version number, e.g. imaging. pbuild(1)
will use the package in
the build directory with the highest version. pmgr(1)
will first scan the
source package search path (see --include) and look for a newer version than
in the build directory. If this is unsuccessful, it will use the most up-to-date
package in the build directory.
- fully-qualified package name
- This is a package
name and version separated by a dash, e.g. imaging-1.1.4. The way this selection
works is similar to the one above, except that it fails when the particular
version is not found.
- --version
- Show program’s version number and exit.
- -h, --help
- Show a help message and exit.
- --license
- Show program’s license and
exit.
- -v, --verbose
- Produce as much output as possible.
- -q, --quiet
- Suppress all debug output.
- --nc, --no-color
- Do not produce the nice colorful
output. This options has the additional effect that errors are written to
stderr instead of stdout.
- -w, --workdir directory
- Use this directory
for unpacking and building packages and storing package information. Furthermore
this is the base directory for all package-related information. It defaults
to ~/.pmgr.
- -b, --pbuilds directory
- Search pbuild scripts in this directory.
- --binaries directory
- Store binary packages (created with --buildpkg) in this
directory.
- -p, --python executable
- Use this python executable as the target
python installation.
- --pkgname name
- Explictly specify
the name of the package.
- --pkgver version
- Explicitly specify the version of
the package, which is useful when the version number cannot be auto-detected
or has an invalid format.
- --nosandbox
- Turn off
sandboxing. This option is on by default.
- --autoclean
- Clean up the build directory
after successful installation.
- -u, --update
- Always update the currently installed
instance of the package regardless of the up-to-dateness.
- -D, --define var=value
- Pass an environment variable to the pbuild script. You can use this option
repeatedly to pass several variables.
- -C, --unmerge
- Remove
the package from the system.
- --buildpkg
- Create a binary package during installation.
- --buildpkgonly
- Only create a binary package without installation.
- --usepkg
- Install
the package from a binary package if that can be found in the directory
specified with --binary.
- --usepkgonly
- Install the package from a binary package,
but terminate with an error if none can be found.
- -I, --include directory
- Add
this directory to the source packages search path.
- ~/.pmgr
- Base directory. This is the default directory for --workdir.
- ~/.pmgr/globalrc
- Global configuration file. All global options (that affect both pmgr and
pbuild) go in here.
- ~/.pmgr/pmgrrc
- pmgr specific configuration file.
- ~/.pmgr/pbuildrc
- pbuild specific configuration file.
At the moment sandboxing
is only available on Gentoo Linux systems. Running Portage and pmgr(1)
simultaneously
will likely result in errors because the sandbox is not designed to serve
multiple concurrent processes. You may turn off sandboxing using the --nosandbox
option.
pbuild(1)
, pbuild(5)
Probably many. If you encounter
one, please take the time and report it to the pmgr bug tracker. Just follow
the instructions on the webpage.
http://pmgr.sourceforge.net/
Lars
Gustaebel (gustaebel@users.sourceforge.net)
Table of Contents