]> granicus.if.org Git - apache/commitdiff
PR:
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 27 May 2000 17:47:02 +0000 (17:47 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 27 May 2000 17:47:02 +0000 (17:47 +0000)
Obtained from:
Submitted by:
Reviewed by:

  Prevent the .dsp project files from being touched if they were
  already cleanly converted.  Note that just loading the 6.0 .dsp
  in the 5.0 MSVC environment doesn't toggle the /ZI->/Zi option.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85315 13f79535-47bb-0310-9956-ffa450edef68

build/cvstodsp5.pl
build/dsp5tocvs.pl

index d04597fd686e19618ae0dca3fa29b925d8d6ad1b..1bec5dce82280976bd7a268c0aa3d861c66b5c7e 100644 (file)
@@ -8,20 +8,35 @@ sub tovc5 {
 
     if (m|.dsp$|) {
        $tname = '.#' . $_;
-       print "Convert VC6 project " . $_ . " to VC5 in " . $File::Find::dir . "\n"; 
+        $verchg = 0;
        $srcfl = new IO::File $_, "r" || die;
        $dstfl = new IO::File $tname, "w" || die;
        while ($src = <$srcfl>) {
-           $src =~ s|Format Version 6\.00|Format Version 5\.00|;
-#           This is BUCK UGLY... and I know there is a way to do it right... would someone fix?
-           $src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|;
-           $src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|;
+           if ($src =~ s|Format Version 6\.00|Format Version 5\.00|) {
+               $verchg = -1;
+           }
+           if ($src =~ s|^(# ADD CPP .*)/ZI (.*)|$1/Zi $2|) {
+               $verchg = -1;
+           }
+           if ($src =~ s|^(# ADD BASE CPP .*)/ZI (.*)|$1/Zi $2|) {
+               $verchg = -1;
+           }
            if ($src !~ m|^# PROP AllowPerConfigDependencies|) {
                print $dstfl $src; }
+           else {
+               $verchg = -1;
+
+           }
        }
        undef $srcfl;
        undef $dstfl;
-       unlink $_;
-       rename $tname, $_;
+       if ($verchg) {
+           unlink $_;
+           rename $tname, $_;
+           print "Converted VC6 project " . $_ . " to VC5 in " . $File::Find::dir . "\n"; 
+       }
+       else {
+           unlink $tname;
+       }
     }
 }
\ No newline at end of file
index ed1f080f8039d739635a73a995e94395bf488988..6cc89df31ce064a584afbcf2380da0de42b81eeb 100644 (file)
@@ -9,19 +9,23 @@ sub tovc6 {
     if (m|.dsp$|) {
        $tname = '.#' . $_;
        $verchg = 0;
-       print "Convert VC6 project " . $_ . " to VC5 in " . $File::Find::dir . "\n"; 
        $srcfl = new IO::File $_, "r" || die;
        $dstfl = new IO::File $tname, "w" || die;
        while ($src = <$srcfl>) {
            if ($src =~ s|Format Version 5\.00|Format Version 6\.00|) {
                $verchg = -1;
            }
-           $src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|;
-           $src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|;
+           if ($src =~ s|^(# ADD CPP .*)/Zi (.*)|$1/ZI $2|) {
+               $verchg = -1;
+           }
+           if ($src =~ s|^(# ADD BASE CPP .*)/Zi (.*)|$1/ZI $2|) {
+               $verchg = -1;
+           }
            if ($src =~ s|^(!MESSAGE .*)\\\n|$1|) {
-                $cont = <$srcfl>;
+               $cont = <$srcfl>;
                $src = $src . $cont;
-            }
+               $verchg = -1;
+           }
             print $dstfl $src; 
            if ($verchg && $src =~ m|^# Begin Project|) {
                print $dstfl "# PROP AllowPerConfigDependencies 0\n"; 
@@ -29,7 +33,13 @@ sub tovc6 {
        }
        undef $srcfl;
        undef $dstfl;
-       unlink $_;
-       rename $tname, $_;
+       if ($verchg) {
+           unlink $_;
+           rename $tname, $_;
+           print "Converted VC6 project " . $_ . " to VC5 in " . $File::Find::dir . "\n"; 
+       }
+       else {
+           unlink $tname;
+       }
     }
 }