Changeset 1071 in ProjectBuilder for devel/pb-modules/lib/ProjectBuilder/Distribution.pm
- Timestamp:
- Jul 12, 2010, 7:59:19 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r1067 r1071 23 23 24 24 our @ISA = qw(Exporter); 25 our @EXPORT = qw(pb_distro_conffile pb_distro_init pb_distro_get pb_distro_ installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_get_param);25 our @EXPORT = qw(pb_distro_conffile pb_distro_init pb_distro_get pb_distro_getlsb pb_distro_installdeps pb_distro_getdeps pb_distro_only_deps_needed pb_distro_setuprepo pb_distro_get_param); 26 26 27 27 =pod … … 226 226 } 227 227 228 =item B<pb_distro_getlsb> 229 230 This function returns the 5 lsb values LSB version, distribution ID, Description, release and codename. 231 As entry it takes an optional parameter to specify whether the output is short or not. 232 233 =cut 234 235 sub pb_distro_getlsb { 236 237 my $s = shift; 238 pb_log(3,"Entering pb_distro_getlsb\n"); 239 240 my ($ambiguous_rel_files) = pb_conf_get("osrelambfile"); 241 my $lsbf = $ambiguous_rel_files->{"lsb"}; 242 243 # LSB has not been configured. 244 if (not defined $lsbf) { 245 print STDERR "no lsb entry defined for osrelambfile\n"; 246 die "You modified upstream delivery and lost !\n"; 247 } 248 249 if (-r $lsbf) { 250 my $rep = pb_get_content($lsbf); 251 # Create elementary fields 252 my ($c, $r, $d, $i, $l) = ("", "", "", "", ""); 253 for my $f (split(/\n/,$rep)) { 254 pb_log(3,"Reading file part ***$f***\n"); 255 $c = $f if ($f =~ /^DISTRIB_CODENAME/); 256 $c =~ s/DISTRIB_CODENAME=/Codename:\t/; 257 $r = $f if ($f =~ /^DISTRIB_RELEASE/); 258 $r =~ s/DISTRIB_RELEASE=/Release:\t/; 259 $d = $f if ($f =~ /^DISTRIB_DESCRIPTION/); 260 $d =~ s/DISTRIB_DESCRIPTION=/Description:\t/; 261 $d =~ s/"//g; 262 $i = $f if ($f =~ /^DISTRIB_ID/); 263 $i =~ s/DISTRIB_ID=/Distributor ID:\t/; 264 $l = $f if ($f =~ /^LSB_VERSION/); 265 $l =~ s/LSB_VERSION=/LSB Version:\t/; 266 } 267 $c =~ s/^[A-z ]*:[\t ]*// if (defined $s); 268 $r =~ s/^[A-z ]*:[\t ]*// if (defined $s); 269 $d =~ s/^[A-z ]*:[\t ]*// if (defined $s); 270 $i =~ s/^[A-z ]*:[\t ]*// if (defined $s); 271 $l =~ s/^[A-z ]*:[\t ]*// if (defined $s); 272 return($l, $i, $d, $r, $c); 273 } else { 274 print STDERR "Unable to read $lsbf file\n"; 275 die "Please report to the maintainer bruno_at_project-builder.org\n"; 276 } 277 } 228 278 229 279 =item B<pb_distro_installdeps>
Note:
See TracChangeset
for help on using the changeset viewer.