You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by jb...@locus.apache.org on 2000/09/06 23:55:42 UTC

cvs commit: xml-xerces/c/Projects/MacOS ShortenFiles.pl

jberry      00/09/06 14:55:42

  Modified:    c/Projects/MacOS ShortenFiles.pl
  Log:
  Allow ShortenFiles to work even when the destination directory already exists
  
  Revision  Changes    Path
  1.4       +23 -8     xml-xerces/c/Projects/MacOS/ShortenFiles.pl
  
  Index: ShortenFiles.pl
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/Projects/MacOS/ShortenFiles.pl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ShortenFiles.pl	2000/08/03 21:17:39	1.3
  +++ ShortenFiles.pl	2000/09/06 21:55:40	1.4
  @@ -1,3 +1,17 @@
  +#
  +#	ShortenFiles.pl
  +#
  +#	Shorten file names to fit Mac HFS 31 character name limit. Names
  +#	are shortened using a table of hints.
  +#
  +
  +#
  +#	$Log: ShortenFiles.pl,v $
  +#	Revision 1.4  2000/09/06 21:55:40  jberry
  +#	Allow ShortenFiles to work even when the destination directory already exists
  +#	
  +#
  +
   use Config;
   use FindBin;
   use File::Find;
  @@ -37,13 +51,13 @@
   	["Parent",			"Par"		],
   	["Fragment",		"Frag"		],
   	["Construction",	"Constr"	],
  -	["Default",		"Def"		],
  +	["Default",			"Def"		],
   	["Processor",		"Proc"		],
  -	["Compare",		"Comp"		],
  +	["Compare",			"Comp"		],
   	["Execution",		"Exe"		],
  -	["Functor",		"Func"		],
  +	["Functor",			"Func"		],
   	["Collation",		"Col"		],
  -	["Element",		"El"		],
  +	["Element",			"El"		],
   );
   
   sub GetPathSeparator
  @@ -146,11 +160,14 @@
   	
   #print "srcName $srcName, dstName $dstName, srcPath $srcPath, dstPath $dstPath\n";
   	
  -	if (-d $srcPath && not -e $dstPath)
  +	if (-d $srcPath)
   	{
  -		# make the dst directory
  -		print "Making directory $dstPath\n";
  -		mkpath($dstPath);
  +		# make the dst directory if it doesn't already exist
  +		if (not -e $dstPath)
  +		{
  +			print "Making directory $dstPath\n";
  +			mkpath($dstPath);
  +		}
   	}
   	else
   	{
  @@ -216,6 +233,7 @@
   print "\n";
   
   #-- Scan phase
  +#NOTE: we actually don't limit our processing to the file types listed here!!!
   #for each .cpp or .hpp or .c or .cc file in tree
   #	if name too long
   #		shorten the name