diff options
author | Pep TurrĂ³ Mauri <pep@redhat.com> | 2017-05-21 19:07:57 +0200 |
---|---|---|
committer | Luke Meyer <lmeyer@redhat.com> | 2017-05-22 15:13:15 -0400 |
commit | 946e84af0497f5b7aade361b95f7c1bff9ab45fd (patch) | |
tree | 2ab9ddadcb0cb149c379794bb7f6edda93ddbc6c | |
parent | a1228a7c4acdb088fbf43c9a67b7eccf7ee67d07 (diff) | |
download | openshift-946e84af0497f5b7aade361b95f7c1bff9ab45fd.tar.gz openshift-946e84af0497f5b7aade361b95f7c1bff9ab45fd.tar.bz2 openshift-946e84af0497f5b7aade361b95f7c1bff9ab45fd.tar.xz openshift-946e84af0497f5b7aade361b95f7c1bff9ab45fd.zip |
RPM workaround for the move of cert playbooks
The playbooks/certificate_expiry directory is being moved inside the
openshift-checks tree, and a symlink there is put in place for backwards
compatibility. RPM does not handle this well, so this expands the section
of the specfile that already contains a workaround for this situation to
also handle this move.
-rw-r--r-- | openshift-ansible.spec | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/openshift-ansible.spec b/openshift-ansible.spec index 19e6356e7..1a53be549 100644 --- a/openshift-ansible.spec +++ b/openshift-ansible.spec @@ -161,23 +161,29 @@ BuildArch: noarch %files playbooks %{_datadir}/ansible/%{name}/playbooks -# We moved playbooks/common/openshift-master/library up to the top and replaced -# it with a symlink. RPM doesn't handle this so we have to do some pre-transaction -# magic. See https://fedoraproject.org/wiki/Packaging:Directory_Replacement +# Along the history of openshift-ansible, some playbook directories had to be +# moved and were replaced with symlinks for backwards compatibility. +# RPM doesn't handle this so we have to do some pre-transaction magic. +# See https://fedoraproject.org/wiki/Packaging:Directory_Replacement %pretrans playbooks -p <lua> --- Define the path to directory being replaced below. +-- Define the paths to directories being replaced below. -- DO NOT add a trailing slash at the end. -path = "/usr/share/ansible/openshift-ansible/playbooks/common/openshift-master/library" -st = posix.stat(path) -if st and st.type == "directory" then - status = os.rename(path, path .. ".rpmmoved") - if not status then - suffix = 0 - while not status do - suffix = suffix + 1 - status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) +dirs_to_sym = { + "/usr/share/ansible/openshift-ansible/playbooks/common/openshift-master/library", + "/usr/share/ansible/openshift-ansible/playbooks/certificate_expiry" +} +for i,path in ipairs(dirs_to_sym) do + st = posix.stat(path) + if st and st.type == "directory" then + status = os.rename(path, path .. ".rpmmoved") + if not status then + suffix = 0 + while not status do + suffix = suffix + 1 + status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) + end + os.rename(path, path .. ".rpmmoved") end - os.rename(path, path .. ".rpmmoved") end end |