diff --git a/roles/copr/backend/files/patches/prunerepo-dataloss.patch b/roles/copr/backend/files/patches/prunerepo-dataloss.patch new file mode 100644 index 0000000000..32bcdff342 --- /dev/null +++ b/roles/copr/backend/files/patches/prunerepo-dataloss.patch @@ -0,0 +1,20 @@ +--- /usr/bin/prunerepo 2019-04-01 18:02:57.000000000 +0000 ++++ /usr/bin/prunerepo 2019-11-12 09:20:27.292341122 +0000 +@@ -40,6 +40,7 @@ + '--refresh', + '--queryformat="%{location}"', + '--quiet', ++ '--setopt=skip_if_unavailable=False', + ] + + get_latest_packages_cmd = get_all_packages_cmd + [ '--latest-limit=1' ] +@@ -117,6 +118,9 @@ + log_info('Removing obsoleted packages...') + was_deletion = False + latest_rpms = get_rpms(get_latest_packages_cmd) ++ if not latest_rpms: ++ log_info("No RPMs available") ++ return was_deletion + all_rpms = get_rpms(get_all_packages_cmd) + to_remove_rpms = set(all_rpms) - set(latest_rpms) + for rpm in to_remove_rpms: diff --git a/roles/copr/backend/tasks/main.yml b/roles/copr/backend/tasks/main.yml index b8ba248ecd..9aa7d2e42e 100644 --- a/roles/copr/backend/tasks/main.yml +++ b/roles/copr/backend/tasks/main.yml @@ -33,6 +33,11 @@ dest=/usr/bin/copr-backend-process-action tags: patches +- name: patch for prunerepo, issue 1090 + patch: src=patches/prunerepo-dataloss.patch + dest=/usr/bin/prunerepo + tags: patches + - name: install openstackclient for image preparation dnf: state=present name=python3-openstackclient when: devel|bool