Changeset 2249


Ignore:
Timestamp:
Aug 30, 2017, 5:07:28 PM (3 weeks ago)
Author:
bruno
Message:

pbdistrocheck + YAML works

  • Fix for yml main conf file to avoid duplicates
  • Fix for require analysis for YAML module
  • pbdistrocheck works with the main pb.yml file.
  • Need to convert all other configuration files into YAML format
Location:
devel/pb-modules
Files:
2 edited

Legend:

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

    r2241 r2249  
    9191    libranet: /etc/libranet_version
    9292    valinux: /etc/va-release
    93     yellowdog: /etc/yellowdog-release
    9493    ultrapenguin: /etc/ultrapenguin-release
    9594
     
    363362    fedora-10: MAKEDEV,ConsoleKit-libs,audit-libs,basesystem,bash,beecrypt,bzip2-libs,chkconfig,compat-db45,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,db4,dbus,dbus-libs,device-mapper,device-mapper-libs,dhclient,dirmngr,e2fsprogs,e2fsprogs-libs,elfutils-libelf,ethtool,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,libcurl,libgcc,libgcrypt,libgpg-error,libidn,libksba,libselinux,libsepol,libstdc++,libusb,libvolume_id,libxml2,linux-atm-libs,logrotate,lua,mingetty,module-init-tools,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,openldap,openssl,pam,passwd,pcre,pinentry,popt,procps,psmisc,pth,pygpgme,python,python-iniparse,python-libs,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,rsyslog,sed,setup,shadow-utils,sqlite,sysvinit-tools,tzdata,udev,upstart,util-linux-ng,vim-minimal,yum,yum-metadata-parser,zlib
    364363#
    365     fedora-11: MAKEDEV,ConsoleKit-libs,audit-libs,basesystem,bash,beecrypt,bzip2-libs,chkconfig,compat-db45,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,db4,dbus,dbus-libs,device-mapper,device-mapper-libs,dhclient,dirmngr,e2fsprogs,e2fsprogs-libs,elfutils-libelf,ethtool,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,libblkid,libcap,libcom_err,libcurl,libgcc,libgcrypt,libgpg-error,libidn,libksba,libselinux,libsepol,libstdc++,libusb,libvolume_id,libxml2,linux-atm-libs,logrotate,lua,mingetty,module-init-tools,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,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
    366364    fedora-11: MAKEDEV,ConsoleKit-libs,audit-libs,basesystem,bash,beecrypt,bzip2-libs,checkpolicy,chkconfig,compat-db45,coreutils,cpio,cracklib,cracklib-dicts,cronie,crontabs,cyrus-sasl-lib,db4,db4-utils,dbus,dbus-libs,device-mapper,device-mapper-libs,dhclient,diffutils,dirmngr,e2fsprogs,e2fsprogs-libs,elfutils-libelf,ethtool,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,libcurl,libgcc,libgcrypt,libgpg-error,libidn,libksba,libselinux,libsepol,libssh2,libstdc++,libusb,libvolume_id,libxml2,linux-atm-libs,logrotate,lua,mingetty,module-init-tools,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,openldap,openssl,pam,passwd,pcre,pinentry,policycoreutils,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,strace,sysvinit-tools,tcp_wrappers-libs,tzdata,udev,upstart,ustr,util-linux-ng,vim-minimal,yum,yum-metadata-parser,zlib
    367365#
     
    423421    opensuse-11.1: ConsoleKit,cracklib-dict-small,PolicyKit,aaa_base,audit-libs,bash,boost-license,bzip2,coreutils,coreutils-lang,cpio,cpio-lang,cracklib,cyrus-sasl,dbus-1,dbus-1-glib,device-mapper,diffutils,dirmngr,e2fsprogs,ethtool,expat,filesystem,fillup,findutils,gawk,gdbm,glib2,glib2-branding-upstream,glib2-lang,glibc,gpg2,gpg2-lang,grep,gzip,hal,info,insserv,keyutils-libs,krb5,libacl,libattr,libboost_signals1_36_0,libbz2-1,libcom_err2,libcurl4,libdb-4_5,libexpat1,libgcc43,libgcrypt11,libglib-2_0-0,libgobject-2_0-0,libgthread-2_0-0,libgpg-error0,libidn,libksba,libldap-2_4-2,libncurses5,libnscd,libopenssl0_9_8,libreadline5,libreiserfs,libselinux1,libsepol1,libsmbios2,libstdc++43,libusb-0_1-4,libuuid1,libvolume_id1,libxcrypt,libxml2,libxml2-python,libzio,libzypp,login,mingetty,module-init-tools,ncurses-utils,neon,net-tools,openSUSE-release,openSUSE-release-ftp,openslp,pam,pam-config,pam-modules,parted,pciutils,pcre,perl-base,permissions,pinentry,pm-utils,pmtools,popt,procps,psmisc,pth,pwdutils,python,python-urlgrabber,rpm,rpm-python,satsolver-tools,sed,setserial,sysvinit,termcap,terminfo-base,udev,util-linux,uuid-runtime,zlib,zypper
    424422#
    425     opensuse-11.2: ConsoleKit,cracklib-dict-small,PolicyKit,aaa_base,audit-libs,bash,boost-license,bzip2,coreutils,coreutils-lang,cpio,cpio-lang,cracklib,cyrus-sasl,dbus-1,dbus-1-glib,device-mapper,diffutils,dirmngr,e2fsprogs,ethtool,expat,filesystem,fillup,findutils,gawk,gdbm,glib2,glib2-branding-upstream,glib2-lang,glibc,gpg2,gpg2-lang,grep,gzip,hal,info,insserv,keyutils-libs,krb5,libacl,libattr,libboost_signals1_36_0,libbz2-1,libcom_err2,libcurl4,libdb-4_5,libexpat1,libgcc43,libgcrypt11,libglib-2_0-0,libgobject-2_0-0,libgthread-2_0-0,libgpg-error0,libidn,libksba,libldap-2_4-2,libncurses5,libnscd,libopenssl0_9_8,libreadline5,libreiserfs,libselinux1,libsepol1,libsmbios2,libstdc++43,libusb-0_1-4,libuuid1,libvolume_id1,libxcrypt,libxml2,libxml2-python,libzio,libzypp,login,mingetty,module-init-tools,ncurses-utils,neon,net-tools,openSUSE-release,openSUSE-release-ftp,openslp,pam,pam-config,pam-modules,parted,pciutils,pcre,perl-base,permissions,pinentry,pm-utils,pmtools,popt,procps,psmisc,pth,pwdutils,python,python-urlgrabber,rpm,rpm-python,satsolver-tools,sed,setserial,sysvinit,termcap,terminfo-base,udev,util-linux,uuid-runtime,zlib,zypper
    426423# Below is partially fixed, but untested.  It was not working as of 2012-03-19, but is unsupported, so stopped fixing.
    427424    opensuse-11.2: ConsoleKit,cracklib-dict-small,PolicyKit,aaa_base,audit-libs,bash,bzip2,coreutils,cpio,cracklib,cyrus-sasl,dbus-1,dbus-1-glib,device-mapper,diffutils,dirmngr,e2fsprogs,ethtool,expat,filesystem,fillup,findutils,gawk,gdbm,glib2,glib2-branding-upstream,glibc,gpg2,grep,gzip,hal,info,insserv,keyutils-libs,krb5,libacl,libattr,libaugeas0,libbz2-1,libcom_err2,libcurl4,libdb-4_5,libexpat1,libgcrypt11,libglib-2_0-0,libgobject-2_0-0,libgthread-2_0-0,libgpg-error0,libidn,libksba,libldap-2_4-2,libncurses5,libnscd,libopenssl0_9_8,libreadline5,libreadline6,libreiserfs,libselinux1,libsepol1,libsmbios2,libstdc++44,libusb-0_1-4,libuuid1,libvolume_id1,libxcrypt,libxml2,libxml2-python,libzio,libzypp,login,mingetty,module-init-tools,ncurses-utils,neon,net-tools,openSUSE-release,openSUSE-release-ftp,openslp,pam,pam-config,pam-modules,parted,pciutils,pcre,perl-base,permissions,pinentry,pm-utils,procps,psmisc,pwdutils,python,rpm,rpm-python,satsolver-tools,sed,setserial,sysvinit,termcap,terminfo-base,udev,util-linux,zlib,zypper
     
    503500# pbos->{'arch'} == i586 for i386 repo
    504501    mandriva: http://mirrors.kernel.org/mandriva/Mandrakelinux/official/$pbos->{'version'}/$pbos->{'arch'}/media/main/release/
    505     mandriva: ../updates/
     502    mandriva-updates: ../updates/
    506503    mageia: http://mirrors.kernel.org/mageia/distrib/$pbos->{'version'}/$pbos->{'arch'}/media/core/release/
    507     mageia: ../updates/
     504    mageia-updates: ../updates/
    508505#    mageia: http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/$pbos->{'version'}/$pbos->{'arch'}/media/core/release/
    509506#    debian: http://ftp.us.debian.org/debian/
     
    639636    asianux: wget,make,perl-Date-Manip,perl-ExtUtils-MakeMaker,rpm-build,patch,ntp,diffutils
    640637    # perl-core is used starting with fedora 10 - installed before in setupv
    641     fedora:
     638    #fedora:
    642639    fedora: wget,make,rpm-build,patch,ntp,diffutils,perl-Date-Manip,perl-File-MimeInfo,perl-File-BaseDir
    643640    fedora-12: wget,make,perl-ExtUtils-MakeMaker,rpm-build,patch,ntp,diffutils
  • devel/pb-modules/lib/ProjectBuilder/Conf.pm

    r2241 r2249  
    124124my $cf = shift;
    125125my $lh = shift;
    126 my $confver = "0.14";
     126
     127my $ldfunc;
    127128
    128129# Read the content of the config file and cache it in the %h hash then available for queries
     
    139140    close(CONF);
    140141} else {
    141     $lh = LoadFile($cf);
     142    eval {
     143        require YAML;
     144        YAML->import();
     145    };
     146    if ($@) {
     147        eval {
     148            # No YAML found using a more std but less complete one. Old perl only
     149            require Module::Build::YAML;
     150            Module::Build::YAML->import();
     151        };
     152        if ($@) {
     153            die "Unable to handle YAML configuration files without a YAML.pm module\n";
     154        } else {
     155            $ldfunc = \&Module::Build::YAML::LoadFile;
     156        }
     157    } else {
     158        $ldfunc = \&YAML::LoadFile;
     159    }
     160
     161    $lh = $ldfunc->($cf);
    142162}
    143163return($lh);
     
    251271my $conffile = shift;
    252272my $h = shift;
    253 my $confver = "0.14";
     273my $dpfunc;
    254274
    255275confess "No configuration file defined to write into !" if (not defined $conffile);
     
    267287} else {
    268288    # This is the new YAML format
    269     print CONF Dump($h);
     289    eval {
     290        require YAML;
     291        YAML->import();
     292    };
     293    if ($@) {
     294        eval {
     295            # No YAML found using a more std but less complete one. Old perl only
     296            require Module::Build::YAML;
     297            Module::Build::YAML->import();
     298        };
     299        if ($@) {
     300            die "Unable to handle YAML configuration files without a YAML.pm module\n";
     301        } else {
     302            $dpfunc = \&Module::Build::YAML::Dump;
     303        }
     304    } else {
     305        $dpfunc = \&YAML::Dump;
     306    }
     307
     308    print CONF $dpfunc->($h);
    270309}
    271310close(CONF);
Note: See TracChangeset for help on using the changeset viewer.