Update of /cvsroot/fink/fink
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv17358

Modified Files:
        ChangeLog INSTALL INSTALL.html MANIFEST Makefile 
Added Files:
        bootstrap 
Removed Files:
        bootstrap.pl bootstrap.sh 
Log Message:
finish update

Index: INSTALL.html
===================================================================
RCS file: /cvsroot/fink/fink/INSTALL.html,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- INSTALL.html        15 Jun 2006 17:21:52 -0000      1.27
+++ INSTALL.html        15 Jun 2006 19:13:00 -0000      1.28
@@ -52,14 +52,14 @@
 </p>
 <pre>[frodo:~] testuser% <b>tar xzf fink-0.8.1-full.tar.gz</b>
 [frodo:~] testuser% <b>cd fink-0.8.1-full</b>
-[frodo:~/fink-0.8.1-full] testuser% <b>./bootstrap.sh /sw</b>
+[frodo:~/fink-0.8.1-full] testuser% <b>./bootstrap /sw</b>
 
 Welcome to Fink.
 
 ...
 Choose a method: [1] <b>1</b>
 
-sudo /Users/testuser/fink-0.8.1-full/bootstrap.pl .sudo '/sw'
+sudo /Users/testuser/fink-0.8.1-full/bootstrap .sudo '/sw'
 Password:<b>(your normal password here)</b>
 ...
 OK, I'll ask you some questions and update the configuration file in
@@ -264,14 +264,11 @@
 </p>
 <p>
 The actual installation is performed by the perl script
-bootstrap.pl.
-It is accompanied by a small shell script, bootstrap.sh, which checks
-some basic requirements and then hands over control to the perl
-script.
+bootstrap.
 So, to start installation, go to the fink-0.8.1-full directory and run
 this command:
 </p>
-<pre>./bootstrap.sh</pre>
+<pre>./bootstrap</pre>
 <p>
 After running some tests, the script will ask you what method should
 be used to gain root privileges.

--- bootstrap.sh DELETED ---

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/ChangeLog,v
retrieving revision 1.421
retrieving revision 1.422
diff -u -d -r1.421 -r1.422
--- ChangeLog   30 May 2006 07:10:54 -0000      1.421
+++ ChangeLog   15 Jun 2006 19:13:00 -0000      1.422
@@ -1,3 +1,7 @@
+2006-06-15  Chris Zubrzycki  <[EMAIL PROTECTED]>
+
+       * bootstrap.pl, bootstrap.sh: Merged both into bootstrap, Updated 
references.
+
 2006-05-28  Dave Morrison  <[EMAIL PROTECTED]>
 
        * bootstrap.pl: Don't query the user about 10.4 vs. 10.4-transitional;

--- NEW FILE: bootstrap ---
#!/usr/bin/perl -w
# -*- mode: Perl; tab-width: 4; -*-
#
# bootstrap - perl script to install and bootstrap a Fink
#                                                                installation 
from source
#
# Fink - a package manager that downloads source and installs it
# Copyright (c) 2001 Christoph Pfisterer
# Copyright (c) 2001-2006 The Fink Package Manager Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA      02111-1307, 
USA.
#

$| = 1;
use 5.008_001;   # perl 5.8.1 or newer required
use strict;

use FindBin;

my ($answer);
my ($script, $cmd);

### check the perl version

# acceptable perl versions: "$] value" => "human-readable version string"
my %ok_perl_versions = (
    "5.008001" => "5.8.1",
    "5.008002" => "5.8.2",
    "5.008006" => "5.8.6"
);

if (exists $ok_perl_versions{"$]"}) {
    print "Found perl version $].\n";
} else {
    die "\nSorry, your /usr/bin/perl is version $], but Fink can only use" . (
        join "", map {
            ( $ok_perl_versions{$_} =~ /0$/ ? "\n  " : ", " ) .
            "$ok_perl_versions{$_} ($_)"
        } sort keys %ok_perl_versions
    )."\n\n";
}

### patch FinkVersion.pm.in ###

my ($homebase, $file);
$homebase = $FindBin::RealBin;
chdir $homebase;

my $output = "$FindBin::RealBin/perlmod/Fink/FinkVersion.pm";
my $outputhandle = IO::Handle->new();
my $input = "$output" . ".in";
my $inputhandle = IO::Handle->new();
chomp(my $version = `cat VERSION`);

open($inputhandle, "<$input") or die ("cannot open $input for reading");
open($outputhandle, ">$output") or die ("cannot open $output for writing");

while (defined ($_=<$inputhandle>))
{
        s/[EMAIL PROTECTED]@/$version/g;
        print $outputhandle "$_";
}

close $inputhandle;
close $outputhandle;

### check if we are unharmed ###

print "Checking package...";
use lib "$FindBin::RealBin/perlmod";
require Fink::Bootstrap;
import Fink::Bootstrap qw(&check_host &check_files);
require Fink::FinkVersion;
import Fink::FinkVersion qw(&fink_version &default_binary_version);

my $res = check_files();
if( $res == 1 ) {
        exit 1;
}
printf " looks good (fink-%s).\n", fink_version();

### load some modules

require Fink::Services;
import Fink::Services qw(&read_config &execute &get_arch);
require Fink::CLI;
import Fink::CLI qw(&print_breaking &prompt &prompt_boolean &prompt_selection);
import Fink::Bootstrap qw(&create_tarball &fink_packagefiles &copy_description 
&get_version_revision);

### check if we like this system

print "Checking system...";
my ($host, $distribution);

$host = `update/config.guess`;
chomp($host);
if ($host =~ /^\s*$/) {
        print " ERROR: Can't determine host type.\n";
        exit 1;
}
print " $host\n";

$distribution = check_host($host,1);
if ($distribution eq "unknown") {
        exit(1);
}

print "Distribution $distribution\n";

# temporary code to instruct users until we retire the 10.4-transitional tree
if (($> == 0) and ($distribution ne "10.3") and ($host =~ /^powerpc/)) {
        print("\n");
        &print_breaking("On powerpc hardware, you can bootstrap into the 
10.4-transitional tree rather than the 10.4 tree by setting the environment 
variable FINK_NOTRANS to \"false\" while bootstrapping.  To use 10.4, set it to 
\"true\" or don't set it at all.");
        print("\n");
        &print_breaking("If you wish to interrupt the current bootstrap in 
order to change an environment variable, use control-C.");
        print("\n");
        sleep(10);
}
# end of temporary code

### get version

my ($packageversion, $packagerevision) = 
&get_version_revision(".",$distribution);

### choose root method

my ($rootmethod);
if ($> != 0) {
        my $sel_intro = "Fink must be installed and run with superuser (root) ".
            "privileges. Fink can automatically try to become ".
            "root when it's run from a user account. Since you're ".
            "currently running this script as a normal user, the ".
            "method you choose will also be used immediately for ".
            "this script. Avaliable methods:";
        $answer = &prompt_selection("Choose a method:",
                                        intro   => $sel_intro,
                                        default => [ value => "sudo" ],
                                        choices => [
                                          "Use sudo" => "sudo",
                                          "Use su" => "su",
                                          "None, fink must be run as root" => 
"none" ] );
        $cmd = "'$homebase/bootstrap' .$answer";
        if ($#ARGV >= 0) {
                $cmd .= " '".join("' '", @ARGV)."'";
        }
        if ($answer eq "sudo") {
                $cmd = "/usr/bin/sudo $cmd";
        } elsif ($answer eq "su") {
                $cmd = "$cmd | /usr/bin/su";
        } else {
                print "ERROR: Can't continue as non-root.\n";
                exit 1;
        }
        print "\n";
        exit &execute($cmd, quiet=>1);
} else {
        if (defined $ARGV[0] and substr($ARGV[0],0,1) eq ".") {
                $rootmethod = shift;
                $rootmethod = substr($rootmethod,1);
        } else {
                print "\n";
                &print_breaking("Fink must be installed and run with superuser 
(root) ".
                                                "privileges. Fink can 
automatically try to become ".
                                                "root when it's run from a user 
account. ".
                                                "Avaliable methods:");
                $answer = &prompt_selection("Choose a method:",
                                                default => [ value => "sudo" ],
                                                choices => [
                                                  "Use sudo" => "sudo",
                                                  "Use su" => "su",
                                                  "None, fink must be run as 
root" => "none" ] );
                $rootmethod = $answer;
        }
}
umask oct("022");

### run some more system tests

my ($response);

print "Checking cc...";
if (-x "/usr/bin/cc") {
        print " looks good.\n";
} else {
        print " not found.\n";
        &print_breaking("ERROR: There is no C compiler on your system. ".
                                        "Make sure that the Developer Tools are 
installed.");
        exit 1;
}

print "Checking make...";
if (-x "/usr/bin/make") {
        $response = `/usr/bin/make --version 2>&1`;
        if ($response =~ /GNU Make/si) {
                print " looks good.\n";
        } else {
                print " is not GNU make.\n";
                &print_breaking("ERROR: /usr/bin/make exists, but is not the ".
                                                "GNU version. You must correct 
this situation before ".
                                                "installing Fink. /usr/bin/make 
should be a symlink ".
                                                "pointing to 
/usr/bin/gnumake.");
                exit 1;
        }
} else {
        print " not found.\n";
        &print_breaking("ERROR: There is no make utility on your system. ".
                                        "Make sure that the Developer Tools are 
installed.");
        exit 1;
}

print "Checking head...";
if (-x "/usr/bin/head") {
        $response = `/usr/bin/head -1 /dev/null 2>&1`;
        if ($response =~ /Unknown option/si) {
                print " is broken.\n";
                &print_breaking("ERROR: /usr/bin/head seems to be corrupted. ".
                                                "This can happen if you 
manually installed Perl libwww. ".
                                                "You'll have to restore 
/usr/bin/head from another ".
                                                "machine or from installation 
media.");
                exit 1;
        } else {
                print " looks good.\n";
        }
} else {
        print " not found.\n";
        &print_breaking("ERROR: There is no head utility on your system. ".
                                        "Make sure that the Developer Tools are 
installed.");
        exit 1;
}

### setup the correct packages directory
# (no longer needed: we just use $distribution directly...)
#
#if (-e "packages") {
#               rename "packages", "packages-old";
#               unlink "packages";
#}
#symlink "$distribution", "packages" or die "Cannot create symlink";

### choose installation path

# Check if a location has installed software
sub has_installed_software {
        my $loc = shift;
        return (-d "$loc/bin" or -d "$loc/lib" or -d "$loc/include");
}

my $retrying = 0;
my $nonstandard_warning = 0;

my $installto = shift || "";

OPT_BASEPATH: { ### install path redo block

# ask if the path wasn't passed as a parameter
if ($retrying || not $installto) {
        my $default = '/sw';
        while (1) {
                last if !has_installed_software($default);
                $default =~ /^(.*?)(\d*)$/;
                $default = $1 . (($2 || 1) + 1);
        }
        
        print "\n";
        if ($default ne '/sw' && !$nonstandard_warning) {
                print "It looks like you already have Fink installed in /sw, 
trying "
                .       "$default instead.\n\n"
                .       "WARNING: This is a non-standard location.\n\n";
                $nonstandard_warning = 1;
        }
        my $prompt = "Please choose the path where Fink should be installed. 
Note "
                . "that you will be able to use the binary distribution only if 
you "
                . "choose '/sw'.";
        $installto =
                &prompt($prompt, default => $default);
}
$retrying = 1;
print "\n";

# catch formal errors
if ($installto eq "") {
        print "ERROR: Install path is empty.\n";
        redo OPT_BASEPATH;
}
if (substr($installto,0,1) ne "/") {
        print "ERROR: Install path '$installto' doesn't start with a slash.\n";
        redo OPT_BASEPATH;
}
if ($installto =~ /\s/) {
        print "ERROR: Install path '$installto' contains whitespace.\n";
        redo OPT_BASEPATH;
}

# remove any trailing slash(es)
$installto =~ s,^(/.*?)/*$,$1,;

# check well-known path (NB: these are regexes!)
foreach my $forbidden (
        qw(/ /etc /usr /var /bin /sbin /lib /tmp /dev
           /usr/lib /usr/include /usr/bin /usr/sbin /usr/share
           /usr/libexec /usr/X11R6
           /root /private /cores /boot
           /debian /debian/.*)
) {
        if ($installto =~ /^$forbidden$/i) {
                print "ERROR: Refusing to install into '$installto'.\n";
                redo OPT_BASEPATH;
        }
}
if ($installto =~ /^\/usr\/local$/i) {
        $answer =
                &prompt_boolean("Installing Fink in /usr/local is not 
recommended. ".
                                                "It may conflict with third 
party software also ".
                                                "installed there. It will be 
more difficult to get ".
                                                "rid of Fink when something 
breaks. Are you sure ".
                                                "you want to install to 
/usr/local?", default => 0);
        if ($answer) {
                &print_breaking("You have been warned. Think twice before 
reporting ".
                                                "problems as a bug.");
        } else {
                redo OPT_BASEPATH;
        }
} elsif (-d $installto) {
        # check existing contents
        if (has_installed_software $installto) {
                &print_breaking("ERROR: '$installto' exists and contains 
installed ".
                                                "software. Refusing to install 
there.");
                redo OPT_BASEPATH;
        } else {
                &print_breaking("WARNING: '$installto' already exists. If 
bootstrapping ".
                                                "fails, try removing the 
directory altogether and ".
                                                "re-run bootstrap.");
        }
} else {
        &print_breaking("OK, installing into '$installto'.");
}
print "\n";
}

### create directories

print "Creating directories...\n";
my ($dir, @dirlist);

if (not -d $installto) {
        if (&execute("/bin/mkdir -p -m755 $installto")) {
                print "ERROR: Can't create directory '$installto'.\n";
                exit 1;
        }
}

my $arch = get_arch();

@dirlist = qw(etc etc/alternatives etc/apt src fink fink/debs var var/lib 
var/lib/fink);
push @dirlist, "fink/$distribution", "fink/$distribution/stable", 
"fink/$distribution/local";
foreach $dir (qw(stable/main stable/crypto local/main)) {
        push @dirlist, "fink/$distribution/$dir", 
"fink/$distribution/$dir/finkinfo",
                "fink/$distribution/$dir/binary-darwin-$arch";
}
foreach $dir (@dirlist) {
        if (not -d "$installto/$dir") {
                if (&execute("/bin/mkdir -m755 $installto/$dir")) {
                        print "ERROR: Can't create directory 
'$installto/$dir'.\n";
                        exit 1;
                }
        }
}

unlink "$installto/fink/dists";

symlink "$distribution", "$installto/fink/dists" or die "ERROR: Can't create 
symlink $installto/fink/dists";

### create fink tarball for bootstrap

my $packagefiles = &fink_packagefiles();

my $result = &create_tarball($installto, "fink", $packageversion, 
$packagefiles);
if ($result == 1 ) {
        exit 1;
}

### copy package info needed for bootstrap

$script = "/bin/mkdir -p $installto/fink/dists/stable/main/finkinfo/base\n";
$script .= "/bin/cp $distribution/*.info $distribution/*.patch 
$installto/fink/dists/stable/main/finkinfo/base/\n";

$result = &copy_description($script,$installto, "fink", $packageversion, 
$packagerevision, "stable/main/finkinfo/base");
if ($result == 1 ) {
        exit 1;
}

### load the Fink modules

require Fink::Config;
require Fink::Engine;
require Fink::Configure;
require Fink::Bootstrap;

### setup initial configuration

print "Creating initial configuration...\n";
my ($configpath, $config, $engine);

$configpath = "$installto/etc/fink.conf";
open(CONFIG, ">$configpath") or die "can't create configuration: $!";
print CONFIG <<"EOF";
# Fink configuration, initially created by bootstrap
Basepath: $installto
RootMethod: $rootmethod
Trees: local/main stable/main stable/crypto
Distribution: $distribution
EOF
close(CONFIG) or die "can't write configuration: $!";

$config = &read_config($configpath);
# override path to data files (update, mirror)
no warnings 'once';
$Fink::Config::libpath = $homebase;
use warnings 'once';
$engine = Fink::Engine->new_with_config($config);

### interactive configuration

Fink::Configure::configure();

### bootstrap

Fink::Bootstrap::bootstrap();

### remove dpkg-bootstrap.info, to avoid later confusion

&execute("/bin/rm -f 
$installto/fink/dists/stable/main/finkinfo/base/dpkg-bootstrap.info");

### copy included package info tree if present

my $showversion = "";
if ($packageversion !~ /cvs/) {
        $showversion = "-$packageversion";
}

my $endmsg = "Internal error.";

chdir $homebase;
my $dbv = default_binary_version($distribution);
if (-d "pkginfo") {
        if (&execute("cd pkginfo && ./inject.pl $installto -quiet")) {
                # inject failed
                $endmsg = <<"EOF";
Copying the package description tree failed. This is no big harm;
your Fink installation should work nonetheless.
You can add the package descriptions at a later time if you want to
compile packages yourself.
You can get them
EOF
if (defined $dbv) {
$endmsg .= "by installing the dists-$distribution-$dbv.tar.gz
tarball, or";
}
                $endmsg .= " by running the command 'fink selfupdate'.";
        } else {
                # inject worked
                $endmsg = <<"EOF";
You should now have a working Fink installation in '$installto'.
EOF
        }
} else {
        # this was not the 'full' tarball
        $endmsg = <<"EOF";
You should now have a working Fink installation in '$installto'.
You still need package descriptions if you want to compile packages yourself.
You can get them
EOF
if (defined $dbv) {
$endmsg .= "by installing the dists-$distribution-$dbv.tar.gz
tarball, or";
}
        $endmsg .= " by running the command 'fink selfupdate'.";
}

### create Packages.gz files for apt

# set PATH so we find dpkg-scanpackages
$ENV{PATH} = "$installto/sbin:$installto/bin:".$ENV{PATH};

Fink::Engine::cmd_scanpackages();

### the final words...

$endmsg =~ s/\s+/ /gs;
$endmsg =~ s/ $//;

print "\n";
&print_breaking($endmsg);
print "\n";
&print_breaking(
    "Run '. $installto/bin/init.sh' to set up this terminal session ".
    "environment to use Fink. To make the software installed by Fink ".
    "available in all of your future terminal shells, add ".
    "'. $installto/bin/init.sh' to the init script '.profile' or ".
    "'.bash_profile' in your home directory. The program ".
    "$installto/bin/pathsetup.sh can help with this. Enjoy."
);
print "\n";

### eof
exit 0;


# vim: ts=4 sw=4 noet

Index: Makefile
===================================================================
RCS file: /cvsroot/fink/fink/Makefile,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- Makefile    24 Mar 2006 16:41:31 -0000      1.30
+++ Makefile    15 Jun 2006 19:13:00 -0000      1.31
@@ -18,7 +18,7 @@
        @cvs commit
 
 bootstrap: test
-       @sh bootstrap.sh $(PREFIX)
+       @sh bootstrap $(PREFIX)
 
 install:
        ./inject.pl $(PREFIX)

Index: MANIFEST
===================================================================
RCS file: /cvsroot/fink/fink/MANIFEST,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- MANIFEST    24 Mar 2006 19:29:25 -0000      1.2
+++ MANIFEST    15 Jun 2006 19:13:00 -0000      1.3
@@ -16,8 +16,7 @@
 STYLE
 TODO
 TODO.shlibs
-bootstrap.pl
-bootstrap.sh
+bootstrap
 dpkg-checkall.sh
 fink.in
 fink.8.in

Index: INSTALL
===================================================================
RCS file: /cvsroot/fink/fink/INSTALL,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- INSTALL     15 Jun 2006 17:21:52 -0000      1.23
+++ INSTALL     15 Jun 2006 19:13:00 -0000      1.24
@@ -40,14 +40,14 @@
 
    [frodo:~] testuser% tar_xzf_fink-0.8.1-full.tar.gz
    [frodo:~] testuser% cd_fink-0.8.1-full
-   [frodo:~/fink-0.8.1-full] testuser% ./bootstrap.sh_/sw
+   [frodo:~/fink-0.8.1-full] testuser% ./bootstrap /sw
    
    Welcome to Fink.
    
    ...
    Choose a method: [1] 1
    
-   sudo /Users/testuser/fink-0.8.1-full/bootstrap.pl .sudo '/sw'
+   sudo /Users/testuser/fink-0.8.1-full/bootstrap .sudo '/sw'
    Password:(your_normal_password_here)
    ...
    OK, I'll ask you some questions and update the configuration file in
@@ -218,10 +218,9 @@
 You now have a directory named fink-0.8.1-full. Change to it with "cd
 fink-0.8.1-full" .
 
-The actual installation is performed by the perl script bootstrap.pl. It is
-accompanied by a small shell script, bootstrap.sh, which checks some basic
-requirements and then hands over control to the perl script. So, to start
-installation, go to the fink-0.8.1-full directory and run this command:
+The actual installation is performed by the perl script bootstrap. So, to
+start the installation, go to the fink-0.8.1-full directory and run this
+command:
 
    ./bootstrap.sh
 

--- bootstrap.pl DELETED ---



_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to