From nobody Fri Mar 29 09:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557235075; cv=none; d=zoho.com; s=zohoarc; b=joDveWUmZ4yR3PI9N0zWwqJpZwyUHiKyBTSCPSfq+4xJjag9McTzHy9FLb0xiG5zUgX1P9iAm0ZsSfbziBw1rseJs+iJf8LBphsoFAnoYsRYTMh5j0CqlaUJaXTKY6Z137aOHVAn7wO4nXVC/wikT7VoPMz0JHicHCh5iU36C8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557235075; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2c0h5eJieRiQLRJFzV2BXqoCyab5DxDtnXyKyo9ImGk=; b=EgFFCxjgxyXm51tC3IEO+SIAssXc2+eD2DVuW3V986oF/IyJ5B8A4nCGUjZqBcw7in4ZUgqdkyr2HMuO4NL77FpHxqlRXYgU2H4xBPKNIBOOkkP3SVAaoWUedJkNv30274Pmk53uDNeL6ZQ81BN7+x4xNNsakny3/y/Xc6JBCGI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557235075186322.5285524009465; Tue, 7 May 2019 06:17:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 08691F74CD; Tue, 7 May 2019 13:17:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9C8064049; Tue, 7 May 2019 13:17:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 908993FB13; Tue, 7 May 2019 13:17:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x47DHowR001524 for ; Tue, 7 May 2019 09:17:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id C07D560C89; Tue, 7 May 2019 13:17:50 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4456160C7A for ; Tue, 7 May 2019 13:17:48 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 7 May 2019 15:17:39 +0200 Message-Id: <20190507131742.9762-2-abologna@redhat.com> In-Reply-To: <20190507131742.9762-1-abologna@redhat.com> References: <20190507131742.9762-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 1/4] guests: Introduce package_manager X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 07 May 2019 13:17:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Platforms that share the same package format might still want to use different package managers, a good example being CentOS with yum and Fedora with dnf. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- guests/host_vars/libvirt-centos-7/main.yml | 1 + guests/host_vars/libvirt-debian-9/main.yml | 1 + guests/host_vars/libvirt-debian-sid/main.yml | 1 + guests/host_vars/libvirt-fedora-29/main.yml | 1 + guests/host_vars/libvirt-fedora-30/main.yml | 1 + guests/host_vars/libvirt-fedora-rawhide/main.yml | 1 + guests/host_vars/libvirt-freebsd-11/main.yml | 1 + guests/host_vars/libvirt-freebsd-12/main.yml | 1 + guests/host_vars/libvirt-freebsd-current/main.yml | 1 + guests/host_vars/libvirt-ubuntu-18/main.yml | 1 + 10 files changed, 10 insertions(+) diff --git a/guests/host_vars/libvirt-centos-7/main.yml b/guests/host_vars/= libvirt-centos-7/main.yml index fa4fc67..94e29af 100644 --- a/guests/host_vars/libvirt-centos-7/main.yml +++ b/guests/host_vars/libvirt-centos-7/main.yml @@ -13,6 +13,7 @@ projects: - virt-viewer =20 package_format: 'rpm' +package_manager: 'yum' os_name: 'CentOS' os_version: '7' =20 diff --git a/guests/host_vars/libvirt-debian-9/main.yml b/guests/host_vars/= libvirt-debian-9/main.yml index ec7e6b4..6b685a4 100644 --- a/guests/host_vars/libvirt-debian-9/main.yml +++ b/guests/host_vars/libvirt-debian-9/main.yml @@ -17,6 +17,7 @@ projects: - virt-viewer =20 package_format: 'deb' +package_manager: 'apt-get' os_name: 'Debian' os_version: '9' =20 diff --git a/guests/host_vars/libvirt-debian-sid/main.yml b/guests/host_var= s/libvirt-debian-sid/main.yml index 1c7a29b..3808383 100644 --- a/guests/host_vars/libvirt-debian-sid/main.yml +++ b/guests/host_vars/libvirt-debian-sid/main.yml @@ -17,6 +17,7 @@ projects: - virt-viewer =20 package_format: 'deb' +package_manager: 'apt-get' os_name: 'Debian' os_version: 'Sid' =20 diff --git a/guests/host_vars/libvirt-fedora-29/main.yml b/guests/host_vars= /libvirt-fedora-29/main.yml index bebf171..ac0228d 100644 --- a/guests/host_vars/libvirt-fedora-29/main.yml +++ b/guests/host_vars/libvirt-fedora-29/main.yml @@ -18,6 +18,7 @@ projects: - virt-viewer =20 package_format: 'rpm' +package_manager: 'dnf' os_name: 'Fedora' os_version: '29' =20 diff --git a/guests/host_vars/libvirt-fedora-30/main.yml b/guests/host_vars= /libvirt-fedora-30/main.yml index 4ad27a6..491b112 100644 --- a/guests/host_vars/libvirt-fedora-30/main.yml +++ b/guests/host_vars/libvirt-fedora-30/main.yml @@ -18,6 +18,7 @@ projects: - virt-viewer =20 package_format: 'rpm' +package_manager: 'dnf' os_name: 'Fedora' os_version: '30' =20 diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml b/guests/host= _vars/libvirt-fedora-rawhide/main.yml index ed0a3fa..db46825 100644 --- a/guests/host_vars/libvirt-fedora-rawhide/main.yml +++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml @@ -28,6 +28,7 @@ projects: - virt-viewer+mingw64 =20 package_format: 'rpm' +package_manager: 'dnf' os_name: 'Fedora' os_version: 'Rawhide' =20 diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml b/guests/host_var= s/libvirt-freebsd-11/main.yml index ed805c9..e9f6d03 100644 --- a/guests/host_vars/libvirt-freebsd-11/main.yml +++ b/guests/host_vars/libvirt-freebsd-11/main.yml @@ -16,6 +16,7 @@ projects: - virt-viewer =20 package_format: 'pkg' +package_manager: 'pkg' os_name: 'FreeBSD' os_version: '11' =20 diff --git a/guests/host_vars/libvirt-freebsd-12/main.yml b/guests/host_var= s/libvirt-freebsd-12/main.yml index 8bbe158..ba3ba62 100644 --- a/guests/host_vars/libvirt-freebsd-12/main.yml +++ b/guests/host_vars/libvirt-freebsd-12/main.yml @@ -16,6 +16,7 @@ projects: - virt-viewer =20 package_format: 'pkg' +package_manager: 'pkg' os_name: 'FreeBSD' os_version: '12' =20 diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml b/guests/hos= t_vars/libvirt-freebsd-current/main.yml index 62498fd..74e1856 100644 --- a/guests/host_vars/libvirt-freebsd-current/main.yml +++ b/guests/host_vars/libvirt-freebsd-current/main.yml @@ -16,6 +16,7 @@ projects: - virt-viewer =20 package_format: 'pkg' +package_manager: 'pkg' os_name: 'FreeBSD' os_version: 'Current' =20 diff --git a/guests/host_vars/libvirt-ubuntu-18/main.yml b/guests/host_vars= /libvirt-ubuntu-18/main.yml index bb465e8..5b5bf0c 100644 --- a/guests/host_vars/libvirt-ubuntu-18/main.yml +++ b/guests/host_vars/libvirt-ubuntu-18/main.yml @@ -17,6 +17,7 @@ projects: - virt-viewer =20 package_format: 'deb' +package_manager: 'apt-get' os_name: 'Ubuntu' os_version: '18' =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Mar 29 09:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557235080; cv=none; d=zoho.com; s=zohoarc; b=lgGpC4CMOgviKuk9iz0aWh+ng/FhvF7DkoCTVLv0aAcgTYtiVbdE19MqtUx2rGpsF3mE7umI+1x63ZBp7fiUnylfImhd34hBRY0VY3lLHtwYm3kh619FGXbc34e094ZRNsdGBqM961FzAXXthyecXzU2G1oeIzxIxR3MviVbbho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557235080; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=WxSjBLiRGndpJATc7d4q/LoSCGEmXKCHObETttekxc8=; b=VVzbbuAMhUMpIfb+dHm0SKBQltbOKeNfbsvLj0lE/HquRtzFNT+XM7x/BbPyw7eKye9Q+l5ydElws/IUrqrakSsAFsh2oYcWNC611crDr1MPcBEgSj8aWHPzlXFekL3iWJcWlOBgA139Di58xZpifEmbhsiVTgXDPxDnlvOGCjM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557235080219942.1483002447386; Tue, 7 May 2019 06:18:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EAF9781F35; Tue, 7 May 2019 13:17:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C20AD101E26A; Tue, 7 May 2019 13:17:57 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7D7AC18089CB; Tue, 7 May 2019 13:17:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x47DHt5O001535 for ; Tue, 7 May 2019 09:17:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id AAA5E60BEC; Tue, 7 May 2019 13:17:55 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2CA8660C97 for ; Tue, 7 May 2019 13:17:50 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 7 May 2019 15:17:40 +0200 Message-Id: <20190507131742.9762-3-abologna@redhat.com> In-Reply-To: <20190507131742.9762-1-abologna@redhat.com> References: <20190507131742.9762-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 2/4] guests: Use package_manager everywhere X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 07 May 2019 13:17:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Instead of hardcoding the name of the package manager in commands, use the value obtained from the inventory. In some cases this is necessary, eg. when RPM-based distributions are involved; for most other cases we could get away with keepking the hardcoded names, but it's better to be completely consistent to hopefully avoid usage of the wrong package manager slipping with further changes. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- guests/lcitool | 40 +++++++++++---------- guests/playbooks/update/tasks/base.yml | 12 +++---- guests/playbooks/update/tasks/bootstrap.yml | 16 ++------- 3 files changed, 29 insertions(+), 39 deletions(-) diff --git a/guests/lcitool b/guests/lcitool index 60a01fc..c179775 100755 --- a/guests/lcitool +++ b/guests/lcitool @@ -591,6 +591,7 @@ class Application: =20 facts =3D self._inventory.get_facts(host) package_format =3D facts["package_format"] + package_manager =3D facts["package_manager"] os_name =3D facts["os_name"] os_version =3D facts["os_version"] os_full =3D os_name + os_version @@ -651,6 +652,7 @@ class Application: print("FROM {}".format(facts["docker_base"])) =20 varmap =3D {} + varmap["package_manager"] =3D package_manager varmap["pkgs"] =3D " \\\n ".join(sorted(set(pkgs.values= ()))) if package_format =3D=3D "deb": if args.cross_arch: @@ -667,12 +669,12 @@ class Application: =20 sys.stdout.write(textwrap.dedent(""" RUN export DEBIAN_FRONTEND=3Dnoninteractive && \\ - apt-get update && \\ - apt-get dist-upgrade -y && \\ - apt-get install --no-install-recommends -y \\ + {package_manager} update && \\ + {package_manager} dist-upgrade -y && \\ + {package_manager} install --no-install-recommends -y \\ {pkgs} && \\ - apt-get autoremove -y && \\ - apt-get autoclean -y + {package_manager} autoremove -y && \\ + {package_manager} autoclean -y """).format(**varmap)) if args.cross_arch: # Intentionally a separate RUN command from the above @@ -681,12 +683,12 @@ class Application: sys.stdout.write(textwrap.dedent(""" RUN export DEBIAN_FRONTEND=3Dnoninteractive && \\ dpkg --add-architecture {cross_arch} && \\ - apt-get update && \\ - apt-get dist-upgrade -y && \\ - apt-get install --no-install-recommends -y \\ + {package_manager} update && \\ + {package_manager} dist-upgrade -y && \\ + {package_manager} install --no-install-recommends = -y \\ {cross_pkgs} && \\ - apt-get autoremove -y && \\ - apt-get autoclean -y + {package_manager} autoremove -y && \\ + {package_manager} autoclean -y =20 ENV ABI "{cross_abi}" ENV CONFIGURE_OPTS "--host=3D{cross_abi} \\ @@ -696,18 +698,18 @@ class Application: elif package_format =3D=3D "rpm": if os_name =3D=3D "Fedora" and os_version =3D=3D "Rawhide": sys.stdout.write(textwrap.dedent(""" - RUN yum update -y --nogpgcheck fedora-gpg-keys && \\ - yum update -y && \\ - yum install -y {pkgs} && \\ - yum autoremove -y && \\ - yum clean all -y + RUN {package_manager} update -y --nogpgcheck fedora-gp= g-keys && \\ + {package_manager} update -y && \\ + {package_manager} install -y {pkgs} && \\ + {package_manager} autoremove -y && \\ + {package_manager} clean all -y """).format(**varmap)) else: sys.stdout.write(textwrap.dedent(""" - RUN yum update -y && \\ - yum install -y {pkgs} && \\ - yum autoremove -y && \\ - yum clean all -y + RUN {package_manager} update -y && \\ + {package_manager} install -y {pkgs} && \\ + {package_manager} autoremove -y && \\ + {package_manager} clean all -y """).format(**varmap)) =20 def run(self): diff --git a/guests/playbooks/update/tasks/base.yml b/guests/playbooks/upda= te/tasks/base.yml index d71d99f..59f6124 100644 --- a/guests/playbooks/update/tasks/base.yml +++ b/guests/playbooks/update/tasks/base.yml @@ -28,7 +28,7 @@ - os_version =3D=3D 'Rawhide' =20 - name: Update installed packages - command: dnf update --refresh --exclude 'kernel*' -y + command: '{{ package_manager }} update --refresh --exclude "kernel*" -y' args: warn: no when: @@ -36,7 +36,7 @@ - os_version =3D=3D 'Rawhide' =20 - name: Update installed packages - command: dnf update --disablerepo=3D'*' --enablerepo=3Dfedora-rawhide-ke= rnel-nodebug 'kernel*' -y + command: '{{ package_manager }} update --disablerepo=3D"*" --enablerepo= =3Dfedora-rawhide-kernel-nodebug "kernel*" -y' args: warn: no when: @@ -51,19 +51,19 @@ - package_format =3D=3D 'deb' =20 - name: Update installed packages - shell: pkg update && pkg upgrade -y + shell: '{{ package_manager }} update && {{ package_manager }} upgrade -y' when: - package_format =3D=3D 'pkg' =20 - name: Clean up packages after update - command: yum clean packages -y + command: '{{ package_manager }} clean packages -y' args: warn: no when: - package_format =3D=3D 'rpm' =20 - name: Clean up packages after update - command: yum autoremove -y + command: '{{ package_manager }} autoremove -y' args: warn: no when: @@ -77,7 +77,7 @@ - package_format =3D=3D 'deb' =20 - name: Clean up packages after update - shell: pkg clean -y && pkg autoremove -y + shell: '{{ package_manager }} clean -y && {{ package_manager }} autoremo= ve -y' when: - package_format =3D=3D 'pkg' =20 diff --git a/guests/playbooks/update/tasks/bootstrap.yml b/guests/playbooks= /update/tasks/bootstrap.yml index 44bb2c9..2e1dc42 100644 --- a/guests/playbooks/update/tasks/bootstrap.yml +++ b/guests/playbooks/update/tasks/bootstrap.yml @@ -1,6 +1,6 @@ --- - name: Bootstrap the pkgng package manager - raw: env ASSUME_ALWAYS_YES=3DYES pkg bootstrap + raw: 'env ASSUME_ALWAYS_YES=3DYES {{ package_manager }} bootstrap' when: - package_format =3D=3D 'pkg' =20 @@ -14,16 +14,4 @@ - os_version =3D=3D '7' =20 - name: Bootstrap Ansible - raw: 'yum install -y {{ python }}' - when: - - package_format =3D=3D 'rpm' - -- name: Bootstrap Ansible - raw: 'apt-get install -y {{ python }}' - when: - - package_format =3D=3D 'deb' - -- name: Bootstrap Ansible - raw: 'pkg install -y {{ python }}' - when: - - package_format =3D=3D 'pkg' + raw: '{{ package_manager }} install -y {{ python }}' --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Mar 29 09:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557235084; cv=none; d=zoho.com; s=zohoarc; b=ikiZRwR+SNS2eOu7W1B7+uNJEYciY+6v9FOsbM6nEB/GyPjfI1YZbFQCy5j3UsSCsfOHqLRuxdEtHHWFtXkjvjsNYkt5j7YPdGvvkUOI4sfAJzCM8qTXchW7IcqukZQA0dHu/wDiofp2F9MQd7LOfx+AFOe44ZA1H2n6vgx332E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557235084; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=s8EwbuLnko2843snyikH0P6X6pNv1QlT/YGhieohd7w=; b=W8n32a0tRaI/3rGv6JcvuMf64qd5bXrE5rRtzKDO2fsJeDwWJGEMpohZIg2/bZGQ9b5XlXfVJSdxx4oQrN7kp2HGbVfWVPiE9i6gxIgkzQXof5mc7SrVJLX+eFZodlyRv20QQmDwhURd/kCdh+xXEnNKpEV+RLDC/QmK3+4Mxfw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557235084102242.88383604368948; Tue, 7 May 2019 06:18:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 113BE3079B6F; Tue, 7 May 2019 13:18:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8876643F1; Tue, 7 May 2019 13:18:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 83DA518089D4; Tue, 7 May 2019 13:18:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x47DHu55001540 for ; Tue, 7 May 2019 09:17:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7905960C7B; Tue, 7 May 2019 13:17:56 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0037660BEC for ; Tue, 7 May 2019 13:17:55 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 7 May 2019 15:17:41 +0200 Message-Id: <20190507131742.9762-4-abologna@redhat.com> In-Reply-To: <20190507131742.9762-1-abologna@redhat.com> References: <20190507131742.9762-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 3/4] guests: Don't call out to the shell twice X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 07 May 2019 13:18:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We're already doing this for FreeBSD, so do it for CentOS and Fedora as well. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- guests/playbooks/update/tasks/base.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/guests/playbooks/update/tasks/base.yml b/guests/playbooks/upda= te/tasks/base.yml index 59f6124..8fe114e 100644 --- a/guests/playbooks/update/tasks/base.yml +++ b/guests/playbooks/update/tasks/base.yml @@ -56,16 +56,7 @@ - package_format =3D=3D 'pkg' =20 - name: Clean up packages after update - command: '{{ package_manager }} clean packages -y' - args: - warn: no - when: - - package_format =3D=3D 'rpm' - -- name: Clean up packages after update - command: '{{ package_manager }} autoremove -y' - args: - warn: no + shell: '{{ package_manager }} clean packages -y && {{ package_manager }}= autoremove -y' when: - package_format =3D=3D 'rpm' =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Mar 29 09:48:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557235082; cv=none; d=zoho.com; s=zohoarc; b=isdINGNrVA3ZBUYzXHyQdh4ydCojywJd51scr1fjc9cHtx5mRtbxYC1fnTshEaiXyfohplvyy3OnuNLYk79rvSKHCfAesg/5wLFK1Cuj1Ma4zFRP1TyXY3yfMHuxYz2GhwxW356NtLosvGJO3Gp8YpInXWY8HA85hfhsY+ThMhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557235082; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=6aPAzA+1cDtT0PhKwb6FQfRptbNhQeRTCcjdaL3e27g=; b=Y9phokboH5xQMn2S1HQTff56JwO4zEOf0d+Mf6+6g3tF7D2JOt0WbC2exHWIsxRjPxc+z/AtP/Cwpy4SImaEZhn7E2SMPFFQtaGlayQj69kXzqHl1tWDSTmx6DQwO+tfdPQlV78PBL051IWKOUCQa1FHzGXR8bw4uRdb83dxM/A= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557235082612545.4441081276987; Tue, 7 May 2019 06:18:02 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B54487DCD9; Tue, 7 May 2019 13:18:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D00047349; Tue, 7 May 2019 13:18:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2A37E18089D1; Tue, 7 May 2019 13:18:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x47DHvhn001550 for ; Tue, 7 May 2019 09:17:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4B7DF60C97; Tue, 7 May 2019 13:17:57 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C744A60BEC for ; Tue, 7 May 2019 13:17:56 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Tue, 7 May 2019 15:17:42 +0200 Message-Id: <20190507131742.9762-5-abologna@redhat.com> In-Reply-To: <20190507131742.9762-1-abologna@redhat.com> References: <20190507131742.9762-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 4/4] lcitool: Fix Dockerfile alignment X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 07 May 2019 13:18:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Now that we are using package_manager everywhere instead of hardcoding the names, it's finally possible to make the alignment of the resulting Dockerfiles perfect. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- guests/lcitool | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/guests/lcitool b/guests/lcitool index c179775..5cf8efe 100755 --- a/guests/lcitool +++ b/guests/lcitool @@ -649,11 +649,13 @@ class Application: if pkgs[package] is None or cross_policy in ["skip", "fore= ign"]: del pkgs[package] =20 + pkg_align =3D " \\\n" + (" " * len("RUN " + package_manager + " ")) + print("FROM {}".format(facts["docker_base"])) =20 varmap =3D {} varmap["package_manager"] =3D package_manager - varmap["pkgs"] =3D " \\\n ".join(sorted(set(pkgs.values= ()))) + varmap["pkgs"] =3D pkg_align[1:] + pkg_align.join(sorted(set(pkgs.= values()))) if package_format =3D=3D "deb": if args.cross_arch: deb_arch =3D Util.native_arch_to_deb_arch(args.cross_arch) @@ -663,7 +665,7 @@ class Application: varmap["cross_arch"] =3D deb_arch pkg_names =3D [p + ":" + deb_arch for p in cross_pkgs.valu= es()] pkg_names.append(gcc) - varmap["cross_pkgs"] =3D " \\\n ".join(sorted(s= et(pkg_names))) + varmap["cross_pkgs"] =3D pkg_align[1:] + pkg_align.join(so= rted(set(pkg_names))) varmap["cross_abi"] =3D abi varmap["cross_lib"] =3D lib =20 @@ -671,8 +673,7 @@ class Application: RUN export DEBIAN_FRONTEND=3Dnoninteractive && \\ {package_manager} update && \\ {package_manager} dist-upgrade -y && \\ - {package_manager} install --no-install-recommends -y \\ - {pkgs} && \\ + {package_manager} install --no-install-recommends -y {= pkgs} && \\ {package_manager} autoremove -y && \\ {package_manager} autoclean -y """).format(**varmap)) @@ -685,8 +686,7 @@ class Application: dpkg --add-architecture {cross_arch} && \\ {package_manager} update && \\ {package_manager} dist-upgrade -y && \\ - {package_manager} install --no-install-recommends = -y \\ - {cross_pkgs} && \\ + {package_manager} install --no-install-recommends = -y {cross_pkgs} && \\ {package_manager} autoremove -y && \\ {package_manager} autoclean -y =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list