Changeset 1507


Ignore:
Timestamp:
May 9, 2012, 3:33:18 AM (7 years ago)
Author:
bruno
Message:
  • pb.conf: installing project-builder requires --force-yes since the keys don't get installed into the virtual environment. (Eric Anderson from d3145b5c2c63cf9cf00ffa818fa03a432a2e6e45)
  • pb.conf.pod: Fix lots of typos (coma -> comma) Document new ftp_proxy and http_proxy options. Document the rbsmirrorsrv option (already supported, not documented) Document that sshlogin and sshport are now optional parameters; both have reasonable defaults (not in that patch, will come later) (Eric Anderson from d3145b5c2c63cf9cf00ffa818fa03a432a2e6e45)
  • Conf.pm: Use confess so when failing to get a parameter we get a stack trace. (Eric Anderson from d3145b5c2c63cf9cf00ffa818fa03a432a2e6e45)
  • Distribution.pm: Fix typo (Donwloading -> Downloading); Fix code so that you can try to setup a VE multiple times. Existing debian code would fail the second time since pb.conf would already exist. Unclear on correct semantics here; the rpm code just force overwrites the file, but the old debian code was trying not to. (Eric Anderson from d3145b5c2c63cf9cf00ffa818fa03a432a2e6e45)
  • Distribution.pm: Adding the internal function pb_distro_compare_repo to avoid code duplication between apt and yum repos treatment (Bruno Cornec)
Location:
devel/pb-modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/etc/pb.conf

    r1486 r1507  
    225225# Chaining the commands allow to only test for what is able to be installed,
    226226# not the update of the repo which may well be unaccessible if too old
    227 osins du = sudo /usr/bin/apt-get update ; sudo /usr/bin/apt-get -y install
     227osins du = sudo /usr/bin/apt-get update ; sudo /usr/bin/apt-get -y --force-yes install
    228228osins gen = sudo /usr/bin/emerge
    229229osins rpm = sudo /usr/bin/yum clean all; sudo /usr/bin/yum -y update ; sudo /usr/bin/yum -y install
  • devel/pb-modules/etc/pb.conf.pod

    r1408 r1507  
    2727 Nature: Optional
    2828 Key: package (as provided in defpkgdir or extpkgdir)
    29  Value: coma separated list of OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch) that are excluded from the checkssh command (no build made for them). The OS name is generaly used here.
     29 Value: comma separated list of OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch) that are excluded from the checkssh command (no build made for them). The OS name is generaly used here.
    3030 Conffile: project
    3131 Example: checkexclude pkg1 = centos,lsb,solaris
     
    8383 Nature: Mandatory
    8484 Key: project (as defined in the -p option or PBPROJ environment variable)
    85  Value: coma separated list of packages built by default in this project. When not using any package name as a parameter to pb commands, this list will be used.
     85 Value: comma separated list of packages built by default in this project. When not using any package name as a parameter to pb commands, this list will be used.
    8686 Conffile: project
    8787 Example: defpkgdir mondorescue = mondo,mindi NB: a default value is not really meaningful.
     
    9999 Nature: Optional
    100100 Key: project (as defined in the -p option or PBPROJ environment variable)
    101  Value: coma separated list of packages built in addition in this project. When using the all package name as a parameter to pb commands, this list will be used, in addition to the defpkgdir list.
     101 Value: comma separated list of packages built in addition in this project. When using the all package name as a parameter to pb commands, this list will be used, in addition to the defpkgdir list.
    102102 Conffile: project
    103103 Example: extpkgdir mondorescue = mondo-doc,mindi-mindibusybox
     
    107107 Nature: Optional
    108108 Key: package (as provided in defpkgdir or extpkgdir)
    109  Value: coma separated list of files that will be filtered using the macro system from pb, during the creation of the compressed source tar files for this package. Their path is relative to the directory containing the package.
     109 Value: comma separated list of files that will be filtered using the macro system from pb, during the creation of the compressed source tar files for this package. Their path is relative to the directory containing the package.
    110110 Conffile: project
    111111 Example: filteredfiles mindi = rootfs/sbin/init,mindi,install.sh,doc/mindi.8
    112112
     113=item B<ftp_proxy>
     114
     115 Nature: Optional
     116 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.
     117 Value: string indicating the proxy to use
     118 Conffile: pb
     119 Example: ftp_proxy default = http://example.com:3128/
     120
     121=item B<http_proxy>
     122
     123 Nature: Optional
     124 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.
     125 Value: string indicating the proxy to use
     126 Conffile: pb
     127 Example: http_proxy default = http://example.com:3128/
     128
    113129=item B<logcmd>
    114130
     
    123139 Nature: Optional
    124140 Key: project (as defined in the -p option or PBPROJ environment variable)
    125  Value: In case the B<logcmd> command is internal, a coma separated list of the commands whose trace execution is to be captured in order to log context.
     141 Value: In case the B<logcmd> command is internal, a comma separated list of the commands whose trace execution is to be captured in order to log context.
    126142 Conffile: pb
    127143 Example: logcmds pbmkbm = mount,lsmod,esxcfg-module -l,df -T
     
    131147 Nature: Optional
    132148 Key: project (as defined in the -p option or PBPROJ environment variable)
    133  Value: In case the B<logcmd> command is internal, a coma separated list of the files to capture in order to log context.
     149 Value: In case the B<logcmd> command is internal, a comma separated list of the files to capture in order to log context.
    134150 Conffile: pb
    135151 Example: logfiles pbmkbm = /etc/raidtab,/proc/cmdline,/proc/swaps
     
    147163 Nature: Mandatory
    148164 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.
    149  Value: coma separated list of commands to be copied from the original OS to the target boot media tree (works recursively for directory creation on the target). Their actual path is deduced from the PATH variable.
     165 Value: comma separated list of commands to be copied from the original OS to the target boot media tree (works recursively for directory creation on the target). Their actual path is deduced from the PATH variable.
    150166 Conffile: pb
    151167 Example: mkbmbootcmds linux = perl,awk,gawk,dd,grep,uname
     
    155171 Nature: Mandatory
    156172 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.
    157  Value: coma separated list of directories to be copied from the original OS to the target boot media tree (works recursively on the target).
     173 Value: comma separated list of directories to be copied from the original OS to the target boot media tree (works recursively on the target).
    158174 Conffile: pb
    159175 Example: mkbmbootdirs linux = /etc/ssh,/etc/udev,/etc/mdadm
     
    163179 Nature: Mandatory
    164180 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.
    165  Value: coma separated list of files to be copied from the original OS to the target boot media tree (works recursively for directory creation on the target).
     181 Value: comma separated list of files to be copied from the original OS to the target boot media tree (works recursively for directory creation on the target).
    166182 Conffile: pb
    167183 Example: mkbmbootfiles linux = /etc/mdadm.conf,/etc/raidtab,/etc/modprobe.conf
     
    203219 Nature: Mandatory
    204220 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.
    205  Value: coma separated list of empty directory paths to be created on the target boot media.
     221 Value: comma separated list of empty directory paths to be created on the target boot media.
    206222 Conffile: pb
    207223 Example: mkbmtargetdirs linux = /tmp,/dev
     
    219235 Nature: Optional
    220236 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). In that case, should be an OS name.
    221  Value: coma separated list of distributions which use the same file name in /etc for different distributions (ex: /etc/redhat-release for redhat, rhel, mandriva,...). Cf: B<osrelambfile>
     237 Value: comma separated list of distributions which use the same file name in /etc for different distributions (ex: /etc/redhat-release for redhat, rhel, mandriva,...). Cf: B<osrelambfile>
    222238 Conffile: pb
    223239 Example: osambiguous debian = debian,ubuntu
     
    283299 Nature: Optional
    284300 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). NB: a default value is highly interesting here.
    285  Value: coma separated list of packages needed before setupvm|ve can be run. Install them with your distribution in VM or automatically in VE when possible.
     301 Value: comma separated list of packages needed before setupvm|ve can be run. Install them with your distribution in VM or automatically in VE when possible.
    286302 Conffile: pb
    287303 Example: osmindep default = perl,sudo,wget,tar,make,gzip
     
    323339 Nature: Optional
    324340 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    325  Value: coma separated list of perl modules needed by pb and not provided in a package format for the relative OS, and that will be installed from CPAN in your VM/VE.
     341 Value: comma separated list of perl modules needed by pb and not provided in a package format for the relative OS, and that will be installed from CPAN in your VM/VE.
    326342 Conffile: pb
    327343 Example: osperldep rhel-5 = Module-Build,File-MimeInfo,File-BaseDir,Mail-Sendmail
     
    339355 Nature: Optional (Mandatory if pbinstalltype is pkg)
    340356 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    341  Value: coma separated list of packages that have to be installed in order for pb to be operational in the VE|VM
     357 Value: comma separated list of packages that have to be installed in order for pb to be operational in the VE|VM
    342358 Conffile: pb
    343359 Example: ospkg rhel-5 = project-builder
     
    347363 Nature: Optional
    348364 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    349  Value: coma separated list of packages that are needed by pb and should be installed automatically in the VM/VE during the setupvm|ve phasis by pb.
     365 Value: comma separated list of packages that are needed by pb and should be installed automatically in the VM/VE during the setupvm|ve phasis by pb.
    350366 Conffile: pb
    351367 Example: ospkgdep rhel-5 = wget,make,ntp,patch,perl-DateManip
     
    388404 Nature: Optional (Mandatory if pbinstalltype is pkg)
    389405 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch).
    390  Value: coma separated list of packages or repo file to be added to the VE|VM to support package installation of pb
     406 Value: comma separated list of packages or repo file to be added to the VE|VM to support package installation of pb
    391407 Conffile: pb
    392408 Example: osrepo rpm = ftp://ftp.project-builder.org/$ddir/$dver/pb.repo
     
    591607 Example: rbsb4pi centos = /home/rinse/bin/before-post-install.sh
    592608
     609=item B<rbsmirrorsrv>
     610
     611 Nature: Optional
     612 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.
     613 Value: URL for the mirror server for setting up a virtual environment
     614 Conffile: ve
     615 Example: rbsmirrorsrv debian = http://mirrors1.kernel.org/
     616
    593617=item B<rbsopt>
    594618
     
    619643 Nature: Mandatory
    620644 Key: project (as defined in the -p option or PBPROJ environment variable)
    621  Value: list of coma separated OS (under the form of os-ver-arch). The corresponding machines running these distributions are given in the rmpool parameter.
     645 Value: list of comma separated OS (under the form of os-ver-arch). The corresponding machines running these distributions are given in the rmpool parameter.
    622646 Conffile: rm
    623647 Example: rmlist default = mandriva-2010.2-i386,fedora-14-i386,rhel-6-i386,rhel-5-i386,pensuse-11.3-i386,sles-11-i386,gentoo-nover-i386,debian-5.0-i386,ubuntu-10.10-i386,solaris-10-i386,mandriva-2010.2-x86_64,fedora-14-x86_64,rhel-6-x86_64,rhel-5-x86_64,opensuse-11.3-x86_64,sles-11-x86_64,gentoo-nover-x86_64,debian-5.0-x86_64,ubuntu-10.10-x86_64,solaris-10-x86_64,hp-ux-11.3-ia64,rhel-5-ia64
     
    705729=item B<sshlogin>
    706730
    707  Nature: Mandatory
    708  Key: project (as defined in the -p option or PBPROJ environment variable)
    709  Value: login to use when connecting to the repository server B<sshhost> for package delivery.
     731 Nature: Optional
     732 Key: project (as defined in the -p option or PBPROJ environment variable)
     733 Value: login to use when connecting to the repository server B<sshhost> for package delivery. whoami result by default
    710734 Conffile: project
    711735 Example: sshlogin mondorescue = mylogin
     
    713737=item B<sshport>
    714738
    715  Nature: Mandatory
    716  Key: project (as defined in the -p option or PBPROJ environment variable)
    717  Value: port to use when connecting to the repository server B<sshhost> for package delivery.
     739 Nature: Optional
     740 Key: project (as defined in the -p option or PBPROJ environment variable)
     741 Value: port to use when connecting to the repository server B<sshhost> for package delivery. 22 by default.
    718742 Conffile: project
    719743 Example: sshport mondorescue = 22
     
    743767 Nature: Mandatory
    744768 Key: project (as defined in the -p option or PBPROJ environment variable)
    745  Value: list of coma separated OS (under the form of os-ver-arch).
     769 Value: list of comma separated OS (under the form of os-ver-arch).
    746770 Conffile: ve
    747771 Example: velist default = centos-4-i386,centos-5-i386,centos-4-x86_64,centos-5-x86_64,debian-5.0-i386,debian-5.0-x86_64,lsb-4.0.1-i386,lsb-4.0.1-x86_64
     
    839863 Nature: Mandatory
    840864 Key: project (as defined in the -p option or PBPROJ environment variable)
    841  Value: list of coma separated OS (under the form of os-ver-arch).
     865 Value: list of comma separated OS (under the form of os-ver-arch).
    842866 Conffile: vm
    843867 Example: vmlist default = asianux-2-i386,asianux-3-i386,mandrake-10.1-i386,mandrake-10.2-i386,mandriva-2006.0-i386,mandriva-2007.0-i386,mandriva-2007.1-i386,mandriva-2008.0-i386,mandriva-2008.1-i386,mandriva-2009.0-i386,mandriva-2009.1-i386,mandriva-2010.0-i386,redhat-7.3-i386,redhat-9-i386,fedora-4-i386,fedora-5-i386,fedora-6-i386,fedora-7-i386,fedora-8-i386,fedora-9-i386,fedora-10-i386,fedora-11-i386,fedora-12-i386,rhel-2.1-i386,rhel-3-i386,rhel-4-i386,rhel-5-i386,suse-10.0-i386,suse-10.1-i386,suse-10.2-i386,opensuse-10.3-i386,opensuse-11.0-i386,opensuse-11.1-i386,opensuse-11.2-i386,sles-9-i386,sles-10-i386,sles-11-i386,gentoo-nover-i386,debian-3.1-i386,debian-4.0-i386,debian-5.0-i386,ubuntu-6.06-i386,ubuntu-7.04-i386,ubuntu-7.10-i386,ubuntu-8.04-i386,ubuntu-8.10-i386,ubuntu-9.04-i386,ubuntu-9.10-i386,solaris-10-i386,asianux-2-x86_64,asianux-3-x86_64,mandriva-2007.0-x86_64,mandriva-2007.1-x86_64,mandriva-2008.0-x86_64,mandriva-2008.1-x86_64,mandriva-2009.0-x86_64,mandriva-2009.1-x86_64,mandriva-2010.0-x86_64,fedora-6-x86_64,fedora-7-x86_64,fedora-8-x86_64,fedora-9-x86_64,fedora-10-x86_64,fedora-11-x86_64,fedora-12-x86_64,rhel-3-x86_64,rhel-4-x86_64,rhel-5-x86_64,suse-10.2-x86_64,opensuse-10.3-x86_64,opensuse-11.0-x86_64,opensuse-11.1-x86_64,opensuse-11.2-x86_64,sles-10-x86_64,sles-11-x86_64,gentoo-nover-x86_64,debian-4.0-x86_64,debian-5.0-x86_64,ubuntu-7.04-x86_64,ubuntu-7.10-x86_64,ubuntu-8.04-x86_64,ubuntu-8.10-x86_64,ubuntu-9.04-x86_64,ubuntu-9.10-x86_64,solaris-10-x86_64
  • devel/pb-modules/lib/ProjectBuilder/Conf.pm

    r1495 r1507  
    1111
    1212use strict;
     13use Carp 'confess';
    1314use Data::Dumper;
    1415use ProjectBuilder::Base;
     
    364365
    365366foreach my $i (0..$#param) {
    366     die "No $param[$i] defined for $proj" if (not defined $return[$i]);
     367    confess "No $param[$i] defined for $proj" if (not defined $return[$i]);
    367368}
    368369return(@return);
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r1505 r1507  
    1515use File::Basename;
    1616use File::Copy;
     17# requires perl 5.004 minimum in VM/VE
     18use File::Compare;
    1719
    1820# Global vars
     
    441443}
    442444
     445# Internal
     446sub pb_distro_compare_repo {
     447
     448my $src = shift;
     449my $dest = shift;
     450
     451if (-f $dest && -s $dest == 0) {
     452    pb_log(1, "Overwriting empty file $dest");
     453} elsif (-f $dest && compare("$src", $dest) == 0) {
     454    pb_log(1, "Overwriting identical file $dest");
     455} elsif (not -f $dest) {
     456    pb_log(1, "Creating new $dest");
     457} else {
     458    pb_log(0, "ERROR: destination file $dest exists and is different than source $src\n");
     459    return(0);
     460}
     461# TRUE
     462return(1);
     463}
     464
    443465=item B<pb_distro_setuprepo_gen>
    444466
     
    469491    # The repo file can be local or remote. download or copy at the right place
    470492    if (($scheme eq "ftp") || ($scheme eq "http")) {
    471         pb_system("wget -O $ENV{'PBTMP'}/$bn $i","Donwloading additional repository file $i");
     493        pb_system("wget -O $ENV{'PBTMP'}/$bn $i","Downloading additional repository file $i");
    472494    } else {
    473495        copy($i,$ENV{'PBTMP'}/$bn);
     
    484506        } elsif ($bn =~ /\.repo$/) {
    485507            # Yum repo
     508            my $dest = "/etc/yum.repos.d/$bn";
     509            return if (pb_distro_compare_repo($ENV{'PBTMP'}/$bn,$dest));
    486510            pb_system("sudo mv $ENV{'PBTMP'}/$bn /etc/yum.repos.d","Adding yum repository") if (not -f "/etc/yum.repos.d/$bn");
    487511        } elsif ($bn =~ /\.addmedia/) {
     
    490514            pb_system("chmod 755 $ENV{'PBTMP'}/$bn ; sudo $ENV{'PBTMP'}/$bn 2>&1 > /dev/null","Adding urpmi repository");
    491515        } else {
    492             pb_log(0,"Unable to deal with repository file $i on rpm distro ! Please report to dev team\n");
     516            pb_log(0,"ERROR: Unable to deal with repository file $i on rpm distro ! Please report to dev team\n");
    493517        }
    494518    } elsif ($pbos->{'type'} eq "deb") {
    495         if (($bn =~ /\.sources.list$/) && (not -f "/etc/apt/sources.list.d/$bn")) {
     519        if ($bn =~ /\.sources.list$/) {
     520            my $dest = "/etc/apt/sources.list.d/$bn";
     521            return if (pb_distro_compare_repo($ENV{'PBTMP'}/$bn,$dest));
    496522            pb_system("sudo mv $ENV{'PBTMP'}/$bn /etc/apt/sources.list.d","Adding apt repository");
    497523            pb_system("sudo apt-get update","Updating apt repository");
    498524        } else {
    499             pb_log(0,"Unable to deal with repository file $i on deb distro ! Please report to dev team\n");
     525            pb_log(0,"ERROR: Unable to deal with repository file $i on deb distro ! Please report to dev team\n");
    500526        }
    501527    } else {
    502         pb_log(0,"Unable to deal with repository file $i on that distro ! Please report to dev team\n");
     528        pb_log(0,"ERROR: Unable to deal with repository file $i on that distro ! Please report to dev team\n");
    503529    }
    504530}
Note: See TracChangeset for help on using the changeset viewer.