From 12fa106b8d255bb4987876e8d879289785248d3d Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Aug 05 2022 14:10:05 +0000 Subject: [PATCH 1/3] 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" From 56e5fe5641ea2c81479d3745beb9862bf2b50362 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Aug 08 2022 08:46:49 +0000 Subject: [PATCH 2/3] Support for both -c and -r option for rpmlint2 --- diff --git a/roles/rpm-lint/tasks/main.yaml b/roles/rpm-lint/tasks/main.yaml index 2e58562..468482a 100644 --- a/roles/rpm-lint/tasks/main.yaml +++ b/roles/rpm-lint/tasks/main.yaml @@ -21,25 +21,31 @@ shell: rpmlint --version register: version -- 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 }}" +- 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: Check for rpmlint.toml + stat: + path: "{{ zuul.project.src_dir }}/rpmlint.toml" + register: toml + +- 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 2.X - shell: rpmlint ./*.spec ./*.rpm + shell: rpmlint {% if rpmlintrc | default("") %} -r {{ rpmlintrc }} {% endif %} {% if toml.stat.isreg | default(false) %} -c rpmlint.toml {% endif %} ./*.spec ./*.rpm args: chdir: "{{ zuul.project.src_dir }}" when: version.stdout != "rpmlint version 1.11" From a2ef11e0e1a46205e5d372a72db6647ce0bc8801 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Aug 08 2022 10:16:45 +0000 Subject: [PATCH 3/3] Add desktop-file-utils deps which is missing from rpmlint package reqs --- diff --git a/roles/rpm-lint/tasks/main.yaml b/roles/rpm-lint/tasks/main.yaml index 468482a..f8f3752 100644 --- a/roles/rpm-lint/tasks/main.yaml +++ b/roles/rpm-lint/tasks/main.yaml @@ -1,7 +1,9 @@ --- - name: Install system dependencies yum: - name: rpmlint + name: + - rpmlint + - desktop-file-utils state: latest become: true