Changeset 2391 in ProjectBuilder


Ignore:
Timestamp:
Mar 19, 2019, 1:39:52 AM (5 years ago)
Author:
Bruno Cornec
Message:

Add support for SLES 15 by using /etc/os-release as well and Do not exit if port is undefined for VM in pb_get_port as this may be overwritten later

Location:
0.15.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 0.15.1/pb-modules/lib/ProjectBuilder/Distribution.pm

    r2362 r2391  
    280280# Now look at the os-release file to see if we have a std distribution description
    281281#
    282 $r = "/usr/lib/os-release";
    283 if (-r $r) {
    284     my $tmp = pb_get_content("$r");
    285     ($release) = $tmp =~ m/.*\nVERSION_ID=[\"\']*([0-9a-z\._-]+)[\"\']*\n/m;
    286     ($distro) = $tmp =~ m/.*\nID=[\"\']*([0-9A-z\._-]+)[\"\']*\n/m;
    287     # Remove the leap suffix if present (OpenSUSE)
    288     $distro =~ s/-leap//;
    289     $found = 1 if ((defined $release) && (defined $distro));
     282foreach my $r ("/usr/lib/os-release","/etc/os-release") {
     283    if (-r $r) {
     284        my $tmp = pb_get_content("$r");
     285        ($release) = $tmp =~ m/.*\nVERSION_ID=[\"\']*([0-9a-z\._-]+)[\"\']*\n/m;
     286        ($distro) = $tmp =~ m/.*\nID=[\"\']*([0-9A-z\._-]+)[\"\']*\n/m;
     287        # Remove the leap suffix if present (OpenSUSE)
     288        $distro =~ s/-leap//;
     289        if ((defined $release) && (defined $distro)) {
     290            $found = 1;
     291            last;
     292        }
     293    }
    290294}
    291295if ($found == 0) {
  • 0.15.1/pb/bin/pb

    r2385 r2391  
    10411041    pb_log(0, "and that it allows remote root login (PermitRootLogin yes in /etc/ssh/sshd_config)\n");
    10421042    pb_log(0, "Also ensure that network is up, firewalling correctly configured\n");
    1043     pb_log(0, "and perl, Data::Dumper, tar, sudo, ntpdate and scp/ssh installed\n");
     1043    pb_log(0, "and perl-YAML, perl-Date-Manip, tar, sudo, ntpdate, make and scp/ssh installed\n");
    10441044    pb_log(0, "You should then be able to login with ssh -p VMPORT root\@localhost (if VM started with pb)\n");
    10451045} elsif ($action =~ /^setuprm$/) {
     
    50505050# key is project on VM, but machine tuple for RM
    50515051if ($cmt =~ /^RM/i) {
    5052     die "No port passed in parameter. You may miss a config file. Report to dev team\n" if (not defined $port->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"});
     5052    die "No port passed in parameter. You may miss a RM config file. Report to dev team\n" if (not defined $port->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"});
    50535053    $nport = $port->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"};
    50545054} else {
    5055     die "No port passed in parameter. You may miss a config file. Report to dev team\n" if (not defined $port->{'PBPROJ'});
     5055    die "No port passed in parameter. You may miss a VE config file or a vmport entry for $ENV{'PBPROJ'}. Report to dev team\n" if ((not defined $port->{'PBPROJ'}) and ($cmt =~ /^VE/i));
    50565056    $nport = $port->{$ENV{'PBPROJ'}};
    50575057}
    5058 pb_log(2,"pb_get_port with $nport\n");
     5058pb_log(2,"pb_get_port with $nport\n") if (defined $nport);
    50595059if ($cmt =~ /^VM/i) {
    50605060    # Maybe a port was given as parameter so overwrite
Note: See TracChangeset for help on using the changeset viewer.