I am not really happy with this patch. Perhaps my initial goal with the script tools/install/smoke.pl wasn't well-known and/or understood.
Its main use case is : - a Windows user (without parrot dev tree) downloads and installs the setup of a monthly release. - he runs this script in order to check the result of its installation. - (or I ask him to run it when he tell me that he has a problem). So this script must be *shipped* and it's the reason why I creat the directory tools/install and put it in. The second use case is when I prepare the Windows setup with http://parrotwin32.wiki.sourceforge.net/LaRecetteDuChef So, I agree to add some CLI options, but not to add dependence on specific Parrot-dev Perl modules. The following patch restores the initial behavior and preserves some CLI options. François.
Index: tools/install/smoke.pl =================================================================== --- tools/install/smoke.pl (revision 32008) +++ tools/install/smoke.pl (working copy) @@ -5,9 +5,9 @@ use strict; use warnings; use 5.008; + use Getopt::Long; -use lib qw( lib ); -use vars qw( %PConfig ); +use File::Spec::Functions; use Test::More tests => 28; @@ -17,23 +17,22 @@ =head1 SYNOPSIS - parrot in bin +parrot in bin % cd /usr/local/parrot-$version - % perl tools/install/smoke.pl -Ilib + % perl tools/install/smoke.pl - parrot in . +parrot in . % perl tools/install/smoke.pl --bindir=. - test installation in DESTDIR: +test installation in DESTDIR: % cd /usr/src/parrot % mkdir .inst % make install DESTDIR=.inst % perl tools/install/smoke.pl DESTDIR=.inst - =head1 DESCRIPTION Checks that most of things run (or just start) into the install directory, @@ -43,68 +42,29 @@ =over -=item -I libdir - -Add libdir to the libpath to find Parrot::Config - =item --bindir=/usr/bin -Override Parrot::Config bindir +Override default value : 'bin' =item --libdir=/usr/lib -Override Parrot::Config libdir +Override default value : 'lib' -=item --prefix=/usr - -Override Parrot::Config prefix and adjust -libdir and bindir accordingly. - -=item DESTDIR=instpath - -Use the temp. installation in instpath. - =back =cut -my (@libdirs, $prefix, $bindir, $libdir, $DESTDIR); -my $opts = GetOptions( 'I=s' => [EMAIL PROTECTED], - 'prefix=s' => \$prefix, - 'bindir=s' => \$bindir, - 'libdir=s' => \$libdir, - 'DESTDIR=s' => \$DESTDIR, - ); -if (@libdirs) { - push @INC, @libdirs; -} -require Parrot::Config; -Parrot::Config->import; -require Parrot::Test; +my ($bindir, $libdir, $DESTDIR); +my $opts = GetOptions( + 'bindir=s' => \$bindir, + 'libdir=s' => \$libdir, + 'DESTDIR=s' => \$DESTDIR, +); -$bindir = $PConfig{bindir} unless $bindir; -$libdir = $PConfig{libdir} unless $libdir; -if ($prefix) { - $bindir = $prefix . "/bin"; - $libdir = $prefix . "/lib"; -} -# Check for DESTDIR arg and adjust the path -if (@ARGV and $ARGV[0] =~ /^DESTDIR/) { - if ($ARGV[0] =~ /^DESTDIR=(\S+)/) { - $DESTDIR = $1; - } - else { - $DESTDIR = $ARGV[1]; - } -} -if ($DESTDIR) { - my $envsep = $^O eq 'MSWin32' ? ';' : ':'; - $ENV{PATH} = $DESTDIR.$bindir.$envsep.$ENV{PATH}; - $bindir = $DESTDIR . $bindir; - $libdir = $DESTDIR . $libdir; -} +$bindir = 'bin' unless $bindir; +$libdir = 'lib' unless $libdir; -use File::Spec::Functions; +chdir $DESTDIR if ($DESTDIR); my $filename; my $exe; @@ -115,7 +75,6 @@ # # parrot executable # --x $parrot or die "$parrot does not exist\n"; $exe = catfile($bindir, 'pbc_merge'); $out = `$exe`;