cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] some more changes to testcurl.pl

From: Guenter Knauf <eflash_at_gmx.net>
Date: Mon, 28 Jun 2004 18:34:33 +0200

Hi Daniel,
I found that it was never possible to specify a daily-dir directly at first time when no setup exists;
and the same happens also with my --target option....
I think we need to shift the @ARGV so that @ARGV is empty when we enter the setup creation.
The patch below fixes this; added a close() which I believe was forgotten after the setup file write;
also I've added a --setup option so that you can now specify different setup files; and for NetWare I append the $targetos to the setup filename; however I would like to move that line so that it is active for all platforms which have a target OS defined. This would however break any automatic builds of platforms where the $targetos is set; currently the only one affected who builds a platform where $targetos is set - beside me - is Greg Hewgill with his MSVC build, but I dont see that he does automatically build from cron; so the only thing he had to do would be either rename his setup to setup-vc, or just create a new one... - that's all...

the benefit of this change is that it is then easily possible to build more than one target, each with different description, from one curl source dir...

please let me know if you agree.

thanks, Guenter.

--- testcurl.pl.orig Sun Jun 27 01:29:37 2004
+++ testcurl.pl Mon Jun 28 16:49:52 2004
@@ -34,9 +34,7 @@
 # curl site, at http://curl.haxx.se/auto/
 
 # USAGE:
-# testcurl.pl [curl-daily-name] > output
-# or:
-# testcurl.pl --target=your_os > output
+# testcurl.pl [--target=your_os] [curl-daily-name] > output
 
 # Updated:
 # v1.7 22-Jun-04 - added --target option for other platform targets.
@@ -54,21 +52,25 @@
 
 use vars qw($version $fixed $infixed $CURLDIR $CVS $pwd $build $buildlog
             $buildlogname $gnulikebuild $targetos $confsuffix $binext);
-use vars qw($name $email $desc $confopts);
+use vars qw($name $email $desc $confopts $setupfile);
 
 # version of this script
-$version='$Revision: 1.7 $';
+$version='$Revision: 1.8 $';
 $fixed=0;
 
 # Determine if we're running from CVS or a canned copy of curl,
-# or if we got a specific target option
+# or if we got a specific target option or setup file option.
 $CURLDIR="curl";
 $CVS=1;
-if (@ARGV && $ARGV[0]) {
+$targetos = '';
+$setupfile = 'setup';
+while ($ARGV[0]) {
   if ($ARGV[0] =~ /--target=/) {
- $targetos = (split(/=/, $ARGV[0]))[1];
+ $targetos = (split(/=/, shift @ARGV))[1];
+ } elsif ($ARGV[0] =~ /--setup=/) {
+ $setupfile = (split(/=/, shift @ARGV))[1];
   } else {
- $CURLDIR=$ARGV[0];
+ $CURLDIR=shift @ARGV;
     $CVS=0;
   }
 }
@@ -77,9 +79,9 @@
 $gnulikebuild = 1;
 $confsuffix = '';
 $binext = '';
-if ($^O eq 'MSWin32' || defined($targetos)) {
+if ($^O eq 'MSWin32' || $targetos ne '') {
   $gnulikebuild = 0;
- if (!defined($targetos)) {
+ if ($targetos eq '') {
     # If no target defined on Win32 lets assume vc
     $targetos = 'vc';
   }
@@ -89,6 +91,7 @@
   } elsif ($targetos =~ /netware/) {
     $confsuffix = '-netware';
     $binext = '.nlm';
+ $setupfile .= "-$targetos" if ($setupfile eq 'setup');
   }
 }
 
@@ -145,7 +148,7 @@
     exit 1;
 }
 
-if (open(F, "setup")) {
+if (open(F, "$setupfile")) {
   while (<F>) {
     if (/(\w+)=(.*)/) {
       eval "\$$1=$2;";
@@ -190,12 +193,13 @@
 
 
 if ($fixed > 0) {
- open(F, ">setup") or die;
+ open(F, ">$setupfile") or die;
   print F "name='$name'\n";
   print F "email='$email'\n";
   print F "desc='$desc'\n";
   print F "confopts='$confopts'\n";
   print F "fixed='$fixed'\n";
+ close(F);
 }
 
 logit "STARTING HERE"; # first line logged
@@ -215,15 +219,15 @@
 
 if (-d $CURLDIR) {
   if ($CVS && -d "$CURLDIR/CVS") {
- logit "curl is verified to be a fine source dir";
+ logit "$CURLDIR is verified to be a fine source dir";
     # remove the generated sources to force them to be re-generated each
     # time we run this test
     unlink "$CURLDIR/lib/getdate.c";
     unlink "$CURLDIR/src/hugehelp.c";
   } elsif (!$CVS && -f "$CURLDIR/tests/testcurl.pl") {
- logit "curl is verified to be a fine daily source dir"
+ logit "$CURLDIR is verified to be a fine daily source dir"
   } else {
- mydie "curl is not a daily source dir or checked out from CVS!"
+ mydie "$CURLDIR is not a daily source dir or checked out from CVS!"
   }
 }
 $build="build-$$";
@@ -412,7 +416,7 @@
   mydie "src/curl was not created (curl$binext)";
 }
 
-if (defined($targetos) && $targetos =~ /netware/) {
+if ($targetos ne '' && $targetos =~ /netware/) {
   #system('../../curlver.sh');
 } else {
 logit "display curl$binext --version output";

Received on 2004-06-28