]> git.lttng.org Git - lttng-ci.git/commitdiff
ansible: cross-compilers find source gcc version via dpkg
authorKienan Stewart <kstewart@efficios.com>
Fri, 22 Nov 2024 16:43:21 +0000 (11:43 -0500)
committerKienan Stewart <kstewart@efficios.com>
Tue, 26 Nov 2024 18:50:33 +0000 (13:50 -0500)
Change-Id: I828a012e7fef1fdaf0bf4e7a0afe6a3eacb53787
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
automation/ansible/roles/cross-compilers/tasks/setup-Debian.yml

index 95add22384109a7e115861d25d48a8f0a7d0ae07..99d8445542cdf562127115c91cbdf8cc7b88251f 100644 (file)
   block:
     # This step needs to happen after the cross compiler packages are installed
     # so the libgcc cross libraries can be copied
+    - ansible.builtin.shell:
+        cmd: "dpkg -l | grep -E '^ii[ ]+gcc-[0-9]+-cross-base[^-:]' | tr -s ' ' | cut -d ' ' -f 2 | cut -d '-' -f 2 | sort -n | tail -n 1"
+      register: gcc_cross_major_version
     - name: Copy gcc-cross libs
       ansible.builtin.command:
-        argv: ['cp', '-r', "/usr/lib/gcc-cross/{{item}}/12/", "/usr/lib/gcc-cross/{{item}}/4.8.5"]
+        argv: ['cp', '-r', "/usr/lib/gcc-cross/{{item}}/{{gcc_cross_major_version.stdout | trim}}/", "/usr/lib/gcc-cross/{{item}}/4.8.5"]
         creates: "/usr/lib/gcc-cross/{{item}}/4.8.5"
       with_items:
         - aarch64-linux-gnu
This page took 0.029077 seconds and 4 git commands to generate.