NAME
Cupt::Cache - store info about available packages
FLAGS
o_memoize
This flag determines whether it worth trade space for time in time-consuming functions. On by default. By now, it affects "get_satisfying_versions" method. If it's on, it stores references, so don't modify results of these functions, use them in read-only mode. It it's on, these functions are not thread-safe.
METHODS
new
creates a new Cupt::Cache object
Parameters:
config - reference to Cupt::Config
Next params are treated as hash-style param list:
'-source': read Sources
'-binary': read Packages
'-installed': read dpkg status file
'-allow-reinstall': list of globs of package names which are allowed to reinstall
Example:
my $cache = new Cupt::Cache($config, '-source' => 0, '-binary' => 1);
set_config
method, sets new Cupt::Config for the cache
Parameters:
config - reference to Cupt::Config
get_binary_package_names
method, returns an array of binary package names
get_source_package_names
method, returns an array of source package names
get_system_state
method, returns reference to Cupt::System::State
get_extended_info
method, returns info about extended package statuses in format:
{'automatically_installed' => { I<package_name> => 1 },}
is_automatically_installed
method, returns boolean value - is the package automatically installed or not
Parameters:
package_name - package name
get_original_apt_pin
method, returns pin value for the supplied version as described in apt_preferences(5)
Parameters:
version - reference to Cupt::Cache::BinaryVersion
get_pin
method, returns Cupt pin value for the supplied version
Parameters:
version - reference to Cupt::Cache::BinaryVersion
get_binary_package
method, returns reference to appropriate Cupt::Cache::Package for package name. Returns undef if there is no such package in cache.
Parameters:
package_name - package name to find
get_source_package
method, returns reference to appropriate Cupt::Cache::Package for package name. Returns undef if there is no such package in cache.
Parameters:
package_name - package name to find
get_sorted_pinned_versions
method to get sorted by "candidatness" versions in descending order
Parameters:
package - reference to Cupt::Cache::Package
Returns: [ { 'version' => version, 'pin' => pin }... ]
where:
version - reference to Cupt::Cache::BinaryVersion
pin - pin value
get_policy_version
method, returns reference to Cupt::Cache::BinaryVersion, this is the version of package, which to be installed by cupt policy; or undef if there is no valid versions for this package
Parameters:
package - reference to Cupt::Cache::Package, package to select versions from
get_satisfying_versions
method, returns reference to array of Cupt::Cache::BinaryVersion that satisfy relation, if no version can satisfy the relation, returns an empty array
Parameters:
relation_expression - see Relation expression in Cupt::Cache::Relation
get_index_entries
method, returns reference to list of "index_entry"'s
get_path_of_index_list
method, returns path of Packages/Sources file for index_entry
Parameters:
"index_entry"
get_download_entries_of_index_list
method, returns the download entries of Packages/Sources file for index_entry
Parameters:
"index_entry"
path to accompanying Release file
Returns:
[ download_entry... ]
where
download_entry is
{'uri' => {'size' => file size'md5sum' => MD5 hash sum'sha1sum' => SHA1 hash sum'sha256sum' => SHA256 hash sum}}
get_path_of_release_list
method, returns path of Release file for index_entry
Parameters:
"index_entry"
get_download_uri_of_release_list
method, returns the remote URI of Release file for index_entry
Parameters:
"index_entry"
get_download_entries_of_localized_descriptions
method, returns the remote URIs and corresponding download places of possible Translation files for index_entry
Parameters:
"index_entry"
Returns:
[ [ download URI, local path to place ]... ]
get_path_of_extended_states
returns path of file containing extended states for packages
get_binary_release_data
method, returns reference to array of available releases of binary packages in form [ "release_info" ... ]
get_source_release_data
method, returns reference to array of available releases of source packages in form [ "release_info" ... ]
FREE SUBROUTINES
verify_signature
Checks signature of supplied file via GPG.
Parameters:
config - reference to Cupt::Config
file - path to file
Returns:
non-zero on success, zero on fail
verify_hash_sums
verifies MD5, SHA1 and SHA256 hash sums of file
Parameters:
hash sums - { 'md5sum' => $md5sum, 'sha1sum' => $sha1sum', 'sha256sum' => $sha256sum }
You should specify at least one hash sum in this parameter.
path - path to file
Returns: zero on failure, non-zero on success
get_path_of_debian_changelog
free subroutine, returns string path of Debian changelog for version when version is installed, undef otherwise
Parameters:
version - reference to Cupt::Cache::BinaryVersion
get_path_of_debian_copyright
free subroutine, returns string path of Debian copyright for version when version is installed, undef otherwise
Parameters:
version - reference to Cupt::Cache::BinaryVersion
DATA SPECIFICATION
release_info
This is a hash:
{'signed' => boolean, whether release signed or not'version' => version of released distribution (can be undef)'description' => description string'vendor' => vendor string'label' => label string'archive' => archive name string'codename' => codename string'date' => date of release (can be undef)'valid-until' => time string when to forget about this release'architectures' => reference to array of available architectures'base_uri' => base URI (origin), empty string in case of "installed" distribution'not_automatic' => true if packages from this release shouldn't be considered for automatic upgrades}
index_entry
This is a hash:
{'type' => { 'deb' | 'deb-src' }'uri' => URI string'distribution' => distribution path'component' => component string}