Changeset 2012


Ignore:
Timestamp:
Oct 12, 2015, 12:17:48 PM (3 years ago)
Author:
bruno
Message:

Adds dnf support

Starting with Fedora 22 the package manager is dnf and not yum anymore
pb needed some adaptations to support it, which have been mostly been
coded in this patch. Tests to be done.

Location:
devel
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-doc/SECURITY

    r1564 r2012  
    1010
    1111In the default pb.conf main configuration files, parameters for osupd and osins for the various distributions call sudo to make the installation of missing packages. These calls are done as 'pb' user by default (or the account configured as rmlogin in the configuration file). In case this is used, and sudo isn't configured accordingly, then the additional required packages will NOT be added and the build will probably fail.
    12 For RM, we may consider that all required packages for the build are already installed on the system, or give rpm/yum/apt/urpmi/zypper... sudo rights to the build account manually.
     12For RM, we may consider that all required packages for the build are already installed on the system, or give rpm/yum/dnf/apt/urpmi/zypper... sudo rights to the build account manually.
    1313Recommended for a manual setup (not using rmsetup): Add manually to your system sudo access for the pb account to the local package install and update command such as /bin/rpm e.g:
    1414cat >> /etc/sudoers << EOF
  • devel/pb-modules/etc/pb.conf

    r1984 r2012  
    229229osupd gen = sudo /usr/bin/emerge --update --deep world; sudo /usr/bin/revdep-rebuild
    230230osupd rpm = sudo /usr/bin/yum clean all; sudo /usr/bin/yum -y update
     231osupd fedora-22 = sudo /usr/bin/dnf clean all; sudo /usr/bin/dnf -y upgrade ; sudo /usr/bin/dnf -y update
    231232osupd md = sudo /usr/sbin/urpmi.update -a ; sudo /usr/sbin/urpmi --auto --auto-select --no-suggests
    232233osupd opensuse-10.2 = sudo /usr/bin/yast2 -i
     
    247248osins gen = sudo /usr/bin/emerge
    248249osins rpm = sudo /usr/bin/yum clean all; sudo /usr/bin/yum -y update ; sudo /usr/bin/yum -y install
     250osins fedora-22 = sudo /usr/bin/dnf clean all; sudo /usr/bin/dnf -y upgrade ; sudo /usr/bin/dnf -y install
    249251osins rhel-2 = sudo /usr/sbin/up2date -y
    250252osins rhel-3 = sudo /usr/sbin/up2date -y
     
    348350#
    349351rbsmindep fedora-20 = ConsoleKit-libs,audit-libs,basesystem,bash,bzip2-libs,ca-certificates,c-ares,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,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,libdb,libffi,libgcc,libgcrypt,libgpg-error,libidn,libselinux,libsepol,libssh2,libstdc++,libusb,libxml2,linux-atm-libs,logrotate,lua,mingetty,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,nss-softokn,nss-softokn-freebl,nss-util,openldap,openssl,openssl-libs,pam,passwd,pcre,perl,perl-Data-Dumper,pinentry,popt,psmisc,pth,pygpgme,python,python-iniparse,python-libs,python-pycurl,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,rsyslog,sed,setup,shadow-utils,sqlite,systemd,tzdata,vim-minimal,xz-libs,yum,yum-metadata-parser,zlib
     352#
     353rbsmindep fedora-21 = ConsoleKit-libs,audit-libs,basesystem,bash,bzip2-libs,ca-certificates,c-ares,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,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,libdb,libffi,libgcc,libgcrypt,libgpg-error,libidn,libselinux,libsepol,libssh2,libstdc++,libusb,libxml2,linux-atm-libs,logrotate,lua,mingetty,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,nss-softokn,nss-softokn-freebl,nss-util,openldap,openssl,openssl-libs,pam,passwd,pcre,perl,perl-Data-Dumper,pinentry,popt,psmisc,pth,pygpgme,python,python-iniparse,python-libs,python-pycurl,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,rsyslog,sed,setup,shadow-utils,sqlite,systemd,tzdata,vim-minimal,xz-libs,yum,yum-metadata-parser,zlib
     354#
     355rbsmindep fedora-22 = ConsoleKit-libs,audit-libs,basesystem,bash,bzip2-libs,ca-certificates,c-ares,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,cyrus-sasl-lib,dbus,dbus-libs,device-mapper,device-mapper-libs,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,libdb,libffi,libgcc,libgcrypt,libgpg-error,libidn,libselinux,libsepol,libssh2,libusb,libxml2,linux-atm-libs,logrotate,lua,mingetty,ncurses,ncurses-base,ncurses-libs,net-tools,nspr,nss,nss-softokn,nss-softokn-freebl,nss-util,openldap,openssl,openssl-libs,pam,passwd,pcre,perl,perl-Data-Dumper,pinentry,popt,psmisc,pth,pygpgme,python,python-iniparse,python-libs,python-pycurl,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,rsyslog,sed,setup,shadow-utils,sqlite,systemd,tzdata,vim-minimal,xz-libs,dnf,yum-metadata-parser,zlib
    350356#
    351357rbsmindep centos-4 = MAKEDEV,SysVinit,audit-libs,basesystem,bash,beecrypt,bzip2-libs,centos-release,coreutils,cracklib,cracklib-dicts,db4,device-mapper,e2fsprogs,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++,libtermcap,libxml2,libxml2-python,mingetty,mktemp,module-init-tools,ncurses,neon,net-tools,openssl,pam,pcre,popt,procps,psmisc,python,python-elementtree,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
     
    657663# Commands needed on the underlying system
    658664oscmd pb = tar,chmod,ls
    659 oscmdopt pb = rpmbuild,dpkg-buildpackage,rpm,dpkg,wget,sudo,apt-get,mv,gzip,ebuild,makepkg,pkgmk,pkgtrans,rm,rpmlint,lintian,chroot,schroot,cp,chown,debsign,qemu-img,qemu,kvm,rpmbootstrap,rinse,mock,debootstrap,mkdir,cat,ssh,scp,yum,bash,make,vi,ssh-keygen,svn,hg,cvs,git,svk,svn2cl,cvs2cl,urpmi
     665oscmdopt pb = rpmbuild,dpkg-buildpackage,rpm,dpkg,wget,sudo,apt-get,mv,gzip,ebuild,makepkg,pkgmk,pkgtrans,rm,rpmlint,lintian,chroot,schroot,cp,chown,debsign,qemu-img,qemu,kvm,rpmbootstrap,rinse,mock,debootstrap,mkdir,cat,ssh,scp,yum,dnf,bash,make,vi,ssh-keygen,svn,hg,cvs,git,svk,svn2cl,cvs2cl,urpmi
    660666oscmd rpmbootstrap = rpm,rpm2cpio,wget
    661667#oscmdopt rpmbootstrap =
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r1972 r2012  
    589589            if ($pbos->{install} =~ /\byum\b/) {
    590590                $reponame="yum";
     591                $dirdest = "/etc/yum.repos.d";
     592            } elsif ($pbos->{install} =~ /\bdnf\b/) {
     593                $reponame="dnf";
    591594                $dirdest = "/etc/yum.repos.d";
    592595            } elsif ($pbos->{install} =~ /\bzypper\b/) {
  • devel/pb/bin/pb

    r2005 r2012  
    21992199            # By default force GPG check in repo even if we support signature of packages to fail. This is a best practice
    22002200            $pbgpgcheck = 1 if (not defined $pbgpgcheck);
    2201             # Also make a pbscript to generate yum/urpmi bases
     2201            # Also make a pbscript to generate dnf/yum/urpmi bases
    22022202            print PBS << "EOF";
    22032203#!/bin/bash
    2204 # Prepare a script to ease yum setup
     2204# Prepare a script to ease dnf/yum setup
    22052205EOF
    22062206            print PBS "set -x\n" if ($pbdebug gt 1);
     
    37973797
    37983798# First install all required packages
    3799 pb_system("yum clean all","Cleaning yum env","mayfail") if (($pbos->{'name'} eq "fedora") || ($pbos->{'name'} eq "asianux") || ($pbos->{'name'} eq "rhel"));
     3799pb_system("dnf clean all","Cleaning dnf env","mayfail") if (($pbos->{'name'} eq "fedora") && ($pbos->{'version'} >= 22));
     3800pb_system("yum clean all","Cleaning yum env","mayfail") if ((($pbos->{'name'} eq "fedora") && ($pbos->{'version'} < 22)) || ($pbos->{'name'} eq "asianux") || ($pbos->{'name'} eq "rhel"));
    38003801my ($ospkgdep) = pb_conf_get_if("ospkgdep");
    38013802   
  • devel/rpmbootstrap/bin/rpmbootstrap

    r1982 r2012  
    354354    if (($pbos->{'name'} eq "fedora") && ($pbos->{'version'} > 8)) {
    355355        $oscachedir = "$vepath/var/cache/yum/$pbos->{'arch'}/$pbos->{'version'}/fedora/packages";
    356         $osupdcachedir = "$vepath/var/cache/yum/$pbos->{'arch'}/$pbos->{'version'}/updates/packages";
     356        #$osupdcachedir = "$vepath/var/cache/yum/$pbos->{'arch'}/$pbos->{'version'}/updates/packages";
    357357        $osupdcachedir = "$vepath/var/cache/yum/updates-released/packages/";
    358358    }
     359} elsif ($pbos->{'install'} =~ /dnf/) {
     360    $osupdname = "DNF";
     361    $oscachedir = "$vepath/var/cache/dnf/$pbos->{'arch'}/$pbos->{'version'}/fedora/packages";
     362    $osupdcachedir = "$vepath/var/cache/dnf/updates-released/packages/";
    359363} elsif ($pbos->{'install'} =~ /zypper/) {
    360364    $oscachedir = "$vepath/var/cache/zypp/packages/opensuse/suse/$pbos->{'arch'}";
     
    442446
    443447# yum needs that distro-release package be installed, so force it
    444 if ($pbos->{'install'} =~ /yum/) {
     448if (($pbos->{'install'} =~ /yum/) || ($pbos->{'install'} =~ /dnf/)) {
    445449    my $ddir = $pbos->{'name'};
    446450    foreach my $p1 (<$cachedir/($ddir|redhat)-release-*.rpm>) {
     
    504508
    505509pb_log(1,"Adapting $osupdname repository entries\n");
    506 if ($pbos->{'install'} =~ /yum/) {
     510if (($pbos->{'install'} =~ /yum/) || ($pbos->{'install'} =~ /dnf/)) {
    507511    #
    508     # Force the architecture for yum
     512    # Force the architecture for yum/dnf
    509513    # The goal is to allow i386 chroot on x86_64
    510514    #
    511     # FIX: Not sufficient to have yum working
     515    # FIX: Not sufficient to have yum/dnf working
    512516    # mirrorlist is not usable
    513517    # $releasever also needs to be filtered
    514518    # yum.conf as well
    515     foreach my $i (<$vepath/etc/yum.repos.d/*.repo>,"$vepath/etc/yum.conf") {
     519    foreach my $i (<$vepath/etc/yum.repos.d/*.repo>,"$vepath/etc/yum.conf","$vepath/etc/dnf/dnf.conf") {
    516520        pb_system("sed -i -e 's/\$basearch/$pbos->{'arch'}/g' $i","","quiet");
    517521        pb_system("sed -i -e 's/\$releasever/$pbos->{'version'}/g' $i","","quiet");
     
    521525        pb_system("sed -i -e 's|^#baseurl.*\$|baseurl=$repo|' $i","","quiet");
    522526    }
    523     $minipkglist = "ldconfig yum passwd vim-minimal dhclient authconfig";
     527    my $pkgmgr = "";
     528    if ($pbos->{'install'} =~ /yum/) {
     529        $pkgmgr = "yum";
     530    }
     531    if ($pbos->{'install'} =~ /dnf/) {
     532        $pkgmgr = "dnf";
     533    }
     534    $minipkglist = "ldconfig $pkgmgr passwd vim-minimal dhclient authconfig";
    524535} elsif ($pbos->{'install'} =~ /zypper/) {
    525536    pb_mkdir_p("$vepath/etc/zypp/repos.d");
     
    626637    pb_system("chroot $vepath /usr/bin/yum clean all","Cleaning yum");
    627638}
     639if ($pbos->{'install'} =~ /dnf/) {
     640    pb_system("chroot $vepath /usr/bin/dnf clean all","Cleaning dnf");
     641}
    628642pb_system("umount $vepath/proc","Unmounting /proc");
    629643find(\&unlink_old_conf, $vepath);
     
    704718my $repo = $mirror;
    705719my $found = 0;
    706 if ($pbos->{'install'} =~ /yum/) {
     720if (($pbos->{'install'} =~ /yum/) || ($pbos->{'install'} =~ /dnf/)) {
    707721    my $response1;
    708722    while ($found == 0) {
  • devel/website/about.shtml

    r1315 r2012  
    3939    <li>Multiple systems (RPM Linux - Red Hat, SuSE, Mandriva, ..., deb Linux - Debian, Ubuntu, ..., ebuild - Gentoo, pkg Solaris/OpenSolaris, ...)</li>
    4040    <li>Multiple build environments (local, VM - QEMU, KVM, ..., VE - rpmbootstrap, mock, rinse, debootstrap, RM - ssh...)</li>
    41     <li>Multiple repository manager (yum, urpmi, apt, ...)</li>
     41    <li>Multiple repository manager (yum, dnf, urpmi, apt, ...)</li>
    4242</ul>
    4343and this, at various phases (development, test, integration, delivery).
  • devel/website/downloads.shtml

    r1958 r2012  
    6464<p>
    6565<p>For Fedora distributions, after downloading the <a href="ftp://ftp.project-builder.org/fedora/">repo file</a> pb.repo and adding it to the /etc/yum.repos.d directory, just use the magic:<br>
    66 <tt>yum install project-builder</tt></p>
     66<tt>yum|dnf install project-builder</tt></p>
    6767<p>
    6868For Debian/Ubuntu, just use the magic: <br>
Note: See TracChangeset for help on using the changeset viewer.