[libvirt-jenkins-ci PATCH 1/7] lcitool: Improve ccache symlinks creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of having the same code snippet twice, once for Linux and
once for FreeBSD, the only actual difference being the name of the
compiler, include the compiler's path in the inventory among other
paths and then figure out the correct name for the symlink based
on that information.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 guests/host_vars/libvirt-centos-7/main.yml    |  1 +
 guests/host_vars/libvirt-centos-8/main.yml    |  1 +
 guests/host_vars/libvirt-debian-10/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-30/main.yml   |  1 +
 guests/host_vars/libvirt-fedora-31/main.yml   |  1 +
 .../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 +
 .../libvirt-freebsd-current/main.yml          |  1 +
 .../host_vars/libvirt-opensuse-151/main.yml   |  1 +
 guests/host_vars/libvirt-ubuntu-1604/main.yml |  1 +
 guests/host_vars/libvirt-ubuntu-1804/main.yml |  1 +
 guests/playbooks/update/tasks/users.yml       | 19 +------------------
 15 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/guests/host_vars/libvirt-centos-7/main.yml b/guests/host_vars/libvirt-centos-7/main.yml
index 7f22d9d..f1fef44 100644
--- a/guests/host_vars/libvirt-centos-7/main.yml
+++ b/guests/host_vars/libvirt-centos-7/main.yml
@@ -21,6 +21,7 @@ os_name: 'CentOS'
 os_version: '7'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-centos-8/main.yml b/guests/host_vars/libvirt-centos-8/main.yml
index bcf4224..48edb78 100644
--- a/guests/host_vars/libvirt-centos-8/main.yml
+++ b/guests/host_vars/libvirt-centos-8/main.yml
@@ -21,6 +21,7 @@ os_name: 'CentOS'
 os_version: '8'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-debian-10/main.yml b/guests/host_vars/libvirt-debian-10/main.yml
index 88e1634..37036e6 100644
--- a/guests/host_vars/libvirt-debian-10/main.yml
+++ b/guests/host_vars/libvirt-debian-10/main.yml
@@ -23,6 +23,7 @@ os_name: 'Debian'
 os_version: '10'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-debian-9/main.yml b/guests/host_vars/libvirt-debian-9/main.yml
index a6f1a56..b46efd1 100644
--- a/guests/host_vars/libvirt-debian-9/main.yml
+++ b/guests/host_vars/libvirt-debian-9/main.yml
@@ -23,6 +23,7 @@ os_name: 'Debian'
 os_version: '9'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-debian-sid/main.yml b/guests/host_vars/libvirt-debian-sid/main.yml
index 5dd51ff..36045cd 100644
--- a/guests/host_vars/libvirt-debian-sid/main.yml
+++ b/guests/host_vars/libvirt-debian-sid/main.yml
@@ -23,6 +23,7 @@ os_name: 'Debian'
 os_version: 'Sid'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-fedora-30/main.yml b/guests/host_vars/libvirt-fedora-30/main.yml
index a15aff2..71b8e7b 100644
--- a/guests/host_vars/libvirt-fedora-30/main.yml
+++ b/guests/host_vars/libvirt-fedora-30/main.yml
@@ -36,6 +36,7 @@ os_name: 'Fedora'
 os_version: '30'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-fedora-31/main.yml b/guests/host_vars/libvirt-fedora-31/main.yml
index 4be1a19..c692715 100644
--- a/guests/host_vars/libvirt-fedora-31/main.yml
+++ b/guests/host_vars/libvirt-fedora-31/main.yml
@@ -24,6 +24,7 @@ os_name: 'Fedora'
 os_version: '31'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-fedora-rawhide/main.yml b/guests/host_vars/libvirt-fedora-rawhide/main.yml
index 3a79a3a..bea4ad1 100644
--- a/guests/host_vars/libvirt-fedora-rawhide/main.yml
+++ b/guests/host_vars/libvirt-fedora-rawhide/main.yml
@@ -24,6 +24,7 @@ os_name: 'Fedora'
 os_version: 'Rawhide'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-freebsd-11/main.yml b/guests/host_vars/libvirt-freebsd-11/main.yml
index 6234e8a..7fbab39 100644
--- a/guests/host_vars/libvirt-freebsd-11/main.yml
+++ b/guests/host_vars/libvirt-freebsd-11/main.yml
@@ -22,6 +22,7 @@ os_name: 'FreeBSD'
 os_version: '11'
 
 bash: /usr/local/bin/bash
+cc: /usr/bin/clang
 ccache: /usr/local/bin/ccache
 java: /usr/local/bin/java
 make: /usr/local/bin/gmake
diff --git a/guests/host_vars/libvirt-freebsd-12/main.yml b/guests/host_vars/libvirt-freebsd-12/main.yml
index 22a3697..abedd95 100644
--- a/guests/host_vars/libvirt-freebsd-12/main.yml
+++ b/guests/host_vars/libvirt-freebsd-12/main.yml
@@ -22,6 +22,7 @@ os_name: 'FreeBSD'
 os_version: '12'
 
 bash: /usr/local/bin/bash
+cc: /usr/bin/clang
 ccache: /usr/local/bin/ccache
 java: /usr/local/bin/java
 make: /usr/local/bin/gmake
diff --git a/guests/host_vars/libvirt-freebsd-current/main.yml b/guests/host_vars/libvirt-freebsd-current/main.yml
index fdc7e9b..9b0ba1f 100644
--- a/guests/host_vars/libvirt-freebsd-current/main.yml
+++ b/guests/host_vars/libvirt-freebsd-current/main.yml
@@ -22,6 +22,7 @@ os_name: 'FreeBSD'
 os_version: 'Current'
 
 bash: /usr/local/bin/bash
+cc: /usr/bin/clang
 ccache: /usr/local/bin/ccache
 java: /usr/local/bin/java
 make: /usr/local/bin/gmake
diff --git a/guests/host_vars/libvirt-opensuse-151/main.yml b/guests/host_vars/libvirt-opensuse-151/main.yml
index bcc5ca3..3e674cc 100644
--- a/guests/host_vars/libvirt-opensuse-151/main.yml
+++ b/guests/host_vars/libvirt-opensuse-151/main.yml
@@ -22,6 +22,7 @@ os_name: 'OpenSUSE'
 os_version: '151'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-ubuntu-1604/main.yml b/guests/host_vars/libvirt-ubuntu-1604/main.yml
index b474264..1eb2345 100644
--- a/guests/host_vars/libvirt-ubuntu-1604/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-1604/main.yml
@@ -22,6 +22,7 @@ os_name: 'Ubuntu'
 os_version: '1604'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/host_vars/libvirt-ubuntu-1804/main.yml b/guests/host_vars/libvirt-ubuntu-1804/main.yml
index ddfeef2..c9515b6 100644
--- a/guests/host_vars/libvirt-ubuntu-1804/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-1804/main.yml
@@ -23,6 +23,7 @@ os_name: 'Ubuntu'
 os_version: '1804'
 
 bash: /bin/bash
+cc: /usr/bin/gcc
 ccache: /usr/bin/ccache
 java: /usr/bin/java
 make: /usr/bin/make
diff --git a/guests/playbooks/update/tasks/users.yml b/guests/playbooks/update/tasks/users.yml
index a6fb0aa..5d202b3 100644
--- a/guests/playbooks/update/tasks/users.yml
+++ b/guests/playbooks/update/tasks/users.yml
@@ -79,24 +79,7 @@
     group: '{{ flavor }}'
   with_items:
     - cc
-    - clang
-  when:
-    - ccache != ''
-    - os_name == 'FreeBSD'
-
-- name: '{{ flavor }}: Create ccache wrappers'
-  file:
-    src: '{{ ccache }}'
-    dest: /home/{{ flavor }}/.ccache/bin/{{ item }}
-    state: link
-    owner: '{{ flavor }}'
-    group: '{{ flavor }}'
-  with_items:
-    - cc
-    - gcc
-  when:
-    - ccache != ''
-    - os_name != 'FreeBSD'
+    - '{{ cc | basename }}'
 
 - name: '{{ flavor }}: Create shell profile'
   template:
-- 
2.25.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux