Removed /usr/local from CDPATH
[clearscm.git] / cq / listdynlists
1 #!cqperl
2 ################################################################################
3 #
4 # File:         listdynlists
5 # Description:  This script lists the dynamic lists in the database...
6 #
7 # Author:       Andrew@DeFaria.com
8 # Created:      Fri Sep 23 17:27:58 PDT 2005
9 # Language:     Perl
10 #
11 # (c) Copyright 2005, Andrew@DeFaria.com, all rights reserved
12 #
13 ################################################################################
14 use strict;
15 use warnings;
16 use CQPerlExt;
17 use File::Spec;
18
19 our ($me, $SEPARATOR);
20
21 my ($abs_path, $lib_path);
22
23 BEGIN {
24   # Extract relative path and basename from script name.
25   $0 =~ /(.*)[\/\\](.*)/;
26
27   $abs_path   = (!defined $1) ? "." : File::Spec->rel2abs ($1);
28   $me         = (!defined $2) ? $0  : $2;
29   $me         =~ s/\.pl$//;
30
31   # Remove .pl for Perl scripts that have that extension
32   $me         =~ s/\.pl$//;
33
34   # Define the path SEPARATOR
35   $SEPARATOR  = ($^O =~ /MSWin/) ? "\\" : "/";
36
37   # Setup paths
38   $lib_path   = "$abs_path" . $SEPARATOR . ".." . $SEPARATOR . "lib";
39
40   # Add the appropriate path to our modules to @INC array.
41   unshift (@INC, "$abs_path");
42   unshift (@INC, "$lib_path");
43 } # BEGIN
44
45 use PQA;
46 use Display;
47
48 my @dynamic_lists = (
49   "Advanced_Feature",
50   "Board_Revision",
51   "HUT",
52   "HUT_Revision",
53   "OS",
54   "OS_Service_Pack",
55   "Other_HUT",
56   "Project",
57   "Reported_By",
58   "Software",
59   "Visibility",
60 );
61
62 my $to_db_connection_name       = "2005.02.00";
63 my $controller                  = StartSession "Cont", $to_db_connection_name;
64
65 foreach (@dynamic_lists) {
66   display "\nDynamic List: $_";
67   my @values = @{$controller->GetListMembers ($_)};
68   my $i = 0;
69
70   foreach (@values) {
71     display "\t" . ++$i . ") $_";
72   } # foreach
73 } # foreach
74
75 EndSession $controller;