Fink::Bootstrap(3) Fink documentation Fink::Bootstrap(3)NAMEFink::Bootstrap - Bootstrap a fink installation
SYNOPSIS
use Fink::Bootstrap qw(:ALL);
my $distribution = check_host($host);
my $distribution = check_host($host, $bootstrap);
my $distribution = check_host($host, $bootstrap, $arch);
my $result = inject_package($package, $packagefiles, $info_script, $param);
my $package_list = additional_packages();
my $perl_is_supported = is_perl_supported();
bootstrap();
my $bsbase = get_bsbase();
my $result = check_files();
my $packagefiles = fink_packagefiles();
my ($notlocated, $basepath) = locate_Fink();
my ($notlocated, $basepath) = locate_Fink($param);
find_rootmethod($bpath);
my $result = create_tarball($bpath, $package, $packageversion, $packagefiles);
my $result = copy_description($script, $bpath, $package, $packageversion, $packagerevision);
my $result = copy_description($script, $bpath, $package, $packageversion, $packagerevision, $destination);
my $result = modify_description($original,$target,$tarball,$package_source,$source_location,$distribution,$coda,$version,$revision);
my ($version, $revisions) = read_version_revision($package_source);
my ($version, $revision) = get_version_revision($package_source,$distribution);
my $selfupdatetrees = get_selfupdatetrees($distribution);
DESCRIPTION
This module defines functions that are used to bootstrap a fink
installation or update to a new version. The functions are intended to
be called from scripts that are not part of fink itself. In
particular, the scripts bootstrap, inject.pl,
scripts/srcdist/dist-module.pl, and fink's postinstall.pl all depend on
functions from this module.
Functions
These functions are exported on request. You can export them all with
use Fink::Bootstrap qw(:ALL);
check_host
my $distribution = check_host($host);
my $distribution = check_host($host, $bootstrap);
my $distribution = check_host($host, $bootstrap, $arch);
Checks the current host OS version and returns which distribution
to use, or "unknown." $host should be as determined by
config.guess.
The optional argument $bootstrap is a boolean, designating whether
we have been called by bootstrap or not. If absent, it defaults to
false.
The second optional argument $arch specifies the architecture for
Fink which was chosen during bootstrap (from the bootstrap script),
or the architecture under which Fink is currently being installed
(when called from postinstall.pl). It defaults to the empty
string.
This function also warns the user about certain bad configurations,
or incorrect versions of gcc.
After every release of Mac OS X, fink should be tested against the
new release and then this function should be updated.
Called by bootstrap and fink's postinstall.pl.
inject_package
my $result = inject_package($package, $packagefiles, $info_script, $param);
The primary routine to update a fink installation, called by
inject.pl. Installs a new version of $package (passing $param to
the locate_Fink function to find out where to install it), whose
source files are those listed in $packagefiles, and executing the
script $info_script prior to making the new package desription.
Returns 0 on success, 1 on failure.
add_injected_to_trees
my ($exit_value) = add_injected_to_trees($distribution);
Adds local/injected to the Trees list, if not already present. Now
depends on $distribution because the default Trees list does.
Returns 1 on failure, 0 on success.
Called by inject_package() and fink's postinstall.pl.
additional_packages
my $package_list = additional_packages();
Returns a reference to the list of non-essential packages which
must be installed during bootstrap or selfupdate (this answer is
affected by the currently-running version of perl)
Called by bootstrap() and by Fink::SelfUpdate::finish().
is_perl_supported
my $perl_is_supported = is_perl_supported();
Returns a boolean value which is "True" if the currently-running
version of perl is on the list of those versions supported during
bootstrapping, and "False" otherwise.
Called by bootstrap() and by Fink::SelfUpdate::finish().
bootstrap1
bootstrap1();
bootstrap1($item1,$item2,...);
The first part of the primary bootstrap routine, called by
bootstrap. The optional arguments specify packages in addition to
dpkg-bootstrap which should be built before package management
starts.
bootstrap2
bootstrap2();
The second part of the primary bootstrap routine, called by
bootstrap. This part must be run under a perl binary which is
identical to the one which will be used to run fink itself, post-
bootstrap.
bootstrap3
bootstrap3();
The final part of the primary bootstrap routine, called by
bootstrap.
get_bsbase
my $bsbase = get_bsbase();
Returns the base path for bootstrapping. Called by bootstrap() and
by bootstrap.
check_files
my $result = check_files();
Tests whether the current directory contains all of the files
needed to compile fink. Returns 0 on success, 1 on failure.
Called by bootstrap and fink's inject.pl.
fink_packagefiles
my $packagefiles = fink_packagefiles();
Returns a space-separated list of all files which should be
contained in the fink tarball. Called by bootstrap and fink's
inject.pl. This list is complete: you do not need to recurse
through directories, and simple directories are not even included
here.
locate_Fink
my ($notlocated, $basepath) = locate_Fink();
my ($notlocated, $basepath) = locate_Fink($param);
If called without a parameter, attempts to guess the base path of
the fink installation. If the guess is successful, returns (0,
base path). If the guess is unsuccessful, returns (1, guessed
value) and suggests to the user to call the script with a
parameter.
When a parameter is passed, it is returned as the base path value
via (0, base path).
This function is called by inject_package().
find_rootmethod
find_rootmethod($bpath);
Reexecute "./inject.pl $bpath" as sudo, if appropriate. Called by
inject_package().
create_tarball
my $result = create_tarball($bpath, $package, $packageversion, $packagefiles);
Create the directory $bpath/src if necessary, then create the
tarball $bpath/src/$package-$packageversion.tar containing the
files $packagefiles. Returns 0 on success, 1 on failure.
Called by bootstrap and inject_package().
copy_description
my $result = copy_description($script, $bpath, $package, $packageversion, $packagerevision);
my $result = copy_description($script, $bpath, $package, $packageversion, $packagerevision, $destination);
my $result = copy_description($script, $bpath, $package, $packageversion, $packagerevision, $destination, $target_file);
my $result = copy_description($script, $bpath, $package, $packageversion, $packagerevision, $destination, $target_file, $template_file);
Execute the given $script, create the directories $bpath/fink/debs
and $bpath/fink/dists/$destination if necessary, and backup the
file $bpath/fink/dists/$destination/$target_file if it already
exists.
Next, copy $template_file (from the current directory) to
$bpath/fink/dists/$destination/$target_file, supplying the correct
$packageversion and $packagerevision as well as an MD5 sum
calculated from $bpath/src/$package-$packageversion.tar. Ensure
that the created file has mode 644.
The default $destination, if not supplied, is
"local/injected/finkinfo". The default $target_file, if not
supplied, is "$package.info". The default $template_file, if not
supplied, is "$target_file.in".
Returns 0 on success, 1 on failure.
Called by bootstrap and inject_package().
modify_description
my $result = modify_description($original,$target,$tarball,$package_source,$source_location,$distribution,$coda,$version,$revision);
Copy the file $original to $target, supplying the correct version,
revision, and distribution (from
get_version_revision($package_source,$distribution)) as well as
$source_location and an MD5 sum calculated from $tarball. Pre-
evaluate any conditionals containing %{Distribution}, using
$distribution as the value of %{Distribution}. Append $coda to the
end of the file.
Wrap the file in Info4, unless $distribution = 10.3 or 10.4.
Returns 0 on success, 1 on failure.
Called by copy_description() and scripts/srcdist/dist-module.pl .
read_version_revision
my ($version, $revisions) = read_version_revision($package_source);
Finds the current version and possible revisions by examining the
files $package_source/VERSION and $package_source/REVISION.
$revisions is a reference to a hash which either specifies a
revision for each distribution, or else specifies a single revision
with the key "all".
Called by get_version_revision() and
scripts/srcdist/dist-module.pl.
get_version_revision
my ($version, $revision) = get_version_revision($package_source,$distribution);
Calculate the version and revision numbers for the .info file,
based on the current $distribution, and the data given in
$package_source/VERSION and $package_source/REVISION.
Called by bootstrap, inject_package(), and modify_description().
get_selfupdatetrees
my $selfupdatetrees = get_selfupdatetrees($distribution);
Find the correct value for $selfupdatetrees for the given
$distribution.
Called by bootstrap and postinstall.pl.
Fink 0.36.3.1 2013-12-30 Fink::Bootstrap(3)