sbsv1/abld/e32util/listfeaturevariants.pl
author William Roberts <williamr@symbian.org>
Fri, 22 Oct 2010 12:33:01 +0100
changeset 651 0d0d83e3702d
parent 599 fa7a3cc6effd
permissions -rw-r--r--
Enhance buildrom.pm to enable final OBY file to be converted into acceptable input for buildrom (Bug 3862)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
# Copyright (c) 2007-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
# list A.X.aaa for all X (32 chars) when given A.aaa
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
# 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
#
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
my $source = shift;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
# list invariant
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
print "$source\n" if (-f $source);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
# now think about variants
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
use File::Basename;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
my $srcDir = dirname($source);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
my $srcRoot = basename($source);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
my $srcExt = "";
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
if ($srcRoot =~ /^(.+)\.([^\.]+)$/)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
	$srcRoot = $1;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
	$srcExt = $2;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
opendir(DIR, $srcDir) or die("ERROR: cannot read directory $srcDir\n");
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
# list all variants
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
while (my $file = readdir(DIR))
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
{
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
	print "$srcDir\\$file\n" if ($file =~ /^$srcRoot\.(\w{32})\.$srcExt$/i);
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
exit 1 if (!closedir(DIR));
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
exit 0;
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47