Changeset 409 in ProjectBuilder for devel/pb/lib/ProjectBuilder/Filter.pm
- Timestamp:
- Apr 25, 2008, 3:13:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/lib/ProjectBuilder/Filter.pm
r405 r409 35 35 =head1 NAME 36 36 37 ProjectBuilder:: Base, part of the project-builder.org - module dealing with generic functions suitable for perl project development37 ProjectBuilder::Filter, part of the project-builder.org 38 38 39 39 =head1 DESCRIPTION 40 40 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 41 This module provides filtering functions suitable for pbinit calls. 42 43 =item B<pb_get_filters> 44 45 This function gets all filters to apply. They're cumulative from the less specific to the most specific. 46 47 Suffix 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 49 The first parameter is the package name. 50 The second parameter is the distribution type. 51 The third parameter is the distribution family. 52 The fourth parameter is the distribution name. 53 The fifth parameter is the distribution version. 54 55 The function returns a pointer on a hash of filters. 56 57 =cut 54 58 55 59 sub pb_get_filters { … … 113 117 } 114 118 115 # Function which applies filter on pb build files 119 =item B<pb_filter_file_pb> 120 121 This function applies all filters to pb build files. 122 123 It takes 15 parameters. 124 125 The first parameter is the file to filter. 126 The second parameter is the pointer on the hash of filters. 127 The third parameter is the destination file after filtering. 128 The fourth parameter is the distribution type. 129 The fifth parameter is the suffix of the distribution. 130 The sixth parameter is the package name. 131 The seventh parameter is the version of the package. 132 The eighth parameter is the tag of the package. 133 The nineth parameter is the revision of the package. 134 The tenth parameter is the current date. 135 The eleventh parameter is the list of required packages. 136 The twelveth parameter is the list of optional packages. 137 The thirteenth parameter is the packager name. 138 The fourteenth parameter is the changelog. 139 140 =cut 141 116 142 sub pb_filter_file_pb { 117 143 … … 122 148 my $dtype=shift; 123 149 my $pbsuf=shift; 124 my $pbproj=shift;125 150 my $pbpkg=shift; 126 151 my $pbver=shift; … … 163 188 } 164 189 190 =item B<pb_filter_file_inplace> 191 192 This function applies all filters to a file in place. 193 194 It takes 8 parameters. 195 196 The first parameter is the pointer on the hash of filters. 197 The second parameter is the destination file after filtering. 198 The third parameter is the package name. 199 The fourth parameter is the version of the package. 200 The fifth parameter is the tag of the package. 201 The sixth parameter is the revision of the package. 202 The seventh parameter is the current date. 203 The eighth parameter is the packager name. 204 205 =cut 206 165 207 # Function which applies filter on files (external call) 166 208 sub pb_filter_file_inplace { … … 169 211 my %filter=%$ptr; 170 212 my $destfile=shift; 171 my $pbproj=shift;172 213 my $pbpkg=shift; 173 214 my $pbver=shift; … … 180 221 copy($destfile,$cp) || die "Unable to create $cp"; 181 222 182 pb_filter_file($cp,$ptr,$destfile,$pbp roj,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$pbpackager);223 pb_filter_file($cp,$ptr,$destfile,$pbpkg,$pbver,$pbtag,$pbrev,$pbdate,$pbpackager); 183 224 unlink $cp; 184 225 } 226 227 =item B<pb_filter_file> 228 229 This function applies all filters on a file to generate a new filtered one. 230 231 It takes 9 parameters. 232 233 The first parameter is the original file to filter. 234 The second parameter is the pointer on the hash of filters. 235 The third parameter is the destination file after filtering. 236 The fourth parameter is the package name. 237 The fifth parameter is the version of the package. 238 The sixth parameter is the tag of the package. 239 The seventh parameter is the revision of the package. 240 The eighth parameter is the current date. 241 The nineth parameter is the packager name. 242 243 =cut 244 185 245 186 246 # Function which applies filter on files (external call) … … 191 251 my %filter=%$ptr; 192 252 my $destfile=shift; 193 my $pbproj=shift;194 253 my $pbpkg=shift; 195 254 my $pbver=shift; … … 222 281 } 223 282 283 =back 284 285 =head1 WEB SITES 286 287 The 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 291 None exists for the moment. 292 293 =head1 AUTHORS 294 295 The 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 299 Project-Builder.org is distributed under the GPL v2.0 license 300 described in the file C<COPYING> included with the distribution. 301 302 =cut 303 224 304 1;
Note:
See TracChangeset
for help on using the changeset viewer.