diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2003-05-12 12:40:49 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2003-05-12 12:40:49 +0000 |
commit | 472909c662622c345c45ddf76f0091d742955239 (patch) | |
tree | 038e9efcd623563508bd1fdd3ebcfa9f4856dc6d | |
parent | d5280135626fefa44de8bc875075bd4a9d2eb981 (diff) | |
download | ATCD-472909c662622c345c45ddf76f0091d742955239.tar.gz |
ChangeLogTag: Mon May 12 07:39:29 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/ProjectCreator.pm | 32 |
2 files changed, 40 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog index f59741160a1..ae2c02598f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,22 @@ +Mon May 12 07:39:29 2003 Chad Elliott <elliott_c@ociweb.com> + + * bin/MakeProjectCreator/modules/ProjectCreator.pm: + + Added code to compare the output project with the existing + project. If they are the same then do not overwrite the project + file. This is very helpful when your workspace is loaded in vc6 + or vc7. + Fri May 9 16:55:17 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> - * THANKS: Added Thomas Wiegert to the hal of fame. + * THANKS: Added Thomas Wiegert to the hal of fame. Fri May 09 12:57:09 2003 Nanbor Wang <nanbor@cs.wustl.edu> * bin/MakeProjectCreator/config/ciao_client.mpb: * bin/MakeProjectCreator/config/ciao_component.mpb: Added more - directories into libpaths to reflect recent TAO subsetting - efforts. + directories into libpaths to reflect recent TAO subsetting + efforts. Fri May 9 12:49:42 2003 Chad Elliott <elliott_c@ociweb.com> diff --git a/bin/MakeProjectCreator/modules/ProjectCreator.pm b/bin/MakeProjectCreator/modules/ProjectCreator.pm index 3ef0a66deb5..3657771cb7c 100644 --- a/bin/MakeProjectCreator/modules/ProjectCreator.pm +++ b/bin/MakeProjectCreator/modules/ProjectCreator.pm @@ -13,6 +13,7 @@ package ProjectCreator; use strict; use FileHandle; use File::Path; +use File::Compare; use File::Basename; use Creator; @@ -1743,19 +1744,42 @@ sub write_output_file { mkpath($dir, 0, 0777); } - if (open($fh, ">$name")) { + ## First write the output to a temporary file + my($tmp) = "MPC$>.$$"; + my($different) = 1; + if (open($fh, ">$tmp")) { my($lines) = $tp->get_lines(); foreach my $line (@$lines) { print $fh $line; } close($fh); - - $self->add_file_written($name); + if (compare($tmp, $name) == 0) { + $different = 0; + } } else { - $error = "ERROR: Unable to open $name for output."; + $error = "ERROR: Unable to open $tmp for output."; $status = 0; } + + if ($status) { + ## If they are different, then rename the temporary file + if ($different) { + unlink($name); + if (rename($tmp, $name)) { + $self->add_file_written($name); + } + else { + $error = "ERROR: Unable to open $name for output."; + $status = 0; + } + } + else { + ## We will pretend that we wrote the file + unlink($tmp); + $self->add_file_written($name); + } + } } } } |