Changeset 417 in ProjectBuilder for devel/pb/lib


Ignore:
Timestamp:
Apr 27, 2008, 1:18:10 AM (18 years ago)
Author:
Bruno Cornec
Message:
  • Reintegrates $pbproj as variable for filter functions (needed for PBPROJ expansion)
  • Fix pbinit using perl functions support
  • Adds a virtual pbinit action support in pb_env_init
Location:
devel/pb/lib/ProjectBuilder
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/lib/ProjectBuilder/Env.pm

    r416 r417  
    2020use ProjectBuilder::Base;
    2121use ProjectBuilder::Conf;
     22use ProjectBuilder::CMS;
    2223
    2324# Inherit from the "Exporter" module which handles exporting functions.
    … …  
    174175#
    175176# Removes all directory existing below the delivery dir
    176 # as they are temp dir only
     177# as they are temp dir only except when called from pbinit
    177178# Files stay and have to be cleaned up manually if needed
    178179# those files serves as communication channels between pb phases
    179180# Removing them prevents a following phase to detect what has been done before
    180181#
    181 if (-d $ENV{'PBDESTDIR'}) {
     182if ((-d $ENV{'PBDESTDIR'}) && ($action !~ /pbinit/)) {
    182183    opendir(DIR,$ENV{'PBDESTDIR'}) || die "Unable to open directory $ENV{'PBDESTDIR'}: $!";
    183184    foreach my $d (readdir(DIR)) {
    … …  
    210211# return values in that case are useless
    211212#
    212 if (($action =~ /^cms2/) || ($action =~ /^newver$/)) {
     213if (($action =~ /^cms2/) || ($action =~ /^newver$/) || ($action =~ /^pbinit$/)) {
    213214
    214215    #
  • devel/pb/lib/ProjectBuilder/Filter.pm

    r415 r417  
    121121This function applies all filters to pb build files.
    122122
    123 It takes 15 parameters.
     123It takes 15 parameters. To be filtered a variable has to be passed to that function.
    124124
    125125The first parameter is the file to filter.
    … …  
    137137The thirteenth parameter is the packager name.
    138138The fourteenth parameter is the changelog.
     139The fifteenth parameter is the project.
    139140
    140141=cut
    … …  
    157158my $pbpackager = shift;
    158159my $chglog = shift || undef;
     160my $pbproj = shift;
    159161
    160162pb_log(2,"DEBUG: From $f to $destfile\n");
    … …  
    192194This function applies all filters to a file in place.
    193195
    194 It takes 8 parameters.
     196It takes 9 parameters.
    195197
    196198The first parameter is the pointer on the hash of filters.
    … …  
    202204The seventh parameter is the current date.
    203205The eighth parameter is the packager name.
     206The nineth parameter is the project name.
    204207
    205208=cut
    … …  
    217220my $pbdate=shift;
    218221my $pbpackager=shift;
     222my $pbproj=shift;
    219223
    220224my $cp = "$ENV{'PBTMP'}/".basename($destfile);
    221225copy($destfile,$cp) || die "Unable to create $cp";
    222226
    223 pb_filter_file($cp,$ptr,$destfile,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$pbpackager);
     227pb_filter_file($cp,$ptr,$destfile,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$pbpackager,$pbproj);
    224228unlink $cp;
    225229}
    … …  
    229233This function applies all filters on a file to generate a new filtered one.
    230234
    231 It takes 9 parameters.
     235It takes 10 parameters. To be filtered a variable has to be passed to that function.
    232236
    233237The first parameter is the original file to filter.
    … …  
    240244The eighth parameter is the current date.
    241245The nineth parameter is the packager name.
     246The tenth parameter is the project name.
    242247
    243248=cut
    … …  
    257262my $pbdate=shift;
    258263my $pbpackager=shift;
     264my $pbproj=shift;
    259265
    260266pb_log(2,"DEBUG: From $f to $destfile\n");
Note: See TracChangeset for help on using the changeset viewer.