From: William A. Rowe Jr Date: Sat, 27 May 2000 17:47:02 +0000 (+0000) Subject: PR: X-Git-Tag: APACHE_2_0_ALPHA_4~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d59289527e21e3275699c13ba529c32ae4b1bdb;p=apache PR: 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 --- diff --git a/build/cvstodsp5.pl b/build/cvstodsp5.pl index d04597fd68..1bec5dce82 100644 --- a/build/cvstodsp5.pl +++ b/build/cvstodsp5.pl @@ -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 diff --git a/build/dsp5tocvs.pl b/build/dsp5tocvs.pl index ed1f080f80..6cc89df31c 100644 --- a/build/dsp5tocvs.pl +++ b/build/dsp5tocvs.pl @@ -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; + } } }