sbsv1/abld/genutil/emkdir.pl
author lorewang
Wed, 01 Dec 2010 16:05:36 +0800
changeset 715 e0739b8406dd
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Specify extenal tool with path
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     2
# All rights reserved.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     3
# This component and the accompanying materials are made available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     4
# under the terms of "Eclipse Public License v1.0"
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     5
# which accompanies this distribution, and is available
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     7
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     8
# Initial Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    10
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    11
# Contributors:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    12
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    13
# Description:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    14
#
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
use File::Path;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
# THE MAIN PROGRAM SECTION
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
	unless (@ARGV) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
		&Usage();
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
	my $originalPath = join (' ',@ARGV);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
	print ("Creating $originalPath\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
#	temp change for old perl
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
	foreach (@ARGV) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
		s-\\-\/-go;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
	mkpath([@ARGV]);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
	foreach my $path (@ARGV) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
	    if (! -e $path) {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
		print ("ERROR: Couldn't create $path\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
	    }
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
	}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
sub Usage () {
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
	print <<ENDHERESTRING;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
Usage : perl emkdir.pl list_of_directories
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
  Creates the directories listed
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
ENDHERESTRING
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
	exit 1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
}