-- Perl 5.8.8 documentation --
Fink::Bootstrap

NAME

Fink::Bootstrap - Bootstrap a fink installation

SYNOPSIS

  use Fink::Bootstrap qw(:ALL);
	my $distribution = check_host($host);
	my $result = inject_package($package, $packagefiles, $info_script, $param);
    my ($package_list, $perl_is_supported) = additional_packages();
	bootstrap();
	my $bsbase = get_bsbase();
	my $result = check_files();
	my $packagefiles = fink_packagefiles();
	my ($notlocated, $basepath) = locate_Fink();
	my ($notlocated, $basepath) = locate_Fink($param);
	my ($version, $revision) = get_packageversion();
	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);
	my ($version, $revisions) = read_version_revision($package_source);
	my ($version, $revision) = get_version_revision($package_source,$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.pl, 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);

    Checks the current host OS version and returns which distribution to use, or "unknown." $host should be as determined by config.guess.

    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.pl 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.

  • additional_packages
    	my ($package_list, $perl_is_supported) = additional_packages();

    Returns (1) 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), and (2) 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().

  • bootstrap
    	bootstrap();

    The primary bootstrap routine, called by bootstrap.pl.

  • get_bsbase
    	my $bsbase = get_bsbase();

    Returns the base path for bootstrapping. Called 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.pl and fink's inject.pl.

  • fink_packagefiles
    	my $packagefiles = fink_packagefiles();

    Returns a list of all files which should be contained in the fink tarball. Called by bootstrap.pl and fink's inject.pl.

  • 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().

  • get_packageversion
    	my ($version, $revision) = get_packageversion();

    Finds the current version (by examining the VERSION file) and the current revision (which defaults to 1 or a cvs timestamp) of the package being compiled.

    Formerly called by bootstrap.pl and inject_package(); now obsolete.

  • 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.pl and inject_package().

  • copy_description
    	my $result = copy_description($script, $bpath, $package, $packageversion, $packagerevision);
    	my $result = copy_description($script, $bpath, $package, $packageversion, $packagerevision, $destination);

    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/$package.info if it already exists.

    Next, copy $package.info.in (from the current directory) to $bpath/fink/dists/$destination/$package.info, 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.

    Returns 0 on success, 1 on failure. The default $destination, if not supplied, is "local/injected/finkinfo".

    Called by bootstrap.pl and inject_package().

  • modify_description
    	my $result = modify_description($original,$target,$tarball,$package_source,$source_location,$distribution,$coda);

    Copy the file $original to $target, supplying the correct version and revision (from get_version_revision($package_source,$distribution)) and $source_location as well as 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.

    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.pl, inject_package(), and modify_description().