From nobody Wed May 14 16:45:26 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524065147298122.37893185424093; Wed, 18 Apr 2018 08:25:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15BAD82DB; Wed, 18 Apr 2018 15:25:45 +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 A611475CF5; Wed, 18 Apr 2018 15:25:44 +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 003E31805972; Wed, 18 Apr 2018 15:25:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3IFPV3h006932 for ; Wed, 18 Apr 2018 11:25:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id E46BE7C26; Wed, 18 Apr 2018 15:25:30 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 887AF1C727 for ; Wed, 18 Apr 2018 15:25:30 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 17:25:20 +0200 Message-Id: <20180418152522.17923-4-abologna@redhat.com> In-Reply-To: <20180418152522.17923-1-abologna@redhat.com> References: <20180418152522.17923-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH 3/5] guests: Figure out more OS-dependent paths ahead of time 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: , MIME-Version: 1.0 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 18 Apr 2018 15:25:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We will need to know ccache's absolute path at the playbook level later on, so while we're at it we might as well treat all OS-dependent paths the same way and figure them out when configuring the guest rather than at login time. Signed-off-by: Andrea Bolognani --- guests/tasks/paths.yml | 32 ++++++++++++++++++++++++++++++++ guests/templates/bashrc | 8 +++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/guests/tasks/paths.yml b/guests/tasks/paths.yml index 36b699f..00decc9 100644 --- a/guests/tasks/paths.yml +++ b/guests/tasks/paths.yml @@ -8,7 +8,12 @@ register: which with_items: - bash + - ccache + - gmake - java + - make + - python2 + - python3 - su =20 - name: 'Look for files' @@ -32,6 +37,33 @@ - name: 'Export paths' set_fact: bash: '{{ commands["bash"] }}' + ccache: '{{ commands["ccache"] }}' java: '{{ commands["java"] }}' su: '{{ commands["su"] }}' sudoers: '{{ files["sudoers"] }}' + +# Prefer gmake, fall back to make +- name: 'Export paths' + set_fact: + make: '{{ commands["gmake"] }}' + when: + - commands["gmake"] !=3D '' + +- name: 'Export paths' + set_fact: + make: '{{ commands["make"] }}' + when: + - make is undefined + +# Prefer python3, fall back to python2 +- name: 'Export paths' + set_fact: + python: '{{ commands["python3"] }}' + when: + - commands["python3"] !=3D '' + +- name: 'Export paths' + set_fact: + python: '{{ commands["python2"] }}' + when: + - python is undefined diff --git a/guests/templates/bashrc b/guests/templates/bashrc index e925cd9..65c82cd 100644 --- a/guests/templates/bashrc +++ b/guests/templates/bashrc @@ -11,9 +11,11 @@ export OSINFO_SYSTEM_DIR=3D"{{ OSINFO_SYSTEM_DIR }}" export PERL5LIB=3D"{{ PERL5LIB }}" export PYTHONPATH=3D"{{ PYTHONPATH }}" =20 -which python3 >/dev/null 2>&1 && export PYTHON=3D"python3" || export PYTHO= N=3D"python2" -which gmake >/dev/null 2>&1 && export MAKE=3D"gmake" || export MAKE=3D"mak= e" -which ccache >/dev/null 2>&1 && export CC=3D"ccache cc" +export CCACHE=3D"{{ ccache }}" +export MAKE=3D"{{ make }}" +export PYTHON=3D"{{ python }}" + +test "$CCACHE" && export CC=3D"$CCACHE cc" =20 # Enable bash completion. Only needed on FreeBSD, the system-wide # shell profile will take care of it for us everywhere else --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list