Changeset 409 in ProjectBuilder for devel/pb/lib/ProjectBuilder/Filter.pm


Ignore:
Timestamp:
Apr 25, 2008, 3:13:55 PM (16 years ago)
Author:
Bruno Cornec
Message:
  • Document all reusable functions in pb
  • remove the useless pbproj parameter from pb_filter functions
  • Addition and use of pb_conf_init and pb_conf_add in pb
  • Addition and use of pb_conf_fromfile_if in Conf.pm
  • preparation for 0.9.1
  • Update of pbinit files for mondo to support the new interface of pb_filter functions
File:
1 edited

Legend:

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

    r405 r409  
    3535=head1 NAME
    3636
    37 ProjectBuilder::Base, part of the project-builder.org - module dealing with generic functions suitable for perl project development
     37ProjectBuilder::Filter, part of the project-builder.org
    3838
    3939=head1 DESCRIPTION
    4040
    41 pb helps you build various packages directly from your project sources.
    42 Those sources could be handled by a CMS (Configuration Management System)
    43 such as Subversion, CVS, ... or being a simple reference to a compressed tar file.
    44 It's based on a set of configuration files, a set of provided macros to help
    45 you keeping build files as generic as possible. For example, a single .spec
    46 file should be required to generate for all rpm based distributions, even
    47 if you could also have multiple .spec files if required.
    48 
    49 =cut
    50 
    51 # Get all filters to apply
    52 # They're cumulative from less specific to most specific
    53 # suffix is .pbf
     41This module provides filtering functions suitable for pbinit calls.
     42
     43=item B<pb_get_filters>
     44
     45This function gets all filters to apply. They're cumulative from the less specific to the most specific.
     46
     47Suffix of those filters is .pbf. Filter all.pbf applies to whatever distribution. The pbfilter directory may be global under pbconf or per package, for overloading values. Then in order filters are loaded for distribution type, distribution family, distribution name, distribution name-version.
     48
     49The first parameter is the package name.
     50The second parameter is the distribution type.
     51The third parameter is the distribution family.
     52The fourth parameter is the distribution name.
     53The fifth parameter is the distribution version.
     54
     55The function returns a pointer on a hash of filters.
     56
     57=cut
    5458
    5559sub pb_get_filters {
     
    113117}
    114118
    115 # Function which applies filter on pb build files
     119=item B<pb_filter_file_pb>
     120
     121This function applies all filters to pb build files.
     122
     123It takes 15 parameters.
     124
     125The first parameter is the file to filter.
     126The second parameter is the pointer on the hash of filters.
     127The third parameter is the destination file after filtering.
     128The fourth parameter is the distribution type.
     129The fifth parameter is the suffix of the distribution.
     130The sixth parameter is the package name.
     131The seventh parameter is the version of the package.
     132The eighth parameter is the tag of the package.
     133The nineth parameter is the revision of the package.
     134The tenth parameter is the current date.
     135The eleventh parameter is the list of required packages.
     136The twelveth parameter is the list of optional packages.
     137The thirteenth parameter is the packager name.
     138The fourteenth parameter is the changelog.
     139
     140=cut
     141
    116142sub pb_filter_file_pb {
    117143
     
    122148my $dtype=shift;
    123149my $pbsuf=shift;
    124 my $pbproj=shift;
    125150my $pbpkg=shift;
    126151my $pbver=shift;
     
    163188}
    164189
     190=item B<pb_filter_file_inplace>
     191
     192This function applies all filters to a file in place.
     193
     194It takes 8 parameters.
     195
     196The first parameter is the pointer on the hash of filters.
     197The second parameter is the destination file after filtering.
     198The third parameter is the package name.
     199The fourth parameter is the version of the package.
     200The fifth parameter is the tag of the package.
     201The sixth parameter is the revision of the package.
     202The seventh parameter is the current date.
     203The eighth parameter is the packager name.
     204
     205=cut
     206
    165207# Function which applies filter on files (external call)
    166208sub pb_filter_file_inplace {
     
    169211my %filter=%$ptr;
    170212my $destfile=shift;
    171 my $pbproj=shift;
    172213my $pbpkg=shift;
    173214my $pbver=shift;
     
    180221copy($destfile,$cp) || die "Unable to create $cp";
    181222
    182 pb_filter_file($cp,$ptr,$destfile,$pbproj,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$pbpackager);
     223pb_filter_file($cp,$ptr,$destfile,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$pbpackager);
    183224unlink $cp;
    184225}
     226
     227=item B<pb_filter_file>
     228
     229This function applies all filters on a file to generate a new filtered one.
     230
     231It takes 9 parameters.
     232
     233The first parameter is the original file to filter.
     234The second parameter is the pointer on the hash of filters.
     235The third parameter is the destination file after filtering.
     236The fourth parameter is the package name.
     237The fifth parameter is the version of the package.
     238The sixth parameter is the tag of the package.
     239The seventh parameter is the revision of the package.
     240The eighth parameter is the current date.
     241The nineth parameter is the packager name.
     242
     243=cut
     244
    185245
    186246# Function which applies filter on files (external call)
     
    191251my %filter=%$ptr;
    192252my $destfile=shift;
    193 my $pbproj=shift;
    194253my $pbpkg=shift;
    195254my $pbver=shift;
     
    222281}
    223282
     283=back
     284
     285=head1 WEB SITES
     286
     287The main Web site of the project is available at L<http://www.project-builder.org/>. Bug reports should be filled using the trac instance of the project at L<http://trac.project-builder.org/>.
     288
     289=head1 USER MAILING LIST
     290
     291None exists for the moment.
     292
     293=head1 AUTHORS
     294
     295The Project-Builder.org team L<http://trac.project-builder.org/> lead by Bruno Cornec L<mailto:bruno@project-builder.org>.
     296
     297=head1 COPYRIGHT
     298
     299Project-Builder.org is distributed under the GPL v2.0 license
     300described in the file C<COPYING> included with the distribution.
     301
     302=cut
     303
    2243041;
Note: See TracChangeset for help on using the changeset viewer.