sourCEntral - mobile manpages

pdf

Fedora::Rebuild::Providers

NAME

Fedora::Rebuild::Providers − Reverse cache for RPM provides

SYNOPSIS

    # Prepare a package
    use threads::shared;
    use Fedora::Rebuild::Package;
    my $package = Fedora::Rebuild::Package−>new(...);
    $package−>provides(shared_clone(...));
    # Create a cache
    use Fedora::Rebuild::Providers;
    my $providers = Fedora::Rebuild::Providers−>new();
    # Insert the package into the cache
    $providers−>insert($package);
    # Query the cache for package providing 'x' of any version
    use Fedora::Rebuild::RPM;
    my @found = $providers−>what_provides(
        'x', Fedora::Rebuild::RPM::ANY, ''
    );

DESCRIPTION

This is reverse cache for RPM package provides. You can instert many packages with populated provides and then you can ask which packages provide given RPM symbol.

Objects of this class are not threads-shared.

Constructor

new
There are no constructor arguments. New object has empty providers.

Read only accessors

providers
This is a mapping from RPM provides to binary packages providing them. This is a reference to hash of binary package provides names. Hash format is:

    { NAME1 => [
          [FLAG1, VERSION1, SOURCENAME1, BINARYRPM1],
          [FLAG1, VERSION1, SOURCENAME1, BINARYRPM2],
          [FLAG1, VERSION1, SOURCENAME2, BINARYRPM2],
          [FLAG2, VERSION2, SOURCENAME1, BINARYRPM1],
      ],
      NAME2 => [
          ...
      ],
      ...
    }

Be ware the same provided symbol can be provided by more packages.

Methods

insert($package)
Copy all providers of a $package into the object. $package is Fedora::Rebuild::Package object.

what_provides($name, $flag, $version)
Query the object which packages provide given ($name, $flag, $version) triplet.

The $name is a string, the $flag is binary field of Fedora::Rebuild::RPM version qualifiers (e.g. "Fedora::Rebuild::RPM::EQUAL|Fedora::Rebuild::RPM::GREATER"), the $version is a string.

The return value is an array of packages which satisfy the symbol. The array is list of refences to pairs:

    (
        [ SOURCE_PACKAGE1, BINARY_PACKAGE1 ],
        [ SOURCE_PACKAGE2, BINARY_PACKAGE2 ],
        ...
    )

Second element is the binary package name, first element is source package of the binary package expressed as a Fedora::Rebuild::Package object.

pdf