File indexing completed on 2024-04-06 12:31:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 use strict;
0013 use Cwd;
0014 $|=1;
0015
0016 BEGIN
0017 {
0018 use Config;
0019 my $SCRAMINSTALLAREA = '/afs/cern.ch/cms/Releases/SCRAM/current/Installation/TT2/lib/perl5/site_perl';
0020 my $SCRAMSRC = $SCRAMINSTALLAREA."/".$Config{version}."/".$Config{archname};
0021
0022
0023 unshift(@INC, $SCRAMSRC);
0024 }
0025
0026 my ($name,$version,$toolbox)=@ARGV;
0027 my $templates=[ 'boot-nightly', 'requirements', 'BuildFile' ];
0028
0029
0030 use Template;
0031
0032
0033 my $templatedir='config';
0034
0035
0036 my $outputdir='config';
0037
0038
0039 my $template_config =
0040 {
0041 INCLUDE_PATH => $templatedir,
0042 EVAL_PERL => 1
0043 };
0044
0045
0046 my $template_engine = Template->new($template_config) || die $Template::ERROR, "\n";
0047 my $projectdata = {};
0048 my $packages = {};
0049
0050
0051
0052 if ($name ne '' &&
0053 $version ne '' &&
0054 $toolbox ne '')
0055 {
0056
0057 die "$0: Unable to find the config directory.","\n",unless (-d cwd()."/config");
0058
0059
0060 $projectdata->{'PROJECT_NAME'} = $name;
0061 $projectdata->{'PROJECT_VERSION'} = $version;
0062 $projectdata->{'CONFIG_VERSION'} = $toolbox;
0063
0064
0065 foreach my $file (@$templates)
0066 {
0067 $template_engine->process($file.".tmpl", $projectdata, $outputdir."/".$file)
0068 || die "Template error: ".$template_engine->error;
0069 }
0070 }
0071 else
0072 {
0073 die "Usage: $0 <NAME> <VERSION> <TOOLBOX>","\n";
0074 }
0075