apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r397409 - /apr/apr/trunk/build/cvtdsp.pl
Date Thu, 27 Apr 2006 05:33:03 GMT
Author: wrowe
Date: Wed Apr 26 22:33:00 2006
New Revision: 397409

URL: http://svn.apache.org/viewcvs?rev=397409&view=rev
Log:

  How was httpd commit magic created?  -2005 option, freshly minted,
  to clean up /GX and /machine:i386 flags.

Modified:
    apr/apr/trunk/build/cvtdsp.pl

Modified: apr/apr/trunk/build/cvtdsp.pl
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/build/cvtdsp.pl?rev=397409&r1=397408&r2=397409&view=diff
==============================================================================
--- apr/apr/trunk/build/cvtdsp.pl (original)
+++ apr/apr/trunk/build/cvtdsp.pl Wed Apr 26 22:33:00 2006
@@ -7,6 +7,9 @@
 elsif ($ARGV[0] eq '-5') {
     find(\&tovc5, '.');
 }
+elsif ($ARGV[0] eq '-2005') {
+    find(\&tovc2005, '.');
+}
 elsif ($ARGV[0] eq '-w3') {
     find(\&tow3, '.');
 }
@@ -113,6 +116,36 @@
 	    unlink $oname || die;
 	    rename $tname, $oname || die;
 	    print "Converted VC5 project " . $oname . " to VC6 in " . $File::Find::dir . "\n"; 
+	}
+	else {
+	    unlink $tname;
+	}
+    }
+}
+
+sub tovc2005 { 
+
+    if (m|\.dsp$| || m|\.mak$|) {
+        $oname = $_;
+	$tname = '.#' . $_;
+	$verchg = 0;
+	$srcfl = new IO::File $_, "r" || die;
+	$dstfl = new IO::File $tname, "w" || die;
+	while ($src = <$srcfl>) {
+	    if ($src =~ s|(\bCPP.*) /GX(.*)|$1 /EHsc$2|) {
+		$verchg = -1;
+	    }
+	    if ($src =~ s|(\bLINK32.*) /machine:I386(.*)|$1$2|) {
+		$verchg = -1;
+	    }
+            print $dstfl $src; 
+	}
+	undef $srcfl;
+	undef $dstfl;
+	if ($verchg) {
+	    unlink $oname || die;
+	    rename $tname, $oname || die;
+	    print "Converted project " . $oname . " to 2005 in " . $File::Find::dir . "\n"; 
 	}
 	else {
 	    unlink $tname;



Mime
View raw message