Changeset 423 in ProjectBuilder for devel/pb-modules
- Timestamp:
- May 3, 2008, 1:03:24 AM (17 years ago)
- Location:
- devel/pb-modules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/bin/pbdistrocheck
r402 r423 9 9 10 10 use strict 'vars'; 11 use Getopt::Long qw(:config auto_abbrev no_ignore_case); 11 12 use Data::Dumper; 12 13 use lib qw (lib); 13 use ProjectBuilder::Distribution qw (pb_distro_init); 14 use ProjectBuilder::Distribution; 15 use ProjectBuilder::Base; 16 17 my %opts; # CLI Options 18 19 GetOptions("verbose|v+" => \$opts{'v'}); 20 if (defined $opts{'v'}) { 21 $debug = $opts{'v'}; 22 } 23 if (defined $opts{'l'}) { 24 open(LOG,"> $opts{'l'}") || die "Unable to log to $opts{'l'}: $!"; 25 $LOG = \*LOG; 26 $debug = 0 if ($debug == -1); 27 } 28 pb_log_init($debug, $LOG); 14 29 15 30 my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init(); -
devel/pb-modules/lib/ProjectBuilder/Base.pm
r405 r423 216 216 $debug = shift || 0; 217 217 $LOG = shift || \*STDOUT; 218 pb_log(1,"Debug value: $debug\n"); 218 219 219 220 } -
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r402 r423 9 9 10 10 use strict; 11 use Data::Dumper; 11 12 use ProjectBuilder::Base; 12 13 … … 221 222 'suse' => ['suse', 'sles', 'opensuse'], 222 223 'redhat' => ['redhat', 'rhel', 'centos', 'mandrake', 'vmware'], 223 'lsb' => ['ubuntu', ' debian', 'lsb'],224 'lsb' => ['ubuntu', 'lsb'], 224 225 ); 225 226 … … 241 242 'opensuse' => 'openSUSE (\d.+) \(', 242 243 'lsb' => '.*[^Ubunt].*\nDISTRIB_RELEASE=(.+)', 243 # Ubuntu 6.06 includes a /etc/debian_version file that needs to be 244 # renamed to /etc/debian_version.sav as there is no way to distinguish 245 # Ubuntu 6.06 from debian testing otherwise 246 # Same is true for Ubuntu 7.10 :-( 244 # Ubuntu includes a /etc/debian_version file that cretaes an ambiguity with debian 245 # So we need to look at distros in reverse alphabetic order to treat ubuntu always first 247 246 'ubuntu' => '.*Ubuntu.*\nDISTRIB_RELEASE=(.+)', 248 247 'debian' => '(.+)', … … 274 273 } 275 274 276 while (($d,$r) = each %ambiguous_rel_files) { 277 if (-f "$base/$r" && !-l "$base/$r"){ 275 # Now look at ambiguous files 276 # Ubuntu includes a /etc/debian_version file that creates an ambiguity with debian 277 # So we need to look at distros in reverse alphabetic order to treat ubuntu always first via lsb 278 foreach $d (reverse keys %ambiguous_rel_files) { 279 $r = $ambiguous_rel_files{$d}; 280 if (-f "$base/$r" && !-l "$base/$r") { 278 281 # Found one possibility. 279 282 # Get all distros concerned by that file … … 281 284 my $found = 0; 282 285 my $ptr = $distro_similar{$d}; 283 #pb_log(2,$LOG "amb: ".Dumper($ptr)."\n" if ($debug >= 1);286 pb_log(2,"amb: ".Dumper($ptr)."\n"); 284 287 $release = "unknown"; 285 288 foreach my $dd (@$ptr) { 286 #pb_log(2,$LOG "check $dd\n" if ($debug >= 1);289 pb_log(2,"check $dd\n"); 287 290 # Try to check pattern 288 291 if (defined $distro_match{$dd}) { 289 #pb_log(2,$LOG "cmp: $distro_match{$dd} - vs - $tmp\n" if ($debug >= 1);292 pb_log(2,"cmp: $distro_match{$dd} - vs - $tmp\n"); 290 293 ($release) = $tmp =~ m/$distro_match{$dd}/m; 291 294 if ((defined $release) && ($release ne "unknown")) {
Note:
See TracChangeset
for help on using the changeset viewer.