RE: [tcltk-perl] Makefile.PL cleanup [PATCH]
Brought to you by:
hobbs
From: Konovalov, V. <vko...@sp...> - 2004-04-14 12:50:59
|
Will apply this patch and a patch that you sent few letters ago :) BTW once CVS will be working on "tcltk" project of SF site, you will have write access and apply reasonable changes by your own? > > > Suggested cleanup patch for Tcl's Makefile.PL. It gets rid of badly > handcoded option parsing and replace it with Getopt::Long. Similar > patch also makes sense for the Tcl-Tk one. > > --Gisle > > Index: Makefile.PL > =================================================================== > RCS file: /cvsroot/tcltkce/Tcl/Makefile.PL,v > retrieving revision 1.3 > diff -u -p -u -r1.3 Makefile.PL > --- Makefile.PL 9 Apr 2004 19:05:23 -0000 1.3 > +++ Makefile.PL 14 Apr 2004 08:52:43 -0000 > @@ -1,33 +1,24 @@ > +#!/usr/bin/perl -w > + > # before running this script make sure you have 'tclsh' in > your path, > # and this 'tcl' distribution is required one. > # FreeBSD users may want to modify name of tcl interpreter (this is > # $tclsh variable below) as long as 'tclsh' does not work in > their case > > +use strict; > +use Getopt::Long qw(GetOptions); > + > my $tclsh = 'tclsh'; > my $tclconfig; > my $buildspec; > my $libpath; > my $incpath; > > -while (1) { > - # Handle any --options > - last unless @ARGV[0] =~ /^--/; > - my $opt = shift @ARGV; > - my $val = shift @ARGV; > - if ($opt eq "--tclsh") { > - $tclsh = $val; > - } > - elsif ($opt eq "--tclconfig") { > - $tclconfig = $val; > - } > - elsif ($opt eq "--buildspec") { > - $buildspec = 1; > - } > - else { > - die "unknown option '$opt', must be --tclsh, > --tclconfig or --buildspec\n"; > - } > -} > - > +GetOptions("tclsh=s", \$tclsh, > + "tclconfig=s", \$tclconfig, > + "buildspec", \$buildspec) > + || die "Usage: perl Makefile.PL [--tclsh <path>] > [--tclconfig <path>] " . > + "[--buildspec] > [<makemaker opts>...]\n"; > > if ($tclconfig) { > die "Tcl config file '$tclconfig' not found\n" unless > (-f $tclconfig); > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Tcltk-perl mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcltk-perl > |