diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2004-08-12 14:44:27 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2004-08-12 14:44:27 +0000 |
commit | ee3f7a8cec0a30ed9fd4746b91f3f754ecbe92c9 (patch) | |
tree | 551d06ffc150e64a691d61369f7213ae0d1029ed /clone_build_tree.pl | |
parent | bbb914781a30ca3c398ab91c09007f7378f80f0f (diff) | |
download | MPC-ee3f7a8cec0a30ed9fd4746b91f3f754ecbe92c9.tar.gz |
ChangeLogTag: Thu Aug 12 09:42:55 2004 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'clone_build_tree.pl')
-rwxr-xr-x | clone_build_tree.pl | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/clone_build_tree.pl b/clone_build_tree.pl index 4515e85f..ae308a1a 100755 --- a/clone_build_tree.pl +++ b/clone_build_tree.pl @@ -38,6 +38,9 @@ my(@foundFiles) = (); my($version) = '$Id$'; $version =~ s/.*\s+(\d+[\.\d]+)\s+.*/$1/; +eval 'symlink("", "");'; +my($hasSymlink) = ($@ eq ''); + # ****************************************************************** # Subroutine Section # ****************************************************************** @@ -395,26 +398,20 @@ sub usageAndExit { } my($base) = basename($0); my($spc) = ' ' x (length($base) + 8); - if ($^O eq 'MSWin32') { - print STDERR "$base v$version\n", - "Usage: $base [-b <builddir>] [-l] [-v] ", - "[build names...]\n\n", - "-b Set the build directory. It defaults to the ", - "<current directory>/build.\n", - "-v Enables verbose mode.\n"; - } - else { - print STDERR "$base v$version\n", - "Usage: $base [-a] [-b <builddir>] [-d <dmode>] ", - "[-l] [-v]\n", - $spc, "[build names...]\n\n", - "-a Use absolute paths when creating soft links.\n", - "-b Set the build directory. It defaults to the ", - "<current directory>/build.\n", - "-d Set the directory permissions mode.\n", - "-l Use hard links instead of soft links.\n", - "-v Enables verbose mode.\n"; - } + + print STDERR "$base v$version\n", + "Usage: $base [-b <builddir>] [-d <dmode>] ", + ($hasSymlink ? "[-a] [-l] " : ''), + "[-v]\n", + $spc, "[build names...]\n\n", + ($hasSymlink ? + "-a Use absolute paths when creating soft links.\n" . + "-l Use hard links instead of soft links.\n" : ''), + "-b Set the build directory. It defaults to the ", + "<current directory>/build.\n", + "-d Set the directory permissions mode.\n", + "-v Enable verbose mode.\n"; + exit(0); } @@ -425,7 +422,7 @@ sub usageAndExit { my($dmode) = 0777; my($absolute) = 0; -my($hardlink) = ($^O eq 'MSWin32'); +my($hardlink) = !$hasSymlink; my($builddir) = getcwd() . '/build'; my(@builds) = (); |