Changeset 423 in ProjectBuilder


Ignore:
Timestamp:
May 3, 2008, 1:03:24 AM (16 years ago)
Author:
Bruno Cornec
Message:
  • Improved pbdistrocheck to support -v flags
  • Fix Ubuntu issue on distribution detection
  • some more pb_log added
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/bin/pbdistrocheck

    r402 r423  
    99
    1010use strict 'vars';
     11use Getopt::Long qw(:config auto_abbrev no_ignore_case);
    1112use Data::Dumper;
    1213use lib qw (lib);
    13 use ProjectBuilder::Distribution qw (pb_distro_init);
     14use ProjectBuilder::Distribution;
     15use ProjectBuilder::Base;
     16
     17my %opts;                   # CLI Options
     18
     19GetOptions("verbose|v+" => \$opts{'v'});
     20if (defined $opts{'v'}) {
     21    $debug = $opts{'v'};
     22}
     23if (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    }
     28pb_log_init($debug, $LOG);
    1429
    1530my ($ddir, $dver, $dfam, $dtype, $pbsuf) = pb_distro_init();
  • devel/pb-modules/lib/ProjectBuilder/Base.pm

    r405 r423  
    216216$debug = shift || 0;
    217217$LOG = shift || \*STDOUT;
     218pb_log(1,"Debug value: $debug\n");
    218219
    219220}
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r402 r423  
    99
    1010use strict;
     11use Data::Dumper;
    1112use ProjectBuilder::Base;
    1213
     
    221222    'suse'              => ['suse', 'sles', 'opensuse'],
    222223    'redhat'            => ['redhat', 'rhel', 'centos', 'mandrake', 'vmware'],
    223     'lsb'               => ['ubuntu', 'debian', 'lsb'],
     224    'lsb'               => ['ubuntu', 'lsb'],
    224225    );
    225226
     
    241242    'opensuse'              => 'openSUSE (\d.+) \(',
    242243    '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
    247246    'ubuntu'                => '.*Ubuntu.*\nDISTRIB_RELEASE=(.+)',
    248247    'debian'                => '(.+)',
     
    274273}
    275274
    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
     278foreach $d (reverse keys %ambiguous_rel_files) {
     279    $r = $ambiguous_rel_files{$d};
     280    if (-f "$base/$r" && !-l "$base/$r") {
    278281        # Found one possibility.
    279282        # Get all distros concerned by that file
     
    281284        my $found = 0;
    282285        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");
    284287        $release = "unknown";
    285288        foreach my $dd (@$ptr) {
    286             #pb_log(2,$LOG "check $dd\n" if ($debug >= 1);
     289            pb_log(2,"check $dd\n");
    287290            # Try to check pattern
    288291            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");
    290293                ($release) = $tmp =~ m/$distro_match{$dd}/m;
    291294                if ((defined $release) && ($release ne "unknown")) {
  • devel/pb/bin/pb

    r419 r423  
    331331if (defined $opts{'v'}) {
    332332    $debug = $opts{'v'};
    333     pb_log(0,"Debug value: $debug\n");
    334333}
    335334if (defined $opts{'f'}) {
  • projects/mondorescue/pbconf/branches/2.2.6/mondorescue.pb

    r387 r423  
    2828# a QEMU rhel_3 here means that the VM will be named rhel_3.qemu
    2929#
    30 vmlist mondorescue = mandrake-10.1-i386,mandrake-10.2-i386,mandriva-2006.0-i386,mandriva-2007.0-i386,mandriva-2007.1-i386,mandriva-2008.0-i386,redhat-7.3-i386,redhat-9-i386,fedora-4-i386,fedora-5-i386,fedora-6-i386,fedora-7-i386,fedora-8-i386,rhel-3-i386,rhel-4-i386,rhel-5-i386,suse-10.0-i386,suse-10.1-i386,suse-10.2-i386,suse-10.3-i386,sles-9-i386,sles-10-i386,gentoo-nover-i386,debian-3.1-i386,debian-4.0-i386,ubuntu-6.06-i386,ubuntu-7.04-i386,ubuntu-7.10-i386,mandriva-2007.0-x86_64,mandriva-2007.1-x86_64,mandriva-2008.0-x86_64,fedora-6-x86_64,fedora-7-x86_64,fedora-8-x86_64,rhel-4-x86_64,rhel-5-x86_64,suse-10.2-x86_64,suse-10.3-x86_64,sles-10-x86_64,gentoo-nover-x86_64,debian-4.0-x86_64,ubuntu-7.04-x86_64,ubuntu-7.10-x86_64
     30vmlist mondorescue = mandrake-10.1-i386,mandrake-10.2-i386,mandriva-2006.0-i386,mandriva-2007.0-i386,mandriva-2007.1-i386,mandriva-2008.0-i386,redhat-7.3-i386,redhat-9-i386,fedora-4-i386,fedora-5-i386,fedora-6-i386,fedora-7-i386,fedora-8-i386,rhel-3-i386,rhel-4-i386,rhel-5-i386,suse-10.0-i386,suse-10.1-i386,suse-10.2-i386,suse-10.3-i386,sles-9-i386,sles-10-i386,gentoo-nover-i386,debian-3.1-i386,debian-4.0-i386,ubuntu-6.06-i386,ubuntu-7.04-i386,ubuntu-7.10-i386,ubuntu-8.04-i386,mandriva-2007.0-x86_64,mandriva-2007.1-x86_64,mandriva-2008.0-x86_64,fedora-6-x86_64,fedora-7-x86_64,fedora-8-x86_64,rhel-4-x86_64,rhel-5-x86_64,suse-10.2-x86_64,suse-10.3-x86_64,sles-10-x86_64,gentoo-nover-x86_64,debian-4.0-x86_64,ubuntu-7.04-x86_64,ubuntu-7.10-x86_64
    3131
    3232#
Note: See TracChangeset for help on using the changeset viewer.