diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2004-07-28 14:16:39 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2004-07-28 14:16:39 +0000 |
commit | 4c3321e420a7526bd9c3a4a8949b9f092b695c25 (patch) | |
tree | e88b0c71d3f728c71c55c906ed7905a4666c80d3 /clone_build_tree.pl | |
parent | b6de6b085a84c706031aa4ecd098ee9a78c7dbfb (diff) | |
download | MPC-4c3321e420a7526bd9c3a4a8949b9f092b695c25.tar.gz |
ChangeLogTag: Wed Jul 28 09:15:02 2004 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'clone_build_tree.pl')
-rwxr-xr-x | clone_build_tree.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clone_build_tree.pl b/clone_build_tree.pl index abbc5f58..4515e85f 100755 --- a/clone_build_tree.pl +++ b/clone_build_tree.pl @@ -32,10 +32,11 @@ use File::Basename; # Data Section # ****************************************************************** -my($version) = '0.2'; my($exclude) = undef; my($verbose) = 0; my(@foundFiles) = (); +my($version) = '$Id$'; +$version =~ s/.*\s+(\d+[\.\d]+)\s+.*/$1/; # ****************************************************************** # Subroutine Section @@ -129,6 +130,7 @@ sub backupAndMoveModified { $status = 0; ## Move the real file to a backup + unlink("$realpath.bak"); if (rename($realpath, "$realpath.bak")) { ## Move the linked file to the real file name if (move($linkpath, $realpath)) { @@ -152,6 +154,7 @@ sub backupAndMoveModified { if (!$status) { ## We were not able to properly deal with this file. We will ## attempt to preserve the modified file. + unlink("$linkpath.bak"); rename($linkpath, "$linkpath.bak"); } } @@ -207,7 +210,8 @@ sub symlinkFiles { my($stat) = stat($fullpath); if ($stat->nlink() > 1) { print STDERR "ERROR: Attempting to mix softlinks ", - "with a hardlink build.\n"; + "with a hardlink build.\n", + "$fullpath has ", $stat->nlink(), " links.\n"; return 1; } } @@ -286,7 +290,8 @@ sub hardlinkFiles { ## and softlinks. if (-l $fullpath) { print STDERR "ERROR: Attempting to mix hardlinks ", - "with a softlink build.\n"; + "with a softlink build.\n", + "$fullpath is a softlink.\n"; return 1; } backupAndMoveModified($file, $fullpath); |