Changeset 1111 in ProjectBuilder for devel/pb-modules/lib


Ignore:
Timestamp:
Nov 18, 2010, 2:06:01 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • Rename previous option osupd into the more correct osins, and add a real osupd param to support distribution update commands
  • Adds 2 new commands to update distributions in VM|VE with updatevm|ve (Fix #70)
File:
1 edited

Legend:

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

    r1102 r1111  
    4242  # Return information on the running distro
    4343  #
    44   my ($ddir, $dver, $dfam, $dtype, $pbsuf, $dos, $pbupd, $arch) = pb_distro_init();
    45   print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch)."\n";
     44  my ($ddir, $dver, $dfam, $dtype, $pbsuf, $dos, $pbupd, $pbins, $arch) = pb_distro_init();
     45  print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $pbins, $arch)."\n";
    4646  #
    4747  # Return information on the requested distro
    4848  #
    49   my ($ddir, $dver, $dfam, $dtype, $dos, $pbsuf, $pbupd, $arch) = pb_distro_init("ubuntu","7.10","x86_64");
    50   print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch)."\n";
     49  my ($ddir, $dver, $dfam, $dtype, $dos, $pbsuf, $pbupd, $pbins, $arch) = pb_distro_init("ubuntu","7.10","x86_64");
     50  print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $pbins, $arch)."\n";
    5151  #
    5252  # Return information on the running distro
    5353  #
    5454  my ($ddir,$dver) = pb_distro_get();
    55   my ($ddir, $dver, $dfam, $dtype, $dos, $pbsuf, $pbupd, $arch) = pb_distro_init($ddir,$dver);
    56   print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $arch)."\n";
     55  my ($ddir, $dver, $dfam, $dtype, $dos, $pbsuf, $pbupd, $pbins, $arch) = pb_distro_init($ddir,$dver);
     56  print "distro tuple: ".Dumper($ddir, $dver, $dfam, $dtype, $pbsuf, $pbupd, $pbins, $arch)."\n";
    5757
    5858=head1 USAGE
     
    7474=item B<pb_distro_init>
    7575
    76 This function returns a list of 7 parameters indicating the distribution name, version, family, type of build system, suffix of packages, update command line and architecture of the underlying Linux distribution. The value of the 7 fields may be "unknown" in case the function was unable to recognize on which distribution it is running.
     76This function returns a list of 8 parameters indicating the distribution name, version, family, type of build system, suffix of packages, update command line, installation command line and architecture of the underlying Linux distribution. The value of the 8 fields may be "unknown" in case the function was unable to recognize on which distribution it is running.
    7777
    7878As an example, Ubuntu and Debian are in the same "du" family. As well as RedHat, RHEL, CentOS, fedora are on the same "rh" family.
     
    9898my $dsuf = "unknown";
    9999my $dupd = "unknown";
     100my $dins = "unknown";
    100101my $darch = shift || undef;
    101102my $dnover = "false";
     
    113114$darch=pb_get_arch() if (not defined $darch);
    114115
    115 my ($osfamily,$ostype,$osupd,$ossuffix,$osnover,$osremovedotinver,$os) = pb_conf_get("osfamily","ostype","osupd","ossuffix","osnover","osremovedotinver","os");
     116my ($osfamily,$ostype,$osupd,$osins,$ossuffix,$osnover,$osremovedotinver,$os) = pb_conf_get("osfamily","ostype","osupd","osins","ossuffix","osnover","osremovedotinver","os");
    116117
    117118# Dig into the tuple to find the best answer
     
    120121$dos = pb_distro_get_param($ddir,$dver,$darch,$os,$dfam,$dtype);
    121122$dupd = pb_distro_get_param($ddir,$dver,$darch,$osupd,$dfam,$dtype,$dos);
     123$dins = pb_distro_get_param($ddir,$dver,$darch,$osins,$dfam,$dtype,$dos);
    122124$dsuf = pb_distro_get_param($ddir,$dver,$darch,$ossuffix,$dfam,$dtype,$dos);
    123125$dnover = pb_distro_get_param($ddir,$dver,$darch,$osnover,$dfam,$dtype,$dos);
     
    141143#   $opt="--exclude=*.i?86";
    142144#   }
    143 pb_log(2,"DEBUG: pb_distro_init: $ddir, $dver, $dfam, $dtype, $dsuf, $dupd, $darch\n");
    144 
    145 return($ddir, $dver, $dfam, $dtype, $dos, $dsuf, $dupd, $darch);
     145pb_log(2,"DEBUG: pb_distro_init: $ddir, $dver, $dfam, $dtype, $dsuf, $dupd, $dins, $darch\n");
     146
     147return($ddir, $dver, $dfam, $dtype, $dos, $dsuf, $dupd, $dins, $darch);
    146148}
    147149
Note: See TracChangeset for help on using the changeset viewer.