Differences between revisions 14 and 15
Revision 14 as of 2010-02-20 22:14:52
Size: 2545
Comment: more stuff to do
Revision 15 as of 2010-02-20 22:53:41
Size: 2550
Comment:
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
 * Dpkg::Control::Info: use overload to provide a string representation, and an array representation of the contained entries.  * (./) Dpkg::Control::Info: use overload to provide a string representation, and an array representation of the contained entries.

This page summarizes changes that we want to make to the perl API before freezing it and making it available through libdpkg-perl.

API extensions

  • Dpkg::Package: representation of a binary package
    • can be used to retrieve information about it
    • can be used to create package (for automatic test purpose mainly)
  • (./) Generic Dpkg::Index representing a set of Dpkg::Control objects.

  • Dpkg::Index::{Packages,Sources,Status}: index files like APT's Packages/Sources or dpkg's internal database
  • Dpkg::Conf: parsing dpkg configuration files (to be reused for dpkg-buildpackage)
  • Dpkg::Changelog: add functions to be able to modify the changelog, or to construct a new one from scratch

API changes

  • (./) In all modules, harmonize some method names and factorize in some common interface:

    • parse, load, read, etc. → parse($fh) + load($file)
    • store, output, save, as_string, dump, etc. → output([$fh]) + save($file) + "$obj" (on top of output())
  • (./) Dpkg::Control::Info: use overload to provide a string representation, and an array representation of the contained entries.

  • (./) Dpkg::Deps: use overload to provide a string representation with dump()

  • (./) Dpkg::Source::CompressedFile → Dpkg::Compression::?FileHandle

    • (./) make it behave more like a real filehandle that can be read or written to

    • (./) cleanup_after_open → cleanup.

  • (./) Dpkg::Source::Compressor → Dpkg::Compression::Process

  • (./) Dpkg::Compression: add compression_* accessor functions instead of letting direct access to variables

  • (./) Dpkg::Changelog:

    • (./) use overload to be able to print its string representation

    • (./) use overload to be able to access individual Dpkg::Changelog::Entry with direct array-like operations

  • (./) Dpkg::Changelog::Entry:

    • use overload to be able to print its string representation
    • extend API to cover more stuff like changes_made_by("someone") (by parsing lines like "[ Raphaël Hertzog ]")
  • (./) Dpkg/Cdata.pm + Dpkg::Fields::Object → Dpkg/Control.pm

  • (./) Dpkg/Control.pm → Dpkg/Control/Info.pm

  • (./) Dpkg::Version: provide an object oriented interface and use overload to be able to compare version object with the standard operators.

  • Dpkg::Checksums, rename functions with a "checksums_" prefix and provide accessors functions to global variables
  • Dpkg::?BuildOptions: switch to an object-oriented interface

  • Dpkg::Conf: add get_options(), output() functions and use Dpkg::Interface::Storable