Changeset 417 in ProjectBuilder for devel/pb


Ignore:
Timestamp:
Apr 27, 2008, 1:18:10 AM (16 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
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/Makefile.PL

    r405 r417  
    2020    MAN3PODS      => {  'lib/ProjectBuilder/CMS.pm' => '$(INST_MAN3DIR)/ProjectBuilder::CMS.$(MAN3EXT)',
    2121                        'lib/ProjectBuilder/Filter.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Filter.$(MAN3EXT)',
    22                         'lib/ProjectBuilder/Changelog.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Changelog.$(MAN3EXT)', },
     22                        'lib/ProjectBuilder/Changelog.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Changelog.$(MAN3EXT)',
     23                        'lib/ProjectBuilder/Env.pm' => '$(INST_MAN3DIR)/ProjectBuilder::Env.$(MAN3EXT)', },
    2324);
  • devel/pb/bin/pb

    r416 r417  
    552552            if (defined $ptr) {
    553553                foreach my $f (values %bfiles,values %pkgfiles) {
    554                     pb_filter_file_pb("$ENV{'PBROOTDIR'}/$f",$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$dtype,$pbsuf,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$defpkgdir,$extpkgdir,$ENV{'PBPACKAGER'},$chglog);
     554                    pb_filter_file_pb("$ENV{'PBROOTDIR'}/$f",$ptr,"$dest/pbconf/$ddir-$dver/".basename($f),$dtype,$pbsuf,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$defpkgdir,$extpkgdir,$ENV{'PBPACKAGER'},$chglog,$ENV{'PBPROJ'});
    555555                }
    556556            }
     
    574574        if (defined $filteredfiles->{$pbpkg}) {
    575575            foreach my $f (split(/,/,$filteredfiles->{$pbpkg})) {
    576                 pb_filter_file_inplace($ptr,"$dest/$f",$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$ENV{'PBPACKAGER'});
     576                pb_filter_file_inplace($ptr,"$dest/$f",$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$ENV{'PBPACKAGER'},$ENV{'PBPROJ'});
    577577                $liste = "$f $liste";
    578578            }
     
    582582        # Prepare the dest directory for archive
    583583        if (-x "$ENV{'PBROOTDIR'}/$pbpkg/pbinit") {
    584             pb_filter_file("$ENV{'PBROOTDIR'}/$pbpkg/pbinit",$ptr,"$ENV{'PBTMP'}/pbinit",$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$ENV{'PBPACKAGER'});
     584            pb_filter_file("$ENV{'PBROOTDIR'}/$pbpkg/pbinit",$ptr,"$ENV{'PBTMP'}/pbinit",$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$ENV{'PBPACKAGER'},$ENV{'PBPROJ'});
    585585            chmod 0755,"$ENV{'PBTMP'}/pbinit";
    586586            pb_system("cd $dest ; $ENV{'PBTMP'}/pbinit","Executing init script from $ENV{'PBROOTDIR'}/$pbpkg/pbinit");
     
    824824        }
    825825    }
     826    # Adds conf file for availanility of conf elements
     827    pb_conf_add("$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb");
     828
    826829    if (($cmt eq "vm") || ($cmt eq "ve")) {
    827830        $src="$src $ENV{'PBDESTDIR'}/pbscript $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb $ENV{'PBDESTDIR'}/$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.pb $ENV{'PBETC'} $ENV{'PBDESTDIR'}/pbrc";
    828         # Adds conf file used for final delivery
    829         pb_conf_add("$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb");
    830831    } elsif ($cmt eq "Script") {
    831832        $src="$src $ENV{'PBDESTDIR'}/pbscript";
  • 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.