[Box Backup-dev] COMMIT r405 - box/chris/win32/vc2005-compile-fixes/infrastructure

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Wed, 8 Feb 2006 00:17:24 +0000 (GMT)


Author: chris
Date: 2006-02-08 00:17:11 +0000 (Wed, 08 Feb 2006)
New Revision: 405

Modified:
   box/chris/win32/vc2005-compile-fixes/infrastructure/makeparcels.pl
Log:
* makeparcels.pl
- Added support for optional items (only copied if present) in parcels


Modified: box/chris/win32/vc2005-compile-fixes/infrastructure/makeparcels.pl
===================================================================
--- box/chris/win32/vc2005-compile-fixes/infrastructure/makeparcels.pl	2006-02-07 23:52:49 UTC (rev 404)
+++ box/chris/win32/vc2005-compile-fixes/infrastructure/makeparcels.pl	2006-02-08 00:17:11 UTC (rev 405)
@@ -113,6 +113,12 @@
 	for(@{$parcel_contents{$parcel}})
 	{
 		my ($type,$name) = split /\s+/;
+		my $optional = '';
+
+		if ($type eq 'optional')
+		{
+			($optional,$type,$name) = split /\s+/;
+		}
 		
 		if($type eq 'bin')
 		{
@@ -122,7 +128,14 @@
 		}
 		elsif ($type eq 'script')
 		{
-			print MAKE "\tcp $name $dir\n";
+			if ($optional)
+			{
+				print MAKE "\ttest -r $name && cp $name $dir\n";
+			}
+			else
+			{
+				print MAKE "\tcp $name $dir\n";
+			}
 			# remove path from script name
 			$name =~ m~/([^/]+)\Z~;
 			$name = $1;