|
1 # Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 # All rights reserved. |
|
3 # This component and the accompanying materials are made available |
|
4 # under the terms of "Eclipse Public License v1.0" |
|
5 # which accompanies this distribution, and is available |
|
6 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 # |
|
8 # Initial Contributors: |
|
9 # Nokia Corporation - initial contribution. |
|
10 # |
|
11 # Contributors: |
|
12 # |
|
13 # Description: |
|
14 # Script to set a P$ Client |
|
15 # |
|
16 # |
|
17 |
|
18 use strict; |
|
19 use FindBin; # for FindBin::Bin |
|
20 use Getopt::Long; |
|
21 |
|
22 use lib $FindBin::Bin; |
|
23 |
|
24 use SetP4Client; |
|
25 |
|
26 # Process the commandline |
|
27 my ($iCodeline, $iDrive, $iType) = ProcessCommandLine(); |
|
28 |
|
29 # Sync the source |
|
30 &SetP4Client::Start( $iCodeline, $iDrive, $iType); |
|
31 |
|
32 # ProcessCommandLine |
|
33 # |
|
34 # Inputs |
|
35 # |
|
36 # Outputs |
|
37 # |
|
38 # Description |
|
39 # This function processes the commandline |
|
40 |
|
41 sub ProcessCommandLine { |
|
42 my ($iHelp, $iCodeline, $iDrive, $iType); |
|
43 GetOptions('h' => \$iHelp, 'l=s' => \$iCodeline, 'd=s' => \$iDrive, 't=s' => \$iType); |
|
44 |
|
45 if (($iHelp) || (!defined $iCodeline) || (!defined $iDrive) || (!defined $iType)) |
|
46 { |
|
47 Usage(); |
|
48 } |
|
49 else |
|
50 { |
|
51 return($iCodeline, $iDrive, $iType); |
|
52 } |
|
53 } |
|
54 |
|
55 # Usage |
|
56 # |
|
57 # Output Usage Information. |
|
58 # |
|
59 |
|
60 sub Usage { |
|
61 print <<USAGE_EOF; |
|
62 |
|
63 Usage: SetP4Client.pl [options] |
|
64 |
|
65 options: |
|
66 |
|
67 -h help |
|
68 -l Code line to create the client |
|
69 -d Perforce Root |
|
70 -t Type of Build |
|
71 |
|
72 Code line must be entered without white spaces or new line |
|
73 characters where view is separated by + |
|
74 The word CLIENTNAME is automatically replaced with the correct clientname |
|
75 e.g. //EPOC/Release/Generic/7.0/...+//CLIENTNAME/... |
|
76 |
|
77 USAGE_EOF |
|
78 exit 1; |
|
79 } |