Changeset 1523


Ignore:
Timestamp:
May 12, 2012, 2:22:11 AM (7 years ago)
Author:
bruno
Message:
  • pb.conf: Add scilinux to list of OS's. Add case where centos versioning include minor since centos makes major changes in minor releases. Fix typo in oracle linux regex. Proposes min dependencies separately for centos-5.2, 5.6 others just match that set. Add next ubuntu codename. (Eric Anderson)
  • Distribution.pm: Add new pb_pbos_to_keylist function that generates the keys that should be used for looking up filter filenames or keys into the hash-maps. New function will generate 5.m, for all m in [0,n] for version 5.n of some OS. Useful because minor versions are usually similar. Use it in distro_get_param, simplifying the function and making it more powerful. Fix comment to be correct, you can check for scalar/list context if you want, but that's not what this code does.
Location:
devel/pb-modules
Files:
2 edited

Legend:

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

    r1522 r1523  
    119119osambiguous debian = debian,ubuntu
    120120osambiguous suse = suse,sles,opensuse
    121 osambiguous redhat = redhat,rhel,centos,mandrake,mandriva,vmware,oel
     121osambiguous redhat = redhat,rhel,centos,mandrake,mandriva,vmware,oel,scilinux
    122122osambiguous lsb = ubuntu,lsb
    123123osambiguous os-release = opensuse,fedora,arch
     
    138138#osrelexpr rhel = Red Hat (?:Enterprise Linux|Linux Advanced Server) .*release ([0-9.]+).* \(
    139139osrelexpr rhel = Red Hat (?:Enterprise Linux|Linux Advanced Server) .*release ([0-9]+).* \(
     140# If you want to differentiate .release for CentOS
     141#osrelexpr centos = .*CentOS .*release ([0-9.]+)
    140142osrelexpr centos = .*CentOS .*release ([0-9]).*
    141 osrelexpr oel = Oracle Linux Server) .*release ([0-9]+).* \(
     143osrelexpr oel = Oracle Linux Server .*release ([0-9]+).* \(
    142144osrelexpr redhat = Red Hat Linux release (.+) \(
     145# If you want to differentiate .release for Scientific
     146#osrelexpr scilinux = Scientific Linux release ([0-9\.]+)\b
     147osrelexpr scilinux = Scientific Linux release ([0-9]+).*
    143148osrelexpr sles = SUSE .* Enterprise Server (\d+) \(
    144149osrelexpr suse = SUSE LINUX (\d.+) \(
     
    181186osfamily asianux = rh
    182187osfamily centos = rh
     188osfamily scilinux = rh
    183189osfamily mandrake = md
    184190osfamily mandriva = md
     
    274280osremovedotinver redhat = true
    275281
     282# For that OS, we want to consider all previous minor versions
     283# for configuration items and not just the precise version.
     284# E.g. with t for rhel when dealing with 6.2 we will also look at 6.1 and 6.0
     285# Should be in sync wirh regular expressions from osrelexpr upper
     286#osuseminorrel rhel = true
     287
    276288# These deps are needed before setupvm|ve can be run.
    277289# Install them with your distribution in VM or automatically in VE
     
    311323#
    312324# CentOS-5.6 moved python-libs into a separate package.  List it or otherwise we can't run yum.
    313 #
    314325rbsmindep centos-5 = MAKEDEV,SysVinit,audit-libs,basesystem,bash,beecrypt,bzip2-libs,centos-release,coreutils,cracklib,cracklib-dicts,db4,device-mapper,e2fsprogs,e2fsprogs-libs,elfutils-libelf,ethtool,expat,filesystem,findutils,gawk,gdbm,glib2,glibc,glibc-common,grep,info,initscripts,iproute,iputils,krb5-libs,libacl,libattr,libcap,libgcc,libidn,libselinux,libsepol,libstdc++,libsysfs,libtermcap,libxml2,libxml2-python,mcstrans,mingetty,mktemp,module-init-tools,ncurses,neon,net-tools,nss,nspr,openssl,pam,pcre,popt,procps,psmisc,python,python-elementtree,python-iniparse,python-libs,python-sqlite,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,sed,setup,shadow-utils,sqlite,sysklogd,termcap,tzdata,udev,util-linux,yum,yum-metadata-parser,zlib
     326# If you distinguish versions use the previous one for 5.6+ and that next one for previous
     327#rbsmindep centos-5.2 = MAKEDEV,SysVinit,audit-libs,basesystem,bash,beecrypt,bzip2-libs,centos-release,coreutils,cracklib,cracklib-dicts,db4,device-mapper,e2fsprogs,e2fsprogs-libs,elfutils-libelf,ethtool,expat,filesystem,findutils,gawk,gdbm,glib2,glibc,glibc-common,grep,info,initscripts,iproute,iputils,keyutils-libs,krb5-libs,libacl,libattr,libcap,libgcc,libidn,libselinux,libsepol,libstdc++,libsysfs,libtermcap,libxml2,libxml2-python,mcstrans,mingetty,mktemp,module-init-tools,ncurses,neon,net-tools,nss,nspr,openssl,pam,pcre,popt,procps,psmisc,python,python-elementtree,python-iniparse,python-sqlite,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,sed,setup,shadow-utils,sqlite,sysklogd,termcap,tzdata,udev,util-linux,yum,yum-metadata-parser,zlib
    315328rbsmindep centos-5-ia64 = MAKEDEV,SysVinit,audit-libs,bash,beecrypt,bzip2-libs,centos-release,coreutils,cracklib,cracklib-dicts,db4,device-mapper,e2fsprogs,e2fsprogs-libs,elfutils-libelf,ethtool,expat,filesystem,findutils,gawk,gdbm,glib2,glibc,glibc-common,grep,info,initscripts,iproute,iputils,krb5-libs,libacl,libattr,libcap,libgcc,libidn,libselinux,libsepol,libstdc++,libsysfs,libtermcap,libxml2,libxml2-python,mcstrans,mingetty,mktemp,module-init-tools,ncurses,neon,net-tools,nss,nspr,openssl,pam,pcre,popt,procps,psmisc,python,python-elementtree,python-libs,python-sqlite,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,sed,setup,shadow-utils,sqlite,sysklogd,termcap,tzdata,udev,util-linux,yum,yum-metadata-parser,zlib
    316329#
     
    321334#
    322335rbsmindep rhel-6 = MAKEDEV,ConsoleKit-libs,audit-libs,basesystem,bash,bzip2-libs,c-ares,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,db4,dbus,dbus-libs,device-mapper,device-mapper-libs,dhclient,e2fsprogs,e2fsprogs-libs,elfutils-libelf,expat,fedora-release,fedora-release-notes,file,file-libs,filesystem,findutils,gamin,gawk,gdbm,glib2,glibc,glibc-common,gnupg2,gpgme,grep,info,initscripts,iproute,iputils,keyutils-libs,krb5-libs,libacl,libattr,libcap,libcom_err,libcurl,libgcc,libgcrypt,libgpg-error,libidn,libselinux,libsepol,libssh2,libstdc++,libusb,libxml2,linux-atm-libs,logrotate,lua,mingetty,module-init-tools,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,nss-softokn,nss-softokn-freebl,nss-util,openldap,openssl,pam,passwd,pcre,pinentry,popt,procps,psmisc,pth,pygpgme,python,python-iniparse,python-libs,python-pycurl,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,rsyslog,sed,setup,shadow-utils,sqlite,sysvinit-tools,tzdata,udev,upstart,util-linux-ng,vim-minimal,xz-libs,yum,yum-metadata-parser,zlib
     336#
    323337rbsmindep oel-6 = MAKEDEV,ConsoleKit-libs,audit-libs,basesystem,bash,bzip2-libs,c-ares,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,db4,dbus,dbus-libs,device-mapper,device-mapper-libs,dhclient,e2fsprogs,e2fsprogs-libs,elfutils-libelf,expat,fedora-release,fedora-release-notes,file,file-libs,filesystem,findutils,gamin,gawk,gdbm,glib2,glibc,glibc-common,gnupg2,gpgme,grep,info,initscripts,iproute,iputils,keyutils-libs,krb5-libs,libacl,libattr,libcap,libcom_err,libcurl,libgcc,libgcrypt,libgpg-error,libidn,libselinux,libsepol,libssh2,libstdc++,libusb,libxml2,linux-atm-libs,logrotate,lua,mingetty,module-init-tools,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,nss-softokn,nss-softokn-freebl,nss-util,openldap,openssl,pam,passwd,pcre,pinentry,popt,procps,psmisc,pth,pygpgme,python,python-iniparse,python-libs,python-pycurl,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,rsyslog,sed,setup,shadow-utils,sqlite,sysvinit-tools,tzdata,udev,upstart,util-linux-ng,vim-minimal,xz-libs,yum,yum-metadata-parser,zlib
     338#
     339rbsmindep scilinux-6.0 = MAKEDEV,ConsoleKit-libs,audit-libs,basesystem,bash,bzip2-libs,c-ares,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,db4,dbus,dbus-libs,device-mapper,device-mapper-libs,dhclient,e2fsprogs,e2fsprogs-libs,elfutils-libelf,expat,file,file-libs,filesystem,findutils,gamin,gawk,gdbm,glib2,glibc,glibc-common,gnupg2,gpgme,grep,info,initscripts,iproute,iputils,keyutils-libs,krb5-libs,libacl,libattr,libcap,libcom_err,libcurl,libgcc,libgcrypt,libgpg-error,libidn,libselinux,libsepol,libssh2,libstdc++,libusb,libxml2,logrotate,lua,mingetty,module-init-tools,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,nss-softokn,nss-softokn-freebl,nss-util,openldap,openssl,pam,passwd,pcre,pinentry,popt,procps,psmisc,pth,pygpgme,python,python-iniparse,python-libs,python-pycurl,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,rsyslog,sed,setup,shadow-utils,sl-release,sqlite,sysvinit-tools,tzdata,udev,upstart,util-linux-ng,vim-minimal,xz-libs,yum,yum-metadata-parser,zlib
    324340#
    325341rbsmindep opensuse-10.1 = aaa_base,audit-libs,bash,boost,bzip2,coreutils,cpio,cracklib,curl,cyrus-sasl,db,dbus-1,dbus-1-glib,device-mapper,diffutils,dirmngr,e2fsprogs,ethtool,expat,filesystem,fillup,findutils,gawk,gdbm,glib2,glibc,gpg2,grep,gzip,hal,info,insserv,krb5,libacl,libattr,libcom_err,libicu,libgcc,libgcrypt,libgpg-error,libidn,libksba,libnscd,libreiserfs,libstdc++,libusb,libxcrypt,libxml2,libxml2-python,libzio,libzypp,mingetty,module-init-tools,ncurses,neon,net-tools,openldap2-client,openslp,pam,pam-modules,parted,pciutils,pcre,perl,permissions,pinentry,pmtools,popt,procps,psmisc,pwdutils,python,python-elementtree,python-sqlite,python-urlgrabber,rpm,rpm-python,sed,setserial,sqlite,suse-release,sysvinit,termcap,udev,util-linux,yum,zlib
     
    378394rbsmirrorsrv centos-5-ia64 = http://dev.centos.org/~z00dax/ia64/c5-wip/ia64/RPMS/
    379395rbsmirrorsrv centos-6 = http://mirrors.kernel.org/centos/$pbos->{'version'}/os/$pbos->{'arch'}/Packages
     396rbsmirrorsrv scilinux = http://ftp.scientificlinux.org/linux/scientific/$pbos->{'version'}/$pbos->{'arch'}/os/Packages
    380397#rbsmirrorsrv rhel =
    381398# pbos->{'arch'} == i586 for i386 repo
     
    561578oscodename ubuntu-11.04 = natty
    562579oscodename ubuntu-11.10 = oneiric
     580oscodename ubuntu-12.04 = precise
    563581
    564582# Commands needed on the underlying system
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r1521 r1523  
    132132$pbos->{'family'} = pb_distro_get_param($pbos,pb_conf_get("osfamily"));
    133133$pbos->{'type'} = pb_distro_get_param($pbos,pb_conf_get("ostype"));
    134 ($pbos->{'os'},$pbos->{'install'},$pbos->{'suffix'},$pbos->{'nover'},$pbos->{'rmdot'},$pbos->{'update'}) = pb_distro_get_param($pbos,pb_conf_get("os","osins","ossuffix","osnover","osremovedotinver","osupd"));
     134($pbos->{'os'},$pbos->{'install'},$pbos->{'suffix'},$pbos->{'nover'},$pbos->{'rmdot'},$pbos->{'update'},$pbos->{'useminor'}) = pb_distro_get_param($pbos,pb_conf_get("os","osins","ossuffix","osnover","osremovedotinver","osupd","osuseminorrel"));
    135135#($pbos->{'family'},$pbos->{'type'},$pbos->{'os'},$pbos->{'install'},$pbos->{'suffix'},$pbos->{'nover'},$pbos->{'rmdot'},$pbos->{'update'}) = pb_distro_get_param($pbos,pb_conf_get("osfamily","ostype","os","osins","ossuffix","osnover","osremovedotinver","osupd"));
    136136
     
    594594}
    595595
     596=item B<pb_pbos_to_keylist>
     597
     598Given a pbos object and the generic key, get the list of possible keys for looking up variable for
     599filter names.  The list will be sorted most-specific to least specific.
     600
     601=cut
     602
     603sub pb_pbos_to_keylist ($$) {
     604
     605my ($pbos, $generic) = @_;
     606
     607foreach my $key (qw/name version arch family type os/) {
     608    confess "missing pbos key $key" unless defined $pbos->{$key};
     609}
     610
     611my @keylist = ("$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}", "$pbos->{'name'}-$pbos->{'version'}");
     612
     613# Loop to include also previous minor versions
     614# if configured so
     615if (($pbos{'useminor'} eq "true") && ($pbos->{version} =~ /^(\d+)\.(\d+)$/o)) {
     616        my ($major, $minor) = ($1, $2);
     617        while ($minor > 0) {
     618                $minor--;
     619                push (@keylist, "$pbos->{name}-${major}.$minor");
     620        }
     621        push (@keylist, "$pbos->{name}-$major");
     622}
     623
     624push (@keylist, $pbos->{name}, $pbos->{family}, $pbos->{type}, $pbos->{os}, $generic);
     625return @keylist;
     626}
     627
    596628=item B<pb_distro_get_param>
    597629
     
    603635
    604636my @param;
    605 my $param;
    606637my $pbos = shift;
    607638
     639my @keylist = pb_pbos_to_keylist($pbos,"default");
    608640pb_log(2,"DEBUG: pb_distro_get_param on $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} for ".Dumper(@_)."\n");
    609641foreach my $opt (@_) {
    610     if (defined $opt->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"}) {
    611         $param = $opt->{"$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}"};
    612     } elsif (defined $opt->{"$pbos->{'name'}-$pbos->{'version'}"}) {
    613         $param = $opt->{"$pbos->{'name'}-$pbos->{'version'}"};
    614     } elsif (defined $opt->{"$pbos->{'name'}"}) {
    615         $param = $opt->{"$pbos->{'name'}"};
    616     } elsif (defined $opt->{$pbos->{'family'}}) {
    617         $param = $opt->{$pbos->{'family'}};
    618     } elsif (defined $opt->{$pbos->{'type'}}) {
    619         $param = $opt->{$pbos->{'type'}};
    620     } elsif (defined $opt->{$pbos->{'os'}}) {
    621         $param = $opt->{$pbos->{'os'}};
    622     } elsif (defined $opt->{"default"}) {
    623         $param = $opt->{"default"};
    624     } else {
    625         $param = "";
    626     }
    627 
     642    my $param = "";
     643    foreach my $key (@keylist) {
     644        if (defined $opt->{$key}) {
     645            $param = $opt->{$key};
     646            last;
     647        }
     648    }
    628649    # Allow replacement of variables inside the parameter such as name, version, arch for rpmbootstrap
    629650    # but not shell variable which are backslashed
     
    637658pb_log(2,"DEBUG: pb_distro_get_param on $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} returns ==".Dumper(@param)."==\n");
    638659
    639 # Return one param in scalar context, an array if not.
     660# Return one param if user only asked for one lookup, an array if not.
    640661my $nb = @param;
    641662if ($nb eq 1) {
    642     return($param);
     663    return($param[0]);
    643664} else {
    644665    return(@param);
Note: See TracChangeset for help on using the changeset viewer.