Fink::Package(3) Fink documentation Fink::Package(3)NAMEFink::Package - manipulate Fink package objects
DESCRIPTIONFink::Package contains a variety of tools for querying, manipulating,
and navigating the Fink package database.
Functions
No functions are exported by default. You should generally be getting
a package object by interacting with this module in an object-oriented
fashion:
my $package = Fink::Package->package_by_name('PackageName');
is_virtual
my $bool = $po->is_virtual;
Return true if this package is "virtual", ie: it cannot be built or
installed by Fink.
Note that even virtual packages can have versions, if those
versions are themselves virtual (from Status or VirtPackage).
get_latest_version
my $pv = $po->get_latest_version;
Convenience method to get the highest version of this package.
Returns undef if the package is has no versions.
get_matching_versions
my @pvs = $po->get_matching_versions($spec);
my @pvs = $po->get_matching_versions($spec, @choose_from);
Find all versions of this package which satisfy the given Debian
version specification. See Fink::Services::version_cmp for details
on version specifications.
If a list @choose_from of Fink::PkgVersions objects is given,
return only items in the list which satisfy the given
specification.
get_all_providers
my @pvs = $po->get_all_providers;
my @pvs = $po->get_all_providers $noload;
my @pvs = $po->get_all_providers %options;
Returns a list all PkgVersion objects for the Package name. This
list includes all actual packages with this Name and also others
that list this one in the Provides field. The following options are
known:
no_load (optional)
If present and true (or alternately specified as $noload direct
parameter), the current package database will not be read in to
memory.
unique_provides (optional)
If is present and true, only a single PkgVersion object
(probably the one with highest priority according to Trees) of
any specific %f will be returned for packages that Provides the
current Name. Otherwise, separate PkgVersion objects for the
same %f in different Trees may be included.
require_packages
Fink::Package->require_packages;
Load the package database into memory
check_dbdirs
my ($path, $fh, $new) = Fink::Package->check_dbdirs $write, $force_create;
Process the DB dirs. Returns the good directory found/created, and
the lock already acquired.
If $write is true, will create a new directory if one does not
exist, and will delete any old dirs.
If $force_create is true, will always create a new directory
(invalidating any previous PDB dirs).
db_dir
my $path = Fink::Package->db_dir $write;
Get the path to the directory that can store the Fink cached
package database. Creates it if it does not exist and $write is
true.
forget_db_dir
Fink::Package->forget_db_dir;
Forget the current DB directory.
is_new_db_dir
my $bool = Fink::Package->is_new_db_dir;
Returns true if the current DB directory is new (as opposed to
already used and containing a DB).
db_index
my $path = Fink::Package->db_index;
Get the path to the file that can store the Fink global database
index.
db_lockfile
my $path = Fink::Package->db_lockfile;
Get the path to the pdb lock file.
db_proxies
my $path = Fink::Package->db_proxies;
Get the path to the quick-startup cache of the proxy-db.
search_comparedb
Fink::Package->search_comparedb;
Checks if any .info files are newer than the on-disk package
database cache. Returns true if the cache is out of date.
Note that in several cases, this can miss changes. For example, a
.info file older than the PDB cache that is moved into the dists
will not be found.
forget_packages
Fink::Package->forget_packages;
Fink::Package->forget_packages $options;
Removes the package database from memory. The hash-ref $options can
contain the following keys:
disk
If disk is present and true, in addition to removing the
package database from memory, any on-disk cache is removed as
well. This option defaults to false and should be used
sparingly.
load_packages
Fink::Package->load_packages;
Load the package database, updating any on-disk cache if necessary
and possible.
can_read_write_db
my ($read, $write) = Fink::Package->can_read_write_db;
Determines whether Fink can read or write the package database
cache.
update_index
my $fidx = Fink::Package->update_index $fidx, $info, @pvs;
Update the package index $idx with the results of loading
PkgVersions @pvs from .info file $info.
Returns the new index item for the .info file.
pass1_update
Fink::Package->pass1_update $ops, $idx, $infos;
Load any .info files whose cache isn't up to date and available for
reading. If $ops{write} is true, update the cache as well.
pass3_insert
my $success = Fink::Package->pass3_insert $idx, @infos;
Ensure that the .info files @infos are loaded and inserted into the
PDB. Information about the .info files is to be found in the index
$idx..
get_all_infos
my @infos = Fink::Package->get_all_infos;
Get a list of all the .info files. Returns an array of paths to the
.info files.
update_db
Fink::Package->update_db %options;
Updates the on-disk package database cache if possible. Options is
a hash, where the following elements are valid:
no_load
If no_load is present and true, the current package database
will not be read in to memory, but will only be updated.
no_fastload
If no_fastload is present and true, the fast-load cache will
not be used, instead all the .info files will be scanned (but
not necessarily read). The main cache will still be used.
db_valid_since
my $time = Fink::Package->db_valid_since;
Get earliest time (in seconds since the epoch) at which the DB is
known to be exactly the same as now. This allows clients to cache
the contents of the DB, only reloading if $cache_time <
Fink::Package->db_valid_since;
tree_infos
my @files = tree_infos $treename;
Get the full pathnames to all the .info files in a Fink tree.
packages_from_info_file
This function is now part of Fink::PkgVersion, but remains here for
compatibility reasons. It will eventually be deprecated.
insert_runtime_packages
Fink::Package->insert_runtime_packages;
Add all packages to the database which are dynamically generated,
rather than created from .info files.
insert_runtime_package_hash
Fink::Package->insert_runtime_package_hash $hashref, $type;
Given a hash of package-name => property-list, insert the packages
into the in-memory database.
packages_from_properties
This function is now part of Fink::PkgVersion, but remains here for
compatibility reasons. It will eventually be deprecated.
insert_pkgversions
Fink::Package->insert_pkgversions @pkgversions;
Insert a list of Fink::PkgVersion into the current in-memory
package database.
handle_infon_block
This function is now part of Fink::PkgVersion, but remains here for
compatibility reasons. It will eventually be deprecated.
print_virtual_pkg
$po->print_virtual_pkg;
Pretty print a message indicating that a given package is virtual,
and what packages provide it.
get_latest_providers
$package->get_latest_providers;
Returns a list of providers for a virtual package. Only the latest
version of each provider is returned.
choose_virtual_pkg_provider
$package->choose_virtual_pkg_provider
Returns the package which provides a virtual package. It allows the
user to choose which package to install if there are multiple
packages providing the requested virtual package.
Fink 0.36.3.1 2013-12-30 Fink::Package(3)