diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-23 21:42:17 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-23 21:42:17 +0200 |
| commit | d8c0ca6ff164f79910b315c9525fa77417084edf (patch) | |
| tree | 68fb49f5b69c3c3c2163a9f8049496774375a45a /doc/source/apt_inst.rst | |
| parent | 22d8199e2d047dc6b258241cf33e67d77aa33ca6 (diff) | |
| download | python-apt-d8c0ca6ff164f79910b315c9525fa77417084edf.tar.gz | |
doc/source: Big documentation reorganisation.
Due to the new C++ API and because I wanted to include some tutorials,
the documentation is now seperated into 4 sections:
library => Documentation of modules.
tutorials => Tutorials for using python-apt and contributing
whatsnew => Release notes
c++ => Documentation,Tutorials for the C++ API
This commit also includes a new overview page, like the Python
documentation.
Diffstat (limited to 'doc/source/apt_inst.rst')
| -rw-r--r-- | doc/source/apt_inst.rst | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/doc/source/apt_inst.rst b/doc/source/apt_inst.rst deleted file mode 100644 index cd371e36..00000000 --- a/doc/source/apt_inst.rst +++ /dev/null @@ -1,122 +0,0 @@ -:mod:`apt_inst` - Working with local Debian packages -==================================================== -.. module:: apt_inst - -The :mod:`apt_inst` extension provides access to functions for working with -locally available Debian packages (.deb files) and tar files. - - -Checking packages ------------------- -.. function:: arCheckMember(file, membername) - - Check if the member specified by the parameter *membername* exists in - the AR file referenced by the parameter *file*, which may be a - :class:`file()` object, a file descriptor, or anything implementing a - :meth:`fileno` method. - - .. versionchanged:: 0.8.0 - Added support for file descriptors and objects implementing a :meth:`fileno` method. - - -Listing contents ------------------ -.. function:: debExtract(file, func, chunk) - - Call the function referenced by *func* for each member of the tar file - *chunk* which is contained in the AR file referenced by the parameter - *file*, which may be a :class:`file()` object, a file descriptor, or - anything implementing a :meth:`fileno` method. - - An example would be:: - - debExtract(open("package.deb"), my_callback, "data.tar.gz") - - See :ref:`emulating-dpkg-contents` for a more detailed example. - - .. versionchanged:: 0.8.0 - Added support for file descriptors and objects implementing a :meth:`fileno` method. - -.. function:: tarExtract(file,func,comp) - - Call the function *func* for each member of the tar file *file*. - - The parameter *comp* is a string determining the compressor used. Possible - options are "lzma", "bzip2" and "gzip". - - The parameter *file* may be a :class:`file()` object, a file descriptor, or - anything implementing a :meth:`fileno` method. - - .. versionchanged:: 0.8.0 - Added support for file descriptors and objects implementing a :meth:`fileno` method. - - -Callback -^^^^^^^^^ -Both of these functions expect a callback with the signature -``(what, name, link, mode, uid, gid, size, mtime, major, minor)``. - -The parameter *what* describes the type of the member. It can be 'FILE', -'DIR', or 'HARDLINK'. - -The parameter *name* refers to the name of the member. In case of links, -*link* refers to the target of the link. - - -Extracting contents -------------------- - -.. function:: debExtractArchive(file, rootdir) - - Extract the archive referenced by the :class:`file` object *file* - into the directory specified by *rootdir*. - - The parameter *file* may be a :class:`file()` object, a file descriptor, or - anything implementing a :meth:`fileno` method. - - See :ref:`emulating-dpkg-extract` for an example. - - .. warning:: - - If the directory given by *rootdir* does not exist, the package is - extracted into the current directory. - - .. versionchanged:: 0.8.0 - Added support for file descriptors and objects implementing a :meth:`fileno` method. - -.. function:: debExtractControl(file[, member='control']) - - Return the indicated file as a string from the control tar. The default - is 'control'. - - The parameter *file* may be a :class:`file()` object, a file descriptor, or - anything implementing a :meth:`fileno` method. - - If you want to print the control file of a given package, you could do - something like:: - - print debExtractControl(open("package.deb")) - - .. versionchanged:: 0.8.0 - Added support for file descriptors and objects implementing a :meth:`fileno` method. - - -.. _emulating-dpkg-extract: - -Example: Emulating :program:`dpkg` :option:`--extract` -------------------------------------------------------- -Here is a code snippet which emulates dpkg -x. It can be run as -:program:`tool` :option:`pkg.deb` :option:`outdir`. - -.. literalinclude:: examples/dpkg-extract.py - - -.. _emulating-dpkg-contents: - -Example: Emulating :program:`dpkg` :option:`--contents` -------------------------------------------------------- -.. literalinclude:: examples/dpkg-contents.py - -Example: Emulating :program:`dpkg` :option:`--info` ----------------------------------------------------- -.. literalinclude:: examples/dpkg-info.py |
