Changeset 395 in ProjectBuilder for devel/pb/lib/ProjectBuilder/Distribution.pm
- Timestamp:
- Apr 18, 2008, 7:32:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/lib/ProjectBuilder/Distribution.pm
r391 r395 9 9 10 10 use strict; 11 use ProjectBuilder::Base; 11 12 12 13 # Inherit from the "Exporter" module which handles exporting functions. … … 55 56 =over 4 56 57 58 57 59 =item B<pb_get_distro> 58 60 … … 61 63 On my home machine it would currently report ("mandriva","2008.0"). 62 64 63 =item B<pb_distro_init>64 65 This function returns a list of 5 parameters indicating the distribution name, version, family, type of build system and suffix of packages of the underlying Linux distribution. The value of the 5 fields may be "unknown" in case the function was unable to recognize on which distribution it is running.66 67 As an example, Ubuntu and Debian are in the same "du" family. As well as RedHat, RHEL, CentOS, fedora are on the same "rh" family.68 Mandriva, Open SuSE and Fedora have all the same "rpm" type of build system. Ubuntu ad Debian have the same "deb" type of build system.69 And "fc" is the extension generated for all Fedora packages (Version will be added by pb).70 71 When passing the distribution name and version as parameters, the B<pb_distro_init> function returns the parameter of that distribution instead of the underlying one.72 73 =back74 75 =head1 WEB SITES76 77 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/>.78 79 =head1 USER MAILING LIST80 81 None exists for the moment.82 83 =head1 AUTHORS84 85 The Project-Builder.org team L<http://trac.project-builder.org/> lead by Bruno Cornec L<mailto:bruno@project-builder.org>.86 87 =head1 COPYRIGHT88 89 Project-Builder.org is distributed under the GPL v2.0 license90 described in the file C<COPYING> included with the distribution.91 92 65 =cut 93 94 66 95 67 sub pb_distro_init { … … 176 148 } 177 149 150 =item B<pb_distro_init> 151 152 This function returns a list of 5 parameters indicating the distribution name, version, family, type of build system and suffix of packages of the underlying Linux distribution. The value of the 5 fields may be "unknown" in case the function was unable to recognize on which distribution it is running. 153 154 As an example, Ubuntu and Debian are in the same "du" family. As well as RedHat, RHEL, CentOS, fedora are on the same "rh" family. 155 Mandriva, Open SuSE and Fedora have all the same "rpm" type of build system. Ubuntu ad Debian have the same "deb" type of build system. 156 And "fc" is the extension generated for all Fedora packages (Version will be added by pb). 157 158 When passing the distribution name and version as parameters, the B<pb_distro_init> function returns the parameter of that distribution instead of the underlying one. 159 160 Cf: http://linuxmafia.com/faq/Admin/release-files.html 161 Ideas taken from http://search.cpan.org/~kerberus/Linux-Distribution-0.14/lib/Linux/Distribution.pm 162 163 =cut 164 178 165 sub pb_get_distro { 179 180 # Cf: http://linuxmafia.com/faq/Admin/release-files.html181 # Ideas taken from182 # http://search.cpan.org/~kerberus/Linux-Distribution-0.14/lib/Linux/Distribution.pm183 166 184 167 my $base="/etc"; … … 325 308 } 326 309 327 # get content of a file in a variable 328 sub pb_get_content { 329 330 my $file=shift; 331 332 my $bkp = $/; 333 undef $/; 334 open(R,$file) || die "Unable to open $file: $!"; 335 my $content=<R>; 336 close(R); 337 chomp($content); 338 $/ = $bkp; 339 return($content); 340 } 310 =back 311 312 =head1 WEB SITES 313 314 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/>. 315 316 =head1 USER MAILING LIST 317 318 None exists for the moment. 319 320 =head1 AUTHORS 321 322 The Project-Builder.org team L<http://trac.project-builder.org/> lead by Bruno Cornec L<mailto:bruno@project-builder.org>. 323 324 =head1 COPYRIGHT 325 326 Project-Builder.org is distributed under the GPL v2.0 license 327 described in the file C<COPYING> included with the distribution. 328 329 =cut 330 331 341 332 1;
Note:
See TracChangeset
for help on using the changeset viewer.