forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathctquery.pl
More file actions
37 lines (35 loc) · 892 Bytes
/
ctquery.pl
File metadata and controls
37 lines (35 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# return the attached flavor of given project (or empty string)
sub CTQueryProj {
local( $projs ) = $ENV{"CTPROJS"} ;
local( @projlist ) ;
@projlist = split( / +/, $projs ) ;
local( $pair ) ;
local( @pairlist ) ;
local( $ret ) = "" ;
foreach $pair ( @projlist ) {
@pairlist = split( /:/, $pair ) ;
$pairlist[0] =~ tr/A-Z/a-z/ ;
if ( $pairlist[0] eq $_[0] ) {
$ret = $pairlist[1] ;
}
}
$ret ;
}
# return all projects attached with a given flavor
sub CTQueryFlav {
local( $projs ) = $ENV{"CTPROJS"} ;
local( @projlist ) ;
@projlist = split( / +/, $projs ) ;
local( $pair ) ;
local( @pairlist ) ;
local( $ret ) = "" ;
foreach $pair ( @projlist ) {
@pairlist = split( /:/, $pair ) ;
if ( $pairlist[1] eq $_[0] ) {
$pairlist[0] =~ tr/A-Z/a-z/ ;
$ret = $ret . " $pairlist[0]" ;
}
}
$ret ;
}
1;