Changeset 1111 in ProjectBuilder for devel/pb-modules


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)
Location:
devel/pb-modules
Files:
4 edited

Legend:

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

    r1071 r1111  
    121121@param = split(/-/,$dist) if (defined $dist);
    122122
    123 my ($ddir, $dver, $dfam, $dtype, $dos, $pbsuf, $pbupd, $arch) = pb_distro_init(@param);
     123my ($ddir, $dver, $dfam, $dtype, $dos, $pbsuf, $pbupd, $pbins, $arch) = pb_distro_init(@param);
    124124my $sep = "\n";
    125125if (defined $opts{'l'}) {
     
    144144        $pbsuf = "Suffix:\t$pbsuf";
    145145        $pbupd = "Update:\t$pbupd";
     146        $pbins = "Install:\t$pbupd";
    146147        $arch = "Arch:\t$arch";
    147148        print "Project-Builder tuple:\n";
    148149    }
    149     print join($sep,($dos, $ddir, $dver, $arch, $dtype, $dfam, $pbsuf, $pbupd))."\n";
     150    print join($sep,($dos, $ddir, $dver, $arch, $dtype, $dfam, $pbsuf, $pbupd, $pbins))."\n";
    150151}
  • devel/pb-modules/etc/pb.conf

    r1109 r1111  
    194194# key depends on granularity, value is install command
    195195
     196# Command to update the distribution to latest state
     197osupd du = sudo apt-get update
     198osupd gen = sudo emerge
     199osupd rpm = sudo yum clean all; sudo yum -y update
     200osupd md = sudo urpmi.update -a ; sudo urpmi --autoa--auto-select
     201osupd opensuse = sudo zypper -n update
     202osupd sol = /bin/true
     203osupd lsb = /bin/true
     204
    196205# Chaining the commands allow to only test for what is able to be installed,
    197206# not the update of the repo which may well be unaccessible if too old
    198 osupd du = sudo apt-get update ; sudo apt-get -y install
    199 osupd gen = sudo emerge
    200 osupd rpm = sudo yum clean all; sudo yum -y update ; sudo yum -y install
    201 osupd rhel-2.1 = sudo up2date -y
    202 osupd rhel-3 = sudo up2date -y
    203 osupd rhel-4 = sudo up2date -y
    204 osupd md = sudo urpmi.update -a ; sudo urpmi --auto
    205 osupd novell = export TERM=linux ; export PATH=\$PATH:/sbin:/usr/sbin ; sudo yast2 -i
    206 osupd opensuse-10.2 = sudo yes | zypper install
    207 osupd opensuse = sudo zypper -n install
    208 osupd sol = sudo pkgadd -d
    209 osupd lsb = /bin/true
     207osins du = sudo apt-get update ; sudo apt-get -y install
     208osins gen = sudo emerge
     209osins rpm = sudo yum clean all; sudo yum -y update ; sudo yum -y install
     210osins rhel-2.1 = sudo up2date -y
     211osins rhel-3 = sudo up2date -y
     212osins rhel-4 = sudo up2date -y
     213osins md = sudo urpmi.update -a ; sudo urpmi --auto
     214osins novell = export TERM=linux ; export PATH=\$PATH:/sbin:/usr/sbin ; sudo yast2 -i
     215osins opensuse-10.2 = sudo yes | zypper install
     216osins opensuse = sudo zypper -n install
     217osins sol = sudo pkgadd -d
     218osins lsb = /bin/true
    210219
    211220# From the most generic to the most specialized, in term of granularity,
  • devel/pb-modules/etc/pb.conf.pod

    r1109 r1111  
    102102 Conffile: pb
    103103 Example: osfamily debian = du
     104
     105=item B<osins>
     106
     107 Nature: Optional
     108 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here.
     109 Value: OS command to lauch in order to automatically install packages on it.
     110 Conffile: pb
     111 Example: osins fedora = sudo yum -y install
    104112
    105113=item B<osmindep>
     
    196204 Nature: Optional
    197205 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here.
    198  Value: OS command to lauch in order to automatically install packages on it.
    199  Conffile: pb
    200  Example: ostype rh = rpm, ostype md = rpm, ostype novell = rpm
     206 Value: OS command to lauch in order to automatically update th VM|VE
     207 Conffile: pb
     208 Example: osupd fedora = sudo yum -y update
    201209
    202210=item B<pbconfurl>
  • 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.