From 12fa106b8d255bb4987876e8d879289785248d3d Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Aug 05 2022 14:10:05 +0000 Subject: Add support for rpmlint 2.X --- diff --git a/roles/rpm-lint/tasks/main.yaml b/roles/rpm-lint/tasks/main.yaml index 21e04c0..2e58562 100644 --- a/roles/rpm-lint/tasks/main.yaml +++ b/roles/rpm-lint/tasks/main.yaml @@ -19,20 +19,27 @@ - name: Show rpmlint version shell: rpmlint --version + register: version -- name: Get rpmlintrc path - shell: ls *.rpmlintrc - register: rpmlintrc_check - ignore_errors: yes - args: - chdir: "{{ zuul.project.src_dir }}" - -- name: Set rpmlintrc path fact - set_fact: - rpmlintrc: "{{ rpmlintrc_check.stdout }}" - when: rpmlintrc_check is succeeded +- block: + - name: Get rpmlintrc path + shell: ls *.rpmlintrc + register: rpmlintrc_check + ignore_errors: yes + args: + chdir: "{{ zuul.project.src_dir }}" + - name: Set rpmlintrc path fact + set_fact: + rpmlintrc: "{{ rpmlintrc_check.stdout }}" + when: rpmlintrc_check is succeeded + - name: Run rpmlint 1.11 + shell: rpmlint {% if rpmlintrc | default("") %} --file {{ rpmlintrc }} {% endif %} ./*.spec ./*.rpm + args: + chdir: "{{ zuul.project.src_dir }}" + when: version.stdout == "rpmlint version 1.11" -- name: Run rpmlint - shell: rpmlint {% if rpmlintrc | default("") %} --file {{ rpmlintrc }} {% endif %} ./*.spec ./*.rpm +- name: Run rpmlint 2.X + shell: rpmlint ./*.spec ./*.rpm args: chdir: "{{ zuul.project.src_dir }}" + when: version.stdout != "rpmlint version 1.11"