cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Filename globbing


From: Zachary Deretsky
Subject: Filename globbing
Date: Fri, 17 Nov 2000 16:02:22 -0800

For my many sub-projects I need to install certain filetypes, if present,
into the EXPORT tree. And I do not want to force people to list these
files explicitly because the implicit system has been working for 4 years.

Below is my sample Conscript. My questions are:

1. Is there a more elegant way to achieve the same?

2. I use Link command, my build tree is different from my source tree.
I need to find the source directory to see if it has files of a certain
type.
I do know, that Conscript file itself is there, so I use it to find the
source directory. Is it safe to do that given the abundance of Conscript
files
in parallel directories?

Thanks, Zach.

---------------------------------------------------------------------------
# -*- Perl -*-

Import qw(CONS INCLUDE LIB BIN PYTHON SWIG TABLES BUILD BUILDTYPE EXPORT
DEFINES RULES);

($SELF=$0)=~s!^.*/!!;

$sourceDir = SourcePath "Conscript";
$sourceDir =~ s/Conscript//;
$sourceDir = $CONS->{ENV}{TOP} . '/' . $sourceDir;

opendir DIR, $sourceDir or die "$SELF: opendir $sourceDir: $!\n";
@allfiles=readdir(DIR);
closedir DIR or die "$SELF: closedir .: $!\n";

@py_files = grep { /\.py$/i } @allfiles;
@tbl_files = grep { /\.tbl$/i } @allfiles;

if(@py_files) {
    Install $CONS $PYTHON, @py_files;
}

if(@tbl_files) {
    Install $CONS $TABLE, @tbl_files;
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]